Index: mythvideo/mythvideo/scripts/tmdb.pl
===================================================================
--- mythvideo/mythvideo/scripts/tmdb.pl	(revision 20301)
+++ mythvideo/mythvideo/scripts/tmdb.pl	(working copy)
@@ -179,7 +179,9 @@
         my $cc = 0;
         my $wc = 0;
         if (exists $xml->{moviematches}->{movie}->{people}) {
-            my @castlist = @{$xml->{moviematches}->{movie}->{people}->{person}};
+            my @castlist = ref $xml->{moviematches}->{movie}->{people}->{person} eq 'ARRAY'
+              ? @{$xml->{moviematches}->{movie}->{people}->{person}}
+              : $xml->{moviematches}->{movie}->{people}->{person};
             for (my $i = 0; $i < @castlist; $i++)
             {
                 if ($castlist[$i]->{job} eq "actor")
@@ -265,7 +267,9 @@
     if ($xml->{"opensearch:totalResults"} > 0) {
         # now get the movie data via Movie.getInfo, Movie.imdbLookup does not
         # provide us all the data
-        my $tmdbid = $xml->{moviematches}->{movie}->{id};
+        my $tmdbid = ref $xml->{moviematches}->{movie} eq 'ARRAY'
+          ? $xml->{moviematches}{movie}[0]{id}
+          : $xml->{moviematches}{movie}{id};
 
         my ($rc, $response) =
             TMDBAPIRequest('Movie.getInfo', {'id' => $tmdbid});
