Joined: 02 Oct 2008
|Posted: Fri Aug 07, 2009 7:59 pm Post subject: Prefix genres, year & actors to PUSHED description
|Until someone figures out the magic to push full metadata-information along with video files, I'm going to prefix the description with genres, year, and actors.
For episodic television, TiVo's details screen uses the following template:
"EpisodeTitle" Genre1, Genre2 (AirYear) ActorA, ActorB, ActorC. Description.
Here's the hack to replicate TiVo's template by prefixing description with genres, year, and actors. Starting at line 358 of video.py:
source = file_info['seriesId']
if not source:
source = title
+ desc = ''
+ desc = desc + ', '.join(str(x) for x in file_info['vProgramGenre'])
+ if file_info['vProgramGenre']:
+ desc = desc + ' '
+ if str(file_info['originalAirDate']).endswith('Z'):
+ desc = desc + '(' + str(time.strptime(file_info['originalAirDate'], "%Y-%m-%dT%H:%M:%SZ").tm_year) + ') '
+ desc = desc + '(' + str(time.strptime(file_info['originalAirDate'], "%Y-%m-%dT%H:%M:%S").tm_year) + ') '
+ desc = desc + ', '.join(str(x) for x in file_info['vActor'])
+ if file_info['vActor']:
+ desc = desc + '. '
+ desc = desc + file_info['description']
subtitle = file_info['episodeTitle']
logger.debug('Pushing ' + url)
m = mind.getMind(tsn)
tsn = tsn,
url = url,
- description = file_info['description'],
+ description = desc,
duration = file_info['duration'] / 1000,
size = file_info['size'],
Yes, the hack is ugly and verbose, but it works, even if the metadata file is missing or if it's missing any combination of the genres, the actors, or the originalAirDate.
For movies, one could add starRating after year and before actors.
I'm assuming that the actors' names are written like, "FirstName LastName", not "LastName|FirstName".
I might append call sign, channel, rating, etc. to description, but that's starting to get far afield from TiVo's template.
I'm using wmcbrine's branch dated "Thu, 6 Aug 2009 23:47:34".