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
a2e3f535
Commit
a2e3f535
authored
Jan 29, 2016
by
Nico Schallehn
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
final filme einlesen
parent
72101b17
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
2 deletions
+20
-2
media.class.php
media.class.php
+20
-2
No files found.
media.class.php
View file @
a2e3f535
...
...
@@ -259,6 +259,7 @@ class Media {
echo
"Datei liegt schon am ausgabe Ort!"
.
PHP_EOL
;
}
else
{
if
(
!
is_dir
(
$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"
])
.
$PfadOrg
.
"'"
);
}
...
...
@@ -268,6 +269,7 @@ class Media {
$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
.
'"'
;
file_put_contents
(
"./phpTestout/"
.
$array
[
'imdbID'
]
.
".txt"
,
$copy
.
PHP_EOL
,
FILE_APPEND
);
shell_exec
(
$copy
);
echo
$copy
.
"done!"
.
PHP_EOL
;
}
shell_exec
(
"mv './phpTestout/"
.
$array
[
"imdbID"
]
.
".txt' './phpTestout/OK_"
.
$array
[
"imdbID"
]
.
".txt'"
);
...
...
@@ -300,8 +302,8 @@ class Media {
}
// Jetzt noch MD5 berechnen
echo
"Berechne MD5... "
;
$DataArr
[
"md5"
]
=
substr
(
shell_exec
(
'md5sum -b "/tmp/'
.
$DataArr
[
'imdbID'
]
.
'.xml"'
),
0
,
32
);
//TODO Einkommentieren für md5
//
$DataArr["md5"] = substr(shell_exec('md5sum -b "'.$File.'"'),0,32);
//
$DataArr["md5"] = substr(shell_exec('md5sum -b "/tmp/'.$DataArr['imdbID'].'.xml"'),0,32); //TODO Einkommentieren für md5
$DataArr
[
"md5"
]
=
substr
(
shell_exec
(
'md5sum -b "'
.
$File
.
'"'
),
0
,
32
);
file_put_contents
(
"./phpTestout/"
.
$DataArr
[
'imdbID'
]
.
".txt"
,
"md5 = "
.
$DataArr
[
"md5"
]
.
PHP_EOL
,
FILE_APPEND
);
//$array["md5"] = substr(shell_exec('md5sum -b "'."/tmp/".$DataArr["imdbID"].".xml".'"'),0,32);
echo
" done!"
.
PHP_EOL
;
...
...
@@ -338,12 +340,28 @@ class Media {
}
$Query
=
"INSERT INTO Filme ("
.
implode
(
","
,
$keys
)
.
") VALUES ("
.
implode
(
","
,
$values
)
.
");"
;
//TODO Query ausführen!!
$result
=
$mysqli
->
query
(
$Query
);
file_put_contents
(
"./phpTestout/"
.
$DataArr
[
'imdbID'
]
.
".txt"
,
$Query
.
PHP_EOL
,
FILE_APPEND
);
if
(
$mysqli
->
error
!=
""
){
echo
"Mysql-Fehler: "
.
$mysqli
->
error
.
PHP_EOL
;
file_put_contents
(
"./phpTestout/"
.
$DataArr
[
'imdbID'
]
.
".txt"
,
"Mysql-Fehler: "
.
$mysqli
->
error
.
PHP_EOL
,
FILE_APPEND
);
return
false
;
}
echo
$this
->
Console
->
getColoredString
(
"Query"
,
"light_gray"
,
"green"
)
.
" "
.
$Query
.
PHP_EOL
;
echo
"Lege Schauspieler und Genre Verküpfungen an..."
;
foreach
(
$Querys
as
$Query
)
{
//echo $this->Console->getColoredString("Query", "light_gray", "green")." ".$Query.PHP_EOL;
$result
=
$mysqli
->
query
(
$Query
);
file_put_contents
(
"./phpTestout/"
.
$DataArr
[
'imdbID'
]
.
".txt"
,
$Query
.
PHP_EOL
,
FILE_APPEND
);
if
(
$mysqli
->
error
!=
""
){
echo
"Mysql-Fehler: "
.
$mysqli
->
error
.
PHP_EOL
;
file_put_contents
(
"./phpTestout/"
.
$DataArr
[
'imdbID'
]
.
".txt"
,
"Mysql-Fehler: "
.
$mysqli
->
error
.
PHP_EOL
,
FILE_APPEND
);
return
false
;
}
//TODO Query ausführen!!
}
echo
"done!"
.
PHP_EOL
;
...
...
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