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
a386f55d
Commit
a386f55d
authored
Mar 09, 2016
by
Nico Schallehn
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Verzeichnis für Dateien geändert
parent
f642d423
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
17 deletions
+17
-17
media.class.php
media.class.php
+17
-17
No files found.
media.class.php
View file @
a386f55d
...
...
@@ -161,15 +161,15 @@ class Media {
$copy
=
'mv "'
.
$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
);
file_put_contents
(
"./phpTestout/
imdbID/
"
.
$array
[
'imdbID'
]
.
".txt"
,
$copy
.
PHP_EOL
,
FILE_APPEND
);
shell_exec
(
$copy
);
echo
"done!"
.
PHP_EOL
;
}
shell_exec
(
"mv './phpTestout/
"
.
$array
[
"imdbID"
]
.
".txt' './phpTestout
/OK_"
.
$array
[
"imdbID"
]
.
".txt'"
);
shell_exec
(
"mv './phpTestout/
imdbID/"
.
$array
[
"imdbID"
]
.
".txt' './phpTestout/imdbID
/OK_"
.
$array
[
"imdbID"
]
.
".txt'"
);
}
else
{
echo
$this
->
Console
->
error
(
"Fehler beim Eintragen in die DB!"
)
.
PHP_EOL
;
file_put_contents
(
"./phpTestout/"
.
$array
[
"imdbID"
]
.
".txt"
,
"Fehler beim Eintragen in die DB"
.
PHP_EOL
,
FILE_APPEND
);
file_put_contents
(
"./phpTestout/
imdbID/
"
.
$array
[
"imdbID"
]
.
".txt"
,
"Fehler beim Eintragen in die DB"
.
PHP_EOL
,
FILE_APPEND
);
}
}
else
if
(
$action
==
"check"
){
if
(
$this
->
updateMovie
(
$array
,
$Pfad
.
$FilenameOrg
,
false
,
true
)){
//TODO auf true für md5!!!
...
...
@@ -437,12 +437,12 @@ class Media {
unset
(
$array
[
"fsk"
]);
}
if
(
!
$this
->
gibTMDBdata
(
$array
[
"imdbID"
],
$array
)){
file_put_contents
(
"./phpTestout/"
.
$array
[
"imdbID"
]
.
".txt"
,
"Keine Infos auf TMDB gefunden: "
.
$Pfad
.
$FilenameOrg
.
PHP_EOL
,
FILE_APPEND
);
file_put_contents
(
"./phpTestout/
imdbID/
"
.
$array
[
"imdbID"
]
.
".txt"
,
"Keine Infos auf TMDB gefunden: "
.
$Pfad
.
$FilenameOrg
.
PHP_EOL
,
FILE_APPEND
);
return
false
;
//TODO Abbruch wenn keine Daten auf TMDB gefunden
}
}
else
{
echo
$this
->
Console
->
error
(
"imdbID ("
.
$array
[
"imdbID"
]
.
") nicht bei imdb gefunden!"
)
.
PHP_EOL
;
file_put_contents
(
"./phpTestout/"
.
$array
[
"imdbID"
]
.
".txt"
,
"Keine Infos auf imdbID gefunden: "
.
$Pfad
.
$FilenameOrg
.
PHP_EOL
,
FILE_APPEND
);
file_put_contents
(
"./phpTestout/
imdbID/
"
.
$array
[
"imdbID"
]
.
".txt"
,
"Keine Infos auf imdbID gefunden: "
.
$Pfad
.
$FilenameOrg
.
PHP_EOL
,
FILE_APPEND
);
return
false
;
}
}
...
...
@@ -481,7 +481,7 @@ class Media {
$array
[
"channelsger"
]
=
substr
(
$array
[
"channelsger"
],
strripos
(
$array
[
"channelsger"
],
"/"
)
+
1
);
if
(
!
is_numeric
(
$array
[
"channelsger"
])){
echo
$this
->
Console
->
error
(
"channelsger ist nicht Numerisch!"
)
.
PHP_EOL
;
file_put_contents
(
"./phpTestout/"
.
$array
[
"imdbID"
]
.
".txt"
,
"channelsger ist nicht Numerisch!"
.
PHP_EOL
,
FILE_APPEND
);
file_put_contents
(
"./phpTestout/
imdbID/
"
.
$array
[
"imdbID"
]
.
".txt"
,
"channelsger ist nicht Numerisch!"
.
PHP_EOL
,
FILE_APPEND
);
return
false
;
}
}
...
...
@@ -494,7 +494,7 @@ class Media {
$array
[
"channelseng"
]
=
substr
(
$array
[
"channelseng"
],
strripos
(
$array
[
"channelseng"
],
"/"
)
+
1
);
if
(
!
is_numeric
(
$array
[
"channelseng"
])){
echo
$this
->
Console
->
error
(
"channelseng ist nicht Numerisch!"
)
.
PHP_EOL
;
file_put_contents
(
"./phpTestout/"
.
$array
[
"imdbID"
]
.
".txt"
,
"channelseng ist nicht Numerisch!"
.
PHP_EOL
,
FILE_APPEND
);
file_put_contents
(
"./phpTestout/
imdbID/
"
.
$array
[
"imdbID"
]
.
".txt"
,
"channelseng ist nicht Numerisch!"
.
PHP_EOL
,
FILE_APPEND
);
return
false
;
}
}
...
...
@@ -626,7 +626,7 @@ class Media {
//var_dump($DataArr);
echo
" Berechne 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
);
file_put_contents
(
"./phpTestout/
imdbID/
"
.
$DataArr
[
'imdbID'
]
.
".txt"
,
"md5 = "
.
$DataArr
[
"md5"
]
.
PHP_EOL
,
FILE_APPEND
);
$DataArr
[
"lastUpdate"
]
=
date
(
"Y-m-d"
);
echo
" done!"
.
PHP_EOL
;
}
...
...
@@ -690,13 +690,13 @@ class Media {
echo
$Ausgabe
;
//echo $SQL.PHP_EOL;
$mysqli
->
query
(
$SQL
);
file_put_contents
(
"./phpTestout/"
.
$DataArr
[
'imdbID'
]
.
".txt"
,
$SQL
.
PHP_EOL
,
FILE_APPEND
);
file_put_contents
(
"./phpTestout/
imdbID/
"
.
$DataArr
[
'imdbID'
]
.
".txt"
,
$SQL
.
PHP_EOL
,
FILE_APPEND
);
file_put_contents
(
"./phpTestout/update.txt"
,
$SQL
.
PHP_EOL
,
FILE_APPEND
);
}
else
{
$Ausgabe
=
"Unterschiede (bei "
.
$Film
[
"imdbID"
]
.
") :"
.
PHP_EOL
.
$changed
.
PHP_EOL
;
echo
$Ausgabe
;
file_put_contents
(
"./phpTestout/"
.
$DataArr
[
'imdbID'
]
.
".txt"
,
$Ausgabe
.
PHP_EOL
.
$SQL
.
PHP_EOL
,
FILE_APPEND
);
file_put_contents
(
"./phpTestout/
imdbID/
"
.
$DataArr
[
'imdbID'
]
.
".txt"
,
$Ausgabe
.
PHP_EOL
.
$SQL
.
PHP_EOL
,
FILE_APPEND
);
file_put_contents
(
"./phpTestout/update_CheckOnly.txt"
,
$Ausgabe
.
" "
.
$SQL
.
PHP_EOL
.
PHP_EOL
,
FILE_APPEND
);
file_put_contents
(
"./phpTestout/update.sql"
,
$SQL
.
PHP_EOL
,
FILE_APPEND
);
}
...
...
@@ -708,7 +708,7 @@ class Media {
}
else
{
file_put_contents
(
"./phpTestout/update_CheckOnly.txt"
,
"Alles OK bei Film "
.
$Film
[
"name"
]
.
"("
.
$Film
[
"imdbID"
]
.
")!"
.
PHP_EOL
,
FILE_APPEND
);
}
file_put_contents
(
"./phpTestout/"
.
$DataArr
[
'imdbID'
]
.
".txt"
,
"Alles OK bei Film "
.
$Film
[
"name"
]
.
"("
.
$Film
[
"imdbID"
]
.
")!"
.
PHP_EOL
,
FILE_APPEND
);
file_put_contents
(
"./phpTestout/
imdbID/
"
.
$DataArr
[
'imdbID'
]
.
".txt"
,
"Alles OK bei Film "
.
$Film
[
"name"
]
.
"("
.
$Film
[
"imdbID"
]
.
")!"
.
PHP_EOL
,
FILE_APPEND
);
return
false
;
}
...
...
@@ -731,14 +731,14 @@ class Media {
if
(
$mysqli
->
error
!=
""
){
echo
"Mysql-Fehler: "
.
$mysqli
->
error
.
PHP_EOL
;
return
false
;}
if
(
$result
->
num_rows
>
0
){
echo
" Film bereits in DB!"
.
PHP_EOL
;
file_put_contents
(
"./phpTestout/"
.
$DataArr
[
'imdbID'
]
.
".txt"
,
"Film bereits in DB!"
.
PHP_EOL
,
FILE_APPEND
);
file_put_contents
(
"./phpTestout/
imdbID/
"
.
$DataArr
[
'imdbID'
]
.
".txt"
,
"Film bereits in DB!"
.
PHP_EOL
,
FILE_APPEND
);
return
false
;
}
// Jetzt noch MD5 berechnen
if
(
$md5
){
echo
" Berechne 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
);
file_put_contents
(
"./phpTestout/
imdbID/
"
.
$DataArr
[
'imdbID'
]
.
".txt"
,
"md5 = "
.
$DataArr
[
"md5"
]
.
PHP_EOL
,
FILE_APPEND
);
$DataArr
[
"lastUpdate"
]
=
date
(
"Y-m-d"
);
echo
" done!"
.
PHP_EOL
;
}
...
...
@@ -782,10 +782,10 @@ class Media {
$Query
=
"INSERT INTO Filme ("
.
implode
(
","
,
$keys
)
.
") VALUES ("
.
implode
(
","
,
$values
)
.
");"
;
$result
=
$mysqli
->
query
(
$Query
);
file_put_contents
(
"./phpTestout/"
.
$DataArr
[
'imdbID'
]
.
".txt"
,
$Query
.
PHP_EOL
,
FILE_APPEND
);
file_put_contents
(
"./phpTestout/
imdbID/
"
.
$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
);
file_put_contents
(
"./phpTestout/
imdbID/
"
.
$DataArr
[
'imdbID'
]
.
".txt"
,
"Mysql-Fehler: "
.
$mysqli
->
error
.
PHP_EOL
,
FILE_APPEND
);
return
false
;
}
echo
"done"
.
PHP_EOL
;
...
...
@@ -796,10 +796,10 @@ class Media {
//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
);
file_put_contents
(
"./phpTestout/
imdbID/
"
.
$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
);
file_put_contents
(
"./phpTestout/
imdbID/
"
.
$DataArr
[
'imdbID'
]
.
".txt"
,
"Mysql-Fehler: "
.
$mysqli
->
error
.
PHP_EOL
,
FILE_APPEND
);
return
false
;
}
...
...
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