Ticket #6428: mythplugins-6428-mythvideo-tmdb-check_response.patch
File mythplugins-6428-mythvideo-tmdb-check_response.patch, 2.6 KB (added by , 15 years ago) |
---|
-
mythvideo/mythvideo/scripts/tmdb.pl
119 119 my ($rc, $response) = 120 120 TMDBAPIRequest('Movie.imdbLookup', {'imdb_id' => "tt$movieid"}); 121 121 122 if (!$response) { 123 die "Unable to contact themoviedb.org while retrieving ". 124 "movie data, stopped"; 125 } 126 122 127 my $xs = new XML::Simple(SuppressEmpty => '', ForceArray => ['movie'], 123 128 KeyAttr => []); 124 129 my $xml = $xs->XMLin($response); … … 130 135 my ($rc, $response) = 131 136 TMDBAPIRequest('Movie.getInfo', {'id' => $tmdbid}); 132 137 138 if (!$response) { 139 die "Unable to contact themoviedb.org while retrieving ". 140 "movie data, stopped"; 141 } 142 133 143 $xml = $xs->XMLin($response, 134 144 ForceArray => ['category', 'production_countries'], 135 145 KeyAttr => ['key', 'id']); … … 235 245 my ($rc, $response) = 236 246 TMDBAPIRequest('Movie.imdbLookup', {'imdb_id' => "tt$movieid"}); 237 247 248 if (!$response) { 249 die "Unable to contact themoviedb.org while retrieving ". 250 "movie poster, stopped"; 251 } 252 238 253 my $xml = XMLin($response, ForceArray => ['movie', 'poster', 'backdrop'], 239 254 KeyAttr => {poster => 'size'}); 240 255 … … 258 273 my ($rc, $response) = 259 274 TMDBAPIRequest('Movie.imdbLookup', {'imdb_id' => "tt$movieid"}); 260 275 276 if (!$response) { 277 die "Unable to contact themoviedb.org while retrieving ". 278 "movie backdrop, stopped"; 279 } 280 261 281 my $xs = new XML::Simple(SuppressEmpty => '', ForceArray => [], 262 282 KeyAttr => []); 263 283 my $xml = $xs->XMLin($response); … … 270 290 my ($rc, $response) = 271 291 TMDBAPIRequest('Movie.getInfo', {'id' => $tmdbid}); 272 292 293 if (!$response) { 294 die "Unable to contact themoviedb.org while retrieving ". 295 "movie backdrop, stopped"; 296 } 297 273 298 $xml = XMLin($response, ForceArray=> [], KeyAttr => ['key', 'id']); 274 299 275 300 foreach my $backdrop (@{$xml->{moviematches}->{movie}->{backdrop}}) { … … 299 324 my ($rc, $response) = 300 325 TMDBAPIRequest('Movie.search', {'title' => $query}); 301 326 327 if (!$response) { 328 die "Unable to contact themoviedb.org while retrieving ". 329 "movie list, stopped"; 330 } 331 302 332 my $xs = new XML::Simple(SuppressEmpty => '', ForceArray => ['movie'], 303 333 KeyAttr => []); 304 334 my $xml = $xs->XMLin($response);