[mythtv-users] Changes to tmdb? Video details lookup failing.

Angela angela.schmid at wolke7.net
Fri Sep 27 09:49:48 UTC 2013


>> TMDB v2 API is no longer available, you've got to use tmdbv3.py. The
>> issue with this, is that TMDB also doesn't find any results when you
>> search a title and it includes the year (such as "wild bill 2011", go
>> ahead and try it on their website). The new V3 API accepts the year,
>> which is exactly what we want. The issue is that there is no way for
>> MythTV to know via a filename if part of the filename is the year it
>> was released. Ideally, we'd be allowed to put it in parentheses (such
>> as "wild bill (2011)"), but currently MythTV strips out everything in
>> the parentheses.
>>
>> Unfortuantely, I don't know of a workaround for this other than
>> manually entering the inetref into mythtv before doing the scan.
>So essentially.... we just need to parse the file name, and if it
>finds a 4 digit number at the end of the name, between 1900 and
><current year>, assume it's a year and submit it as such.  If it
>fails, then resubmit with it in the title?
>
>I may need to dust off my python skills ;-).
>
>What happens to 2012?
 
Thanks for pointing out the change at TMDB. Three weeks ago searching with a date worked. TMDB is making itself unattractive, as there is no extended search.

I have all my ripped movies in directories like 2012 (2009). XBMC, Metadata Crawlers, etc. understand this convention, only Mythtv doesn't.
As already pointed out, Mythtv drops information between parenthesis, and I wanted to search with date.
I made the following change in mythtv/libs/libmythmetadata/metadatadownload.cpp, which uses the filename instead of the title (in parameter lookup)
             args.append(QString("-M"));
             QString title = lookup->GetTitle();
+
+            QString filename = lookup->GetFilename();
+            QStringList tmp = filename.split('/');
+
+            if(filename.at(filename.size() - 4) == '.') // check for filename.ext, is it a file or a VIDEO_TS directory
+            {
+               title = tmp.takeAt(tmp.size() - 2); // use parent directory name
+            } else
+            {
+               title = tmp.takeAt(tmp.size() - 1); // use directory name
+            }
+
+            title.replace("(", "").replace(")", "");	// strip "(" and ")"

The last line should now be changed into a regular expression

pattern: (.\+\)( )((((19)|(20))[0-9][0-9]))$
flags: g
7 capturing groups: 
   group 1: (.\+\)
   group 2: ( )
   group 3: ((((19)|(20))[0-9][0-9]))
   group 4: (((19)|(20))[0-9][0-9])
   group 5: ((19)|(20))
   group 6: (19)
   group 7: (20)

When having three parts, first part goes into title, third part goes into year.
Otherwise, use original string

And add an option (e.g. -Y) to tmdb3.py for the year.

Anybody taking over, as I need to get my flight, and returning on the 6th October.

Angela




More information about the mythtv-users mailing list