Commit d3f70c29 authored by Nico Schallehn's avatar Nico Schallehn

Ausgabe nach Collection Ordner!!

parent 17916495
......@@ -148,19 +148,24 @@ class Media {
$Endung = trim(substr($FilenameOrg,strripos( $FilenameOrg,".")+1));
//Was soll mit den geparsten Film gemacht werden?
if($action == "einlesen"){
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."'");
if(!is_dir($this->PfadzumAusgeben.($array["3d"]==""?$this->config["HDD"][$this->HDDID]["Filme"]:$this->config["HDD"][$this->HDDID]["3D"]).$array["collection"].'/')){
shell_exec("mkdir '".$this->PfadzumAusgeben.($array["3d"]==""?$this->config["HDD"][$this->HDDID]["Filme"]:$this->config["HDD"][$this->HDDID]["3D"]).$array["collection"].'/'."'");
}
if(isset($array["collection"])){
echo "Collection Ausgabe in eigenen Collection Ordner: ".$array["collection"].PHP_EOL;
//exit;
}
echo "Verschiebe Datei...";
$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.'"';
$this->PfadzumAusgeben.($array["3d"]==""?$this->config["HDD"][$this->HDDID]["Filme"]:$this->config["HDD"][$this->HDDID]["3D"]).$array["collection"].'/'.$array["name"]." (".$array["resolution"].")".($array["3d"] != ""?" (3D)":"")." (".$array["imdbID"].").".$Endung.'"';
file_put_contents("./phpTestout/imdbID/".$array['imdbID'].".txt", $copy.PHP_EOL, FILE_APPEND);
shell_exec($copy);
echo "done!".PHP_EOL;
......@@ -759,18 +764,19 @@ class Media {
echo "done".PHP_EOL;
}
else if ($key == "Schauspieler"){
$Schauspielers = explode(" / ", $value);
//$Schauspielers = explode(" / ", $value);
echo " Schauspieler anlegen... ";
foreach ($Schauspielers as $Key => $value3) {
foreach ($value as $Key => $value3) {
//$Schauspieler = explode(">", str_replace("nm", "", $value3));
$Querys[] = "INSERT INTO FilmSchauspieler (imdbID, schauspielerID, role)
VALUES ('".$DataArr['imdbID']."', '".$this->getSchauspielerID($mysqli, $value3[0],$Key)."', '".$mysqli->real_escape_string($value3[1])."');";
// TODO Rolle Ergänzen!!!!!
var_dump($Querys);
exit;
}
echo "done".PHP_EOL;
}
}else{
......@@ -780,7 +786,9 @@ class Media {
}
echo " Film eintragen... ";
$Query = "INSERT INTO Filme (".implode(",", $keys).") VALUES (".implode(",", $values).");";
//var_dump($Querys);
//echo $Query.PHP_EOL;
//exit;
$result = $mysqli->query($Query);
file_put_contents("./phpTestout/imdbID/".$DataArr['imdbID'].".txt", $Query.PHP_EOL, FILE_APPEND);
if($mysqli->error != ""){
......@@ -836,10 +844,10 @@ class Media {
}
else{
$Query = "INSERT INTO Schauspieler (name, schauspielerID) VALUES('".mysql_escape_string(($SchauspielerName))."', '".$SchauspielerID."');";
echo PHP_EOL.$this->Console->getColoredString("Query", "light_gray", "green")." ".$Query.PHP_EOL;
//echo PHP_EOL.$this->Console->getColoredString("Query", "light_gray", "green")." ".$Query.PHP_EOL;
//echo $SchauspielerName.", ";
//$mysqli->query($Query);
exit;
$mysqli->query($Query);
//exit;
return $SchauspielerID;
}
}
......
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