From 26827195c0857ec60ab170363da4dd5a4a8e24be Mon Sep 17 00:00:00 2001 From: Thomas Vander Stichele Date: Thu, 22 Nov 2012 23:22:26 +0000 Subject: [PATCH] * morituri/common/program.py: Add %y to template for year. Fixes #98. --- ChangeLog | 5 +++++ morituri/common/program.py | 3 +++ 2 files changed, 8 insertions(+) diff --git a/ChangeLog b/ChangeLog index 6d5dba5..1fdc5a8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2012-11-23 Thomas Vander Stichele + + * morituri/common/program.py: + Add %y to template for year. Fixes #98. + 2012-11-23 Thomas Vander Stichele * morituri/common/common.py: diff --git a/morituri/common/program.py b/morituri/common/program.py index b5bf8b3..eb9c0a1 100644 --- a/morituri/common/program.py +++ b/morituri/common/program.py @@ -170,6 +170,7 @@ class Program(log.Loggable): assert type(template) is unicode, "%r is not unicode" % template # the template is similar to grip, except for %s/%S + # see #gripswitches # returns without extension @@ -189,6 +190,8 @@ class Program(log.Loggable): if self.metadata: + release = self.metadata.release or '0000' + v['y'] = release[:4] v['A'] = filterForPath(self.metadata.artist) v['S'] = filterForPath(self.metadata.sortName) v['d'] = filterForPath(self.metadata.title)