Ticket #6421: tmdb.pl.patch

File tmdb.pl.patch, 725 bytes (added by Michelle Agnew <mythtrac@…>, 17 years ago)

Fix array detection after the data structure is parsed from the XML

  • mythvideo/mythvideo/scripts/tmdb.pl

     
    265265    if ($xml->{"opensearch:totalResults"} > 0) {
    266266        # now get the movie data via Movie.getInfo, Movie.imdbLookup does not
    267267        # provide us all the data
    268         my $tmdbid = $xml->{moviematches}->{movie}->{id};
     268        my $tmdbid = ref $xml->{moviematches}->{movie} eq 'ARRAY'
     269          ? $xml->{moviematches}{movie}[0]{id}
     270          : $xml->{moviematches}{movie}{id};
    269271
    270272        my ($rc, $response) =
    271273            TMDBAPIRequest('Movie.getInfo', {'id' => $tmdbid});