Commit 41300646 authored by Nico Schallehn's avatar Nico Schallehn

test

parent f6fe7348
......@@ -120,11 +120,6 @@ class Media {
$Counter=0;
//var_dump($FilmeArr);
foreach ($FilmeArr as $value) {
//echo " ".$this->PfadzumEinlesen.'/'.(strlen($value[0])>0?$value[0].'/':'').$value[1].PHP_EOL;
//echo (strlen($value[0])>0?$value[0].'/':''), $value[1].PHP_EOL;
//$ParseFile = ">>>>>>".(($action == "einlesen")?$this->PfadzumEinlesen."/":$this->PfadzumAusgeben."Filme/").(strlen($value[0])>0?$value[0].'/':'').$value[1];
//echo $ParseFile;
$array = $this->parseMovie((($action == "einlesen")?$this->PfadzumEinlesen."/":$this->PfadzumAusgeben."Filme/").(strlen($value[0])>0?$value[0].'/':''), $value[1]);
if(($array == false)){
echo $this->Console->getColoredString(" ","black", "red").PHP_EOL;
......@@ -132,9 +127,9 @@ class Media {
echo $fehler;
$fehlerArr[] = $fehler;
echo $this->Console->getColoredString(" ","black", "red").PHP_EOL;
}/*else if((file_exists("./phpTestout/".$array['imdbID'].".txt"))){
}else if((file_exists("./phpTestout/".$array['imdbID'].".txt"))){
echo $this->Console->getColoredString("Info!","black", "red")."Film wurde bereits verarbeitet!! Bitte Outputfile in 'phpTestout' löschen!".PHP_EOL;
}*/else{
}else{
$Pfad = (($action == "einlesen")?$this->PfadzumEinlesen."/":$this->PfadzumAusgeben."Filme/").(strlen($value[0])>0?$value[0].'/':'');
$PfadOrg = (strlen($value[0])>0?$value[0].'/':'');
......@@ -142,13 +137,11 @@ class Media {
$Endung = trim(substr($FilenameOrg,strripos( $FilenameOrg,".")+1));
//Was soll mit den geparsten Film gemacht werden?
if($action == "einlesen"){
//$File = (($action == "einlesen")?$this->PfadzumEinlesen."/":$this->PfadzumAusgeben."Filme/").(strlen($value[0])>0?$value[0].'/':'').$value[1];
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)){
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."'");
}
......@@ -159,24 +152,19 @@ class Media {
$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;
echo "done!".PHP_EOL;
}
//TODO nfo file generieren
shell_exec("mv './phpTestout/".$array["imdbID"].".txt' './phpTestout/OK_".$array["imdbID"].".txt'");
//return true;
}
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);
}
}else if($action == "update"){
if( $this->updateMovie($array, $Pfad.$FilenameOrg, false, false)){ //TODO auf true für md5!!!
echo "Film wurde Aktualisiert".PHP_EOL;
}else {
echo "Film wurde nicht Aktualisiert".PHP_EOL;
}
//NFO
$this->GenerateNFO($array, $Pfad.$FilenameOrg); //TODO auf true für md5!!!
......
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