Commit 805cf24d authored by Nico Schallehn's avatar Nico Schallehn

test

parent da44637d
......@@ -249,6 +249,7 @@ class Media {
echo " Hole Daten von themoviedb.org... ";
//TODO COVERDOWNLOAD und FANART für themovieDB
$tmdb = $this->jsonCacheDecoder("https://api.themoviedb.org/3/find/tt".$imdbID."?external_source=imdb_id&api_key=".$this->config["ApiKeys"]['Tmdb_Key']."&language=de");
if(!($tmdb == false)){
if(isset($tmdb["movie_results"])){
if(isset($tmdb["movie_results"][0]["overview"])){
echo " done!".PHP_EOL;
......@@ -260,6 +261,7 @@ class Media {
$tmdbURL="https://api.themoviedb.org/3/movie/".$tmdb["movie_results"][0]["id"]."?api_key=".$this->config["ApiKeys"]['Tmdb_Key']."&language=de&append_to_response=trailers";
//echo $tmdbURL;
$tmdbData1 = $this->jsonCacheDecoder($tmdbURL);
if(!($tmdbData == false)){
if(isset($tmdbData1["title"])){ $DataArray["titelDeutsch"] = $tmdbData1["title"]; }
if(isset($tmdbData1["original_title"])){ $DataArray["titelOriginal"] = $tmdbData1["original_title"];}
if(isset($tmdbData1["tagline"])){ $DataArray["tagline"] = $tmdbData1["tagline"];}
......@@ -274,7 +276,7 @@ class Media {
}
}else{
$tmdbURL2="https://api.themoviedb.org/3/movie/".$tmdb["movie_results"][0]["id"]."?api_key=".$this->config["ApiKeys"]['Tmdb_Key']."&language=en&append_to_response=trailers";
$tmdbURL2="https://api.themoviedb.org/3/moreturn true;return true;vie/".$tmdb["movie_results"][0]["id"]."?api_key=".$this->config["ApiKeys"]['Tmdb_Key']."&language=en&append_to_response=trailers";
$tmdbData2 = $this->jsonCacheDecoder($tmdbURL2);
if(isset($tmdbData2["trailers"]["youtube"][0]["source"])){
$youtubeEN = str_replace("&hd=1", "", $tmdbData2["trailers"]["youtube"][0]["source"]);
......@@ -289,10 +291,15 @@ class Media {
}
}
return true;
}else{return false;}
}else{
echo " fail1!".PHP_EOL;
return false;
}
}else{
return false;
}
}
/**
......@@ -878,7 +885,12 @@ class Media {
}
$filename= md5($url).".json"; //TODO Cachetime Ändern
if(!file_exists($CacheFolderName.$filename)){
$Data = file_get_contents($url);
if(strlen($Data)>0){
file_put_contents($CacheFolderName.$filename, file_get_contents($url));
}else{
return false;
}
}
return json_decode(file_get_contents($CacheFolderName.$filename), true);
}
......
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