Commit 9d5b7949 authored by Nico Schallehn's avatar Nico Schallehn

test

parent 41300646
...@@ -416,7 +416,7 @@ class Media { ...@@ -416,7 +416,7 @@ class Media {
if(!(strripos( $Filename,"(") == false)){ if(!(strripos( $Filename,"(") == false)){
$array["imdbID"] = substr($Filename,strripos( $Filename,"(")+1,7); $array["imdbID"] = substr($Filename,strripos( $Filename,"(")+1,7);
} }
//echo strlen($array["imdbID"])." ".$array["imdbID"].PHP_EOL; //
if(!isset($array["imdbID"])){ //strlen($array["imdbID"])<=2 if(!isset($array["imdbID"])){ //strlen($array["imdbID"])<=2
file_put_contents("./phpTestout/default.txt", "Keine imdbID in Dateinamen: ".$Pfad.$Filename." gefunden!".PHP_EOL, FILE_APPEND); file_put_contents("./phpTestout/default.txt", "Keine imdbID in Dateinamen: ".$Pfad.$Filename." gefunden!".PHP_EOL, FILE_APPEND);
return false; return false;
...@@ -546,7 +546,9 @@ class Media { ...@@ -546,7 +546,9 @@ class Media {
} }
} }
private function GenerateNFO($DataArr, $File){ private function GenerateNFO($DataArr, $File){
echo $File."".PHP_EOL; $nfoFile = substr($File,0,strripos($File,"."));
echo $nfoFile."".PHP_EOL;
} }
private function updateMovie($DataArr, $File, $md5 = true, $CheckOnly=true){ private function updateMovie($DataArr, $File, $md5 = true, $CheckOnly=true){
...@@ -804,6 +806,7 @@ class Media { ...@@ -804,6 +806,7 @@ class Media {
if(strpos($url, "imdb-share")>3){ if(strpos($url, "imdb-share")>3){
//TODO 3. Quelle für cover einbauen //TODO 3. Quelle für cover einbauen
echo " fail (Kein Cover gefunden)!".PHP_EOL; echo " fail (Kein Cover gefunden)!".PHP_EOL;
file_put_contents("./phpTestout/cover.txt", "Kein Cover für ".$Film["imdbID"].PHP_EOL, FILE_APPEND);
$counterNotFound++; $counterNotFound++;
}else{ }else{
shell_exec("wget ".$url." -O ".$this->config["CoverDir"]."Filme/full/".$Film["imdbID"].".jpg"." > /dev/null 2>&1"); shell_exec("wget ".$url." -O ".$this->config["CoverDir"]."Filme/full/".$Film["imdbID"].".jpg"." > /dev/null 2>&1");
...@@ -835,6 +838,7 @@ class Media { ...@@ -835,6 +838,7 @@ class Media {
echo "done!".PHP_EOL; echo "done!".PHP_EOL;
}else{ }else{
echo "fail (Kein Hintergrundbild gefunden)!".PHP_EOL; echo "fail (Kein Hintergrundbild gefunden)!".PHP_EOL;
file_put_contents("./phpTestout/cover.txt", "Kein Hintergrundbild für ".$Film["imdbID"].PHP_EOL, FILE_APPEND);
$counterNotFound++; $counterNotFound++;
} }
}else{ }else{
...@@ -893,13 +897,8 @@ class Media { ...@@ -893,13 +897,8 @@ class Media {
echo "fail".PHP_EOL; echo "fail".PHP_EOL;
$counterNotFound++; $counterNotFound++;
} }
}else{ echo " Cover für season_nr: ".$Film2["season_nr"]." existiert bereits!".PHP_EOL;} }else{ echo " Cover für season_nr: ".$Film2["season_nr"]." existiert bereits!".PHP_EOL;}
} }
} }
echo $this->Console->getColoredString("Coverdownload > Upload auf FTP Server", "black", "light_gray") .PHP_EOL; echo $this->Console->getColoredString("Coverdownload > Upload auf FTP Server", "black", "light_gray") .PHP_EOL;
$SFTP_SERVER="192.168.0.32"; $SFTP_SERVER="192.168.0.32";
...@@ -908,7 +907,6 @@ class Media { ...@@ -908,7 +907,6 @@ class Media {
shell_exec("lftp sftp://$SFTP_USER:$SFTP_PWD@$SFTP_SERVER -e 'mirror --reverse ~/MediaDBPythonScripte/cover /var/www/mediadb.ivaya.de/MediaDBViewerAPI/cover; bye'"); shell_exec("lftp sftp://$SFTP_USER:$SFTP_PWD@$SFTP_SERVER -e 'mirror --reverse ~/MediaDBPythonScripte/cover /var/www/mediadb.ivaya.de/MediaDBViewerAPI/cover; bye'");
echo "Done!".PHP_EOL; echo "Done!".PHP_EOL;
$end = time(); $end = time();
$laufzeit = $end - $start; $laufzeit = $end - $start;
$H = floor($laufzeit / 3600); $H = floor($laufzeit / 3600);
...@@ -919,6 +917,5 @@ class Media { ...@@ -919,6 +917,5 @@ class Media {
" Nicht gefunden: ".$counterNotFound.PHP_EOL; " Nicht gefunden: ".$counterNotFound.PHP_EOL;
echo $status; echo $status;
file_put_contents("./phpTestout/cover.txt", $status.PHP_EOL, FILE_APPEND); file_put_contents("./phpTestout/cover.txt", $status.PHP_EOL, FILE_APPEND);
} }
} }
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment