Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
MediaDBPythonScripte
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
8
Issues
8
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
BA_SI-Projekt
MediaDBPythonScripte
Commits
d3f70c29
Commit
d3f70c29
authored
Mar 11, 2016
by
Nico Schallehn
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ausgabe nach Collection Ordner!!
parent
17916495
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
11 deletions
+19
-11
media.class.php
media.class.php
+19
-11
No files found.
media.class.php
View file @
d3f70c29
...
@@ -148,19 +148,24 @@ class Media {
...
@@ -148,19 +148,24 @@ class Media {
$Endung
=
trim
(
substr
(
$FilenameOrg
,
strripos
(
$FilenameOrg
,
"."
)
+
1
));
$Endung
=
trim
(
substr
(
$FilenameOrg
,
strripos
(
$FilenameOrg
,
"."
)
+
1
));
//Was soll mit den geparsten Film gemacht werden?
//Was soll mit den geparsten Film gemacht werden?
if
(
$action
==
"einlesen"
){
if
(
$action
==
"einlesen"
){
if
(
$this
->
addMovie
(
$array
,
$Pfad
.
$FilenameOrg
,
true
)){
if
(
$this
->
addMovie
(
$array
,
$Pfad
.
$FilenameOrg
,
true
)){
if
((
$Pfad
.
$FilenameOrg
)
==
(
$this
->
PfadzumAusgeben
.
(
$array
[
"3d"
]
==
""
?
$this
->
config
[
"HDD"
][
$this
->
HDDID
][
"Filme"
]
:
$this
->
config
[
"HDD"
][
$this
->
HDDID
][
"3D"
])
.
$Pfad
.
$array
[
"name"
]
.
" ("
.
$array
[
"resolution"
]
.
")"
.
(
$array
[
"3d"
]
!=
""
?
" (3D)"
:
""
)
.
" ("
.
$array
[
"imdbID"
]
.
")."
.
$Endung
)){
if
((
$Pfad
.
$FilenameOrg
)
==
(
$this
->
PfadzumAusgeben
.
(
$array
[
"3d"
]
==
""
?
$this
->
config
[
"HDD"
][
$this
->
HDDID
][
"Filme"
]
:
$this
->
config
[
"HDD"
][
$this
->
HDDID
][
"3D"
])
.
$Pfad
.
$array
[
"name"
]
.
" ("
.
$array
[
"resolution"
]
.
")"
.
(
$array
[
"3d"
]
!=
""
?
" (3D)"
:
""
)
.
" ("
.
$array
[
"imdbID"
]
.
")."
.
$Endung
)){
echo
"Datei liegt schon am ausgabe Ort!"
.
PHP_EOL
;
echo
"Datei liegt schon am ausgabe Ort!"
.
PHP_EOL
;
}
}
else
{
else
{
if
(
!
is_dir
(
$this
->
PfadzumAusgeben
.
(
$array
[
"3d"
]
==
""
?
$this
->
config
[
"HDD"
][
$this
->
HDDID
][
"Filme"
]
:
$this
->
config
[
"HDD"
][
$this
->
HDDID
][
"3D"
])
.
$PfadOrg
)){
if
(
!
is_dir
(
$this
->
PfadzumAusgeben
.
(
$array
[
"3d"
]
==
""
?
$this
->
config
[
"HDD"
][
$this
->
HDDID
][
"Filme"
]
:
$this
->
config
[
"HDD"
][
$this
->
HDDID
][
"3D"
])
.
$array
[
"collection"
]
.
'/'
)){
shell_exec
(
"mkdir '"
.
$this
->
PfadzumAusgeben
.
(
$array
[
"3d"
]
==
""
?
$this
->
config
[
"HDD"
][
$this
->
HDDID
][
"Filme"
]
:
$this
->
config
[
"HDD"
][
$this
->
HDDID
][
"3D"
])
.
$PfadOrg
.
"'"
);
shell_exec
(
"mkdir '"
.
$this
->
PfadzumAusgeben
.
(
$array
[
"3d"
]
==
""
?
$this
->
config
[
"HDD"
][
$this
->
HDDID
][
"Filme"
]
:
$this
->
config
[
"HDD"
][
$this
->
HDDID
][
"3D"
])
.
$array
[
"collection"
]
.
'/'
.
"'"
);
}
if
(
isset
(
$array
[
"collection"
])){
echo
"Collection Ausgabe in eigenen Collection Ordner: "
.
$array
[
"collection"
]
.
PHP_EOL
;
//exit;
}
}
echo
"Verschiebe Datei..."
;
echo
"Verschiebe Datei..."
;
$copy
=
'mv "'
.
$copy
=
'mv "'
.
$Pfad
.
$FilenameOrg
.
'" "'
.
$Pfad
.
$FilenameOrg
.
'" "'
.
$this
->
PfadzumAusgeben
.
(
$array
[
"3d"
]
==
""
?
$this
->
config
[
"HDD"
][
$this
->
HDDID
][
"Filme"
]
:
$this
->
config
[
"HDD"
][
$this
->
HDDID
][
"3D"
])
.
$
PfadOrg
.
$array
[
"name"
]
.
" ("
.
$array
[
"resolution"
]
.
")"
.
(
$array
[
"3d"
]
!=
""
?
" (3D)"
:
""
)
.
" ("
.
$array
[
"imdbID"
]
.
")."
.
$Endung
.
'"'
;
$this
->
PfadzumAusgeben
.
(
$array
[
"3d"
]
==
""
?
$this
->
config
[
"HDD"
][
$this
->
HDDID
][
"Filme"
]
:
$this
->
config
[
"HDD"
][
$this
->
HDDID
][
"3D"
])
.
$
array
[
"collection"
]
.
'/'
.
$array
[
"name"
]
.
" ("
.
$array
[
"resolution"
]
.
")"
.
(
$array
[
"3d"
]
!=
""
?
" (3D)"
:
""
)
.
" ("
.
$array
[
"imdbID"
]
.
")."
.
$Endung
.
'"'
;
file_put_contents
(
"./phpTestout/imdbID/"
.
$array
[
'imdbID'
]
.
".txt"
,
$copy
.
PHP_EOL
,
FILE_APPEND
);
file_put_contents
(
"./phpTestout/imdbID/"
.
$array
[
'imdbID'
]
.
".txt"
,
$copy
.
PHP_EOL
,
FILE_APPEND
);
shell_exec
(
$copy
);
shell_exec
(
$copy
);
echo
"done!"
.
PHP_EOL
;
echo
"done!"
.
PHP_EOL
;
...
@@ -759,18 +764,19 @@ class Media {
...
@@ -759,18 +764,19 @@ class Media {
echo
"done"
.
PHP_EOL
;
echo
"done"
.
PHP_EOL
;
}
}
else
if
(
$key
==
"Schauspieler"
){
else
if
(
$key
==
"Schauspieler"
){
$Schauspielers
=
explode
(
" / "
,
$value
);
//$Schauspielers = explode(" / ", $value);
echo
" Schauspieler anlegen... "
;
echo
" Schauspieler anlegen... "
;
foreach
(
$
Schauspielers
as
$Key
=>
$value3
)
{
foreach
(
$
value
as
$Key
=>
$value3
)
{
//$Schauspieler = explode(">", str_replace("nm", "", $value3));
//$Schauspieler = explode(">", str_replace("nm", "", $value3));
$Querys
[]
=
"INSERT INTO FilmSchauspieler (imdbID, schauspielerID, role)
$Querys
[]
=
"INSERT INTO FilmSchauspieler (imdbID, schauspielerID, role)
VALUES ('"
.
$DataArr
[
'imdbID'
]
.
"', '"
.
$this
->
getSchauspielerID
(
$mysqli
,
$value3
[
0
],
$Key
)
.
"', '"
.
$mysqli
->
real_escape_string
(
$value3
[
1
])
.
"');"
;
VALUES ('"
.
$DataArr
[
'imdbID'
]
.
"', '"
.
$this
->
getSchauspielerID
(
$mysqli
,
$value3
[
0
],
$Key
)
.
"', '"
.
$mysqli
->
real_escape_string
(
$value3
[
1
])
.
"');"
;
// TODO Rolle Ergänzen!!!!!
// TODO Rolle Ergänzen!!!!!
var_dump
(
$Querys
);
exit
;
}
}
echo
"done"
.
PHP_EOL
;
echo
"done"
.
PHP_EOL
;
}
}
}
else
{
}
else
{
...
@@ -780,7 +786,9 @@ class Media {
...
@@ -780,7 +786,9 @@ class Media {
}
}
echo
" Film eintragen... "
;
echo
" Film eintragen... "
;
$Query
=
"INSERT INTO Filme ("
.
implode
(
","
,
$keys
)
.
") VALUES ("
.
implode
(
","
,
$values
)
.
");"
;
$Query
=
"INSERT INTO Filme ("
.
implode
(
","
,
$keys
)
.
") VALUES ("
.
implode
(
","
,
$values
)
.
");"
;
//var_dump($Querys);
//echo $Query.PHP_EOL;
//exit;
$result
=
$mysqli
->
query
(
$Query
);
$result
=
$mysqli
->
query
(
$Query
);
file_put_contents
(
"./phpTestout/imdbID/"
.
$DataArr
[
'imdbID'
]
.
".txt"
,
$Query
.
PHP_EOL
,
FILE_APPEND
);
file_put_contents
(
"./phpTestout/imdbID/"
.
$DataArr
[
'imdbID'
]
.
".txt"
,
$Query
.
PHP_EOL
,
FILE_APPEND
);
if
(
$mysqli
->
error
!=
""
){
if
(
$mysqli
->
error
!=
""
){
...
@@ -836,10 +844,10 @@ class Media {
...
@@ -836,10 +844,10 @@ class Media {
}
}
else
{
else
{
$Query
=
"INSERT INTO Schauspieler (name, schauspielerID) VALUES('"
.
mysql_escape_string
((
$SchauspielerName
))
.
"', '"
.
$SchauspielerID
.
"');"
;
$Query
=
"INSERT INTO Schauspieler (name, schauspielerID) VALUES('"
.
mysql_escape_string
((
$SchauspielerName
))
.
"', '"
.
$SchauspielerID
.
"');"
;
echo
PHP_EOL
.
$this
->
Console
->
getColoredString
(
"Query"
,
"light_gray"
,
"green"
)
.
" "
.
$Query
.
PHP_EOL
;
//
echo PHP_EOL.$this->Console->getColoredString("Query", "light_gray", "green")." ".$Query.PHP_EOL;
//echo $SchauspielerName.", ";
//echo $SchauspielerName.", ";
//
$mysqli->query($Query);
$mysqli
->
query
(
$Query
);
exit
;
//
exit;
return
$SchauspielerID
;
return
$SchauspielerID
;
}
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment