Extensions: New on_episode_playback function

This commit is contained in:
Thomas Perl 2013-01-19 17:07:00 +01:00
parent ec3474e149
commit d8b70eeda5
2 changed files with 12 additions and 0 deletions

View file

@ -428,6 +428,17 @@ class ExtensionManager(object):
"""
pass
@call_extensions
def on_episode_playback(self, episode):
"""Called when an episode is played back
This function will be called when the user clicks on "Play" or
"Open" in the GUI to open an episode with the media player.
@param episode: A gpodder.model.PodcastEpisode instance
"""
pass
@call_extensions
def on_episode_save(self, episode):
"""Called when an episode is saved to the database

View file

@ -404,6 +404,7 @@ class PodcastEpisode(PodcastModelObject):
def playback_mark(self):
self.is_new = False
self.last_playback = int(time.time())
gpodder.user_extensions.on_episode_playback(self)
self.save()
def mark(self, state=None, is_played=None, is_locked=None):