From c5fa197de3606a8a037f5991e8bb496e337dcd06 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Fri, 14 Oct 2011 21:50:50 +0200 Subject: [PATCH] output computed title --- ox/movie.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/ox/movie.py b/ox/movie.py index c97498f..75c5dab 100644 --- a/ox/movie.py +++ b/ox/movie.py @@ -31,7 +31,7 @@ def parse_movie_path(path): T/Title (Year)/Title.avi """ - episodeTitle = episodeYear = None + episodeTitle = episodeYear = seriesTitle = None episodeDirector = [] parts = path.split('/') @@ -87,6 +87,13 @@ def parse_movie_path(path): episodeTitle = fileparts[episodeTitle] if episodeTitle == extension or episodeTitle.startswith('Part'): episodeTitle = None + if season: + seriesTitle = title + title = u'%s (S%02d)' % (seriesTitle, season) + if episode: + title = u'%s (S%02dE%02d)' % (seriesTitle, season, episode) + if episodeTitle: + title = u'%s %s' % (title, episodeTitle) #part part = findRe(parts[-1], '\.Part (\d+)\.') @@ -105,6 +112,7 @@ def parse_movie_path(path): 'language': language, 'part': part, 'season': season, + 'seriesTitle': seriesTitle, 'title': title, 'year': year, }