Commit b97bdf81 authored by Nico Schallehn's avatar Nico Schallehn

test

parent 7c081c1e
...@@ -354,49 +354,51 @@ class Media { ...@@ -354,49 +354,51 @@ class Media {
$xml = simplexml_load_string($xmlstring); $xml = simplexml_load_string($xmlstring);
$json = json_encode($xml,JSON_PRETTY_PRINT); $json = json_encode($xml,JSON_PRETTY_PRINT);
$array2 = json_decode($json,TRUE); $array2 = json_decode($json,TRUE);
foreach ($array2["File"]["track"] as $key => $value) { if(isset($array2["File"]["track"])){
//echo " ".$key." ".$value["@attributes"]["type"].PHP_EOL; foreach ($array2["File"]["track"] as $key => $value) {
switch ($value["@attributes"]["type"]) { //echo " ".$key." ".$value["@attributes"]["type"].PHP_EOL;
case "General": switch ($value["@attributes"]["type"]) {
$array["vcodec"] = str_replace("Matroska", "mkv", $value["Format"]); case "General":
$array["duration"] = $this->getRunTime($value["Duration"]); $array["vcodec"] = str_replace("Matroska", "mkv", $value["Format"]);
$array["totalbitrate"] = round(trim(str_replace(" ", "",str_replace("Mbps", "", $value["Overall_bit_rate"])))*1024,0); $array["duration"] = $this->getRunTime($value["Duration"]);
break; $array["totalbitrate"] = round(trim(str_replace(" ", "",str_replace("Mbps", "", $value["Overall_bit_rate"])))*1024,0);
case "Video": break;
$array["width"] = trim(str_replace(" ", "",str_replace("pixels", "",$value["Width"]))); case "Video":
//TODO Resolution aus diesen werten neusetzen $array["width"] = trim(str_replace(" ", "",str_replace("pixels", "",$value["Width"])));
$array["height"] = trim(str_replace(" ", "",str_replace("pixels", "",$value["Height"]))); //TODO Resolution aus diesen werten neusetzen
break; $array["height"] = trim(str_replace(" ", "",str_replace("pixels", "",$value["Height"])));
case "Audio": break;
if(isset($value["Language"])){ case "Audio":
if(($value["Language"] == "Deutsch") OR ($value["Language"] == "German")){ if(isset($value["Language"])){
$array["acodecger"] = $value["Format"]; if(($value["Language"] == "Deutsch") OR ($value["Language"] == "German")){
$array["abitrateger"] = round(trim(str_replace(" ", "",str_replace("Kbps", "",$value["Bit_rate"]))),0); $array["acodecger"] = $value["Format"];
$array["channelsger"] = str_replace(" channels", "",$value["Channel_s_"]); $array["abitrateger"] = round(trim(str_replace(" ", "",str_replace("Kbps", "",$value["Bit_rate"]))),0);
if(!is_numeric($array["channelsger"])){ $array["channelsger"] = str_replace(" channels", "",$value["Channel_s_"]);
$array["channelsger"] = substr($array["channelsger"],strripos( $array["channelsger"],"/")+1);
if(!is_numeric($array["channelsger"])){ if(!is_numeric($array["channelsger"])){
echo $this->Console->error("channelsger ist nicht Numerisch!").PHP_EOL; $array["channelsger"] = substr($array["channelsger"],strripos( $array["channelsger"],"/")+1);
file_put_contents("./phpTestout/imdbID/".$array["imdbID"].".txt", "channelsger ist nicht Numerisch!".PHP_EOL, FILE_APPEND); if(!is_numeric($array["channelsger"])){
return false; echo $this->Console->error("channelsger ist nicht Numerisch!").PHP_EOL;
file_put_contents("./phpTestout/imdbID/".$array["imdbID"].".txt", "channelsger ist nicht Numerisch!".PHP_EOL, FILE_APPEND);
return false;
}
} }
} }
} else if(($value["Language"] == "Englisch") OR ($value["Language"] == "English")){
else if(($value["Language"] == "Englisch") OR ($value["Language"] == "English")){ $array["acodeceng"] = $value["Format"];
$array["acodeceng"] = $value["Format"]; $array["abitrateeng"] = round(trim(str_replace(" ", "",str_replace("Kbps", "",$value["Bit_rate"]))),0);
$array["abitrateeng"] = round(trim(str_replace(" ", "",str_replace("Kbps", "",$value["Bit_rate"]))),0); $array["channelseng"] = str_replace(" channels", "",$value["Channel_s_"]);
$array["channelseng"] = str_replace(" channels", "",$value["Channel_s_"]);
if(!is_numeric($array["channelseng"])){
$array["channelseng"] = substr($array["channelseng"],strripos( $array["channelseng"],"/")+1);
if(!is_numeric($array["channelseng"])){ if(!is_numeric($array["channelseng"])){
echo $this->Console->error("channelseng ist nicht Numerisch!").PHP_EOL; $array["channelseng"] = substr($array["channelseng"],strripos( $array["channelseng"],"/")+1);
file_put_contents("./phpTestout/imdbID/".$array["imdbID"].".txt", "channelseng ist nicht Numerisch!".PHP_EOL, FILE_APPEND); if(!is_numeric($array["channelseng"])){
return false; echo $this->Console->error("channelseng ist nicht Numerisch!").PHP_EOL;
file_put_contents("./phpTestout/imdbID/".$array["imdbID"].".txt", "channelseng ist nicht Numerisch!".PHP_EOL, FILE_APPEND);
return false;
}
} }
} }
} }
} break;
break; }
} }
} }
......
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