From e9892d491dd82a7eb8e3fe06178c67f1f349998f Mon Sep 17 00:00:00 2001 From: Thomas Perl Date: Wed, 19 Nov 2008 17:44:52 +0100 Subject: [PATCH] Add {podcast.title} for custom_sync_name (bug 234) You can now use {podcast.title} to insert the title of the podcast an episode is in for your custom_sync_name. The old "{channel.title}" syntax is deprecated and should be converted to the new syntax automatically. Thanks to Gilles Lehoux for reporting this bug. --- src/gpodder/gui.py | 3 ++- src/gpodder/libpodcasts.py | 5 ++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/gpodder/gui.py b/src/gpodder/gui.py index 1fafec90..713b89ac 100644 --- a/src/gpodder/gui.py +++ b/src/gpodder/gui.py @@ -2923,7 +2923,8 @@ class gPodderProperties(GladeWidget): examples = [ '{episode.title} -> Interview with RMS', '{episode.basename} -> 70908-interview-rms', - '{episode.published} -> 20070908' + '{episode.published} -> 20070908', + '{podcast.title} -> The Interview Podcast' ] info = [ diff --git a/src/gpodder/libpodcasts.py b/src/gpodder/libpodcasts.py index 9a343206..89b6a6a2 100644 --- a/src/gpodder/libpodcasts.py +++ b/src/gpodder/libpodcasts.py @@ -671,7 +671,10 @@ class podcastItem(object): def sync_filename( self): if gl.config.custom_sync_name_enabled: - return util.object_string_formatter(gl.config.custom_sync_name, episode=self, channel=self.channel) + if '{channel' in gl.config.custom_sync_name: + log('Fixing OLD syntax {channel.*} => {podcast.*} in custom_sync_name.', sender=self) + gl.config.custom_sync_name = gl.config.custom_sync_name.replace('{channel.', '{podcast.') + return util.object_string_formatter(gl.config.custom_sync_name, episode=self, podcast=self.channel) else: return self.title -- 2.11.4.GIT