Commit d14dcf55 authored by Nico Schallehn's avatar Nico Schallehn

test

parent e3d779ce
...@@ -83,7 +83,7 @@ class Media { ...@@ -83,7 +83,7 @@ class Media {
} }
public function filme($action = "einlesen"){ public function filme($action = "einlesen"){
$start = time(); $start = time();
if($action == "einlesen"){ //if($action == "einlesen"){
//var_dump($this->config); //var_dump($this->config);
echo $this->Console->getColoredString("Filme > ".$action, "black", "light_gray") .PHP_EOL; echo $this->Console->getColoredString("Filme > ".$action, "black", "light_gray") .PHP_EOL;
...@@ -135,7 +135,8 @@ class Media { ...@@ -135,7 +135,8 @@ class Media {
$PfadOrg = (strlen($value[0])>0?$value[0].'/':''); $PfadOrg = (strlen($value[0])>0?$value[0].'/':'');
$FilenameOrg = $value[1]; $FilenameOrg = $value[1];
$Endung = trim(substr($FilenameOrg,strripos( $FilenameOrg,".")+1)); $Endung = trim(substr($FilenameOrg,strripos( $FilenameOrg,".")+1));
//Was soll mit den geparsten Film gemacht werden?
if($action == "einlesen"){
if( $this->addMovie($array, (strlen($value[0])>0?$value[0].'/':'').$value[1], false)){ //TODO auf true für md5!!! if( $this->addMovie($array, (strlen($value[0])>0?$value[0].'/':'').$value[1], false)){ //TODO auf true für md5!!!
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;
...@@ -157,12 +158,16 @@ class Media { ...@@ -157,12 +158,16 @@ class Media {
//TODO nfo file generieren //TODO nfo file generieren
shell_exec("mv './phpTestout/".$array["imdbID"].".txt' './phpTestout/OK_".$array["imdbID"].".txt'"); shell_exec("mv './phpTestout/".$array["imdbID"].".txt' './phpTestout/OK_".$array["imdbID"].".txt'");
//return true; //return true;
} }
else{ else{
echo $this->Console->error("Fehler beim Eintragen in die DB!").PHP_EOL; 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/".$array["imdbID"].".txt", "Fehler beim Eintragen in die DB".PHP_EOL, FILE_APPEND);
//return false; //return false;
} }
}else if($action == "update"){
}
//TODO Baustelle Ende //TODO Baustelle Ende
} }
$end = time(); $end = time();
...@@ -199,7 +204,8 @@ class Media { ...@@ -199,7 +204,8 @@ class Media {
//trim(fgets(STDIN)); //trim(fgets(STDIN));
echo PHP_EOL; echo PHP_EOL;
//return ; //return ;
} //}
/*
else if($action == "update"){ else if($action == "update"){
echo $this->Console->getColoredString("Filme > update", "black", "light_gray") .PHP_EOL; echo $this->Console->getColoredString("Filme > update", "black", "light_gray") .PHP_EOL;
...@@ -272,7 +278,7 @@ class Media { ...@@ -272,7 +278,7 @@ class Media {
" Geändert: ".$counterChange.PHP_EOL.PHP_EOL; " Geändert: ".$counterChange.PHP_EOL.PHP_EOL;
echo $status; echo $status;
file_put_contents("./phpTestout/update.txt", $status.PHP_EOL, FILE_APPEND); file_put_contents("./phpTestout/update.txt", $status.PHP_EOL, FILE_APPEND);
} }*/
} }
/** /**
* @param imdbID * @param imdbID
......
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