Merge pull request #1272 from auouymous/show-episodes-without-enclosures
Show episodes without downloadable content.
This commit is contained in:
commit
f49068311e
|
@ -2811,16 +2811,22 @@ class gPodder(BuilderWidget, dbus.service.Object):
|
|||
# download older episodes first
|
||||
episodes = list(Model.sort_episodes_by_pubdate(episodes))
|
||||
|
||||
if not episodes:
|
||||
# Remove episodes without downloadable content
|
||||
downloadable_episodes = [e for e in episodes if e.url]
|
||||
|
||||
if not downloadable_episodes:
|
||||
# Nothing new here - but inform the user
|
||||
self.pbFeedUpdate.set_fraction(1.0)
|
||||
self.pbFeedUpdate.set_text(_('No new episodes'))
|
||||
self.pbFeedUpdate.set_text(
|
||||
_('No new episodes with downloadable content') if episodes else _('No new episodes'))
|
||||
self.feed_cache_update_cancelled = True
|
||||
self.btnCancelFeedUpdate.show()
|
||||
self.btnCancelFeedUpdate.set_sensitive(True)
|
||||
self.update_action.set_enabled(True)
|
||||
self.btnCancelFeedUpdate.set_image(Gtk.Image.new_from_icon_name('edit-clear', Gtk.IconSize.BUTTON))
|
||||
else:
|
||||
episodes = downloadable_episodes
|
||||
|
||||
count = len(episodes)
|
||||
# New episodes are available
|
||||
self.pbFeedUpdate.set_fraction(1.0)
|
||||
|
|
|
@ -192,6 +192,7 @@ class EpisodeListModel(Gtk.ListStore):
|
|||
# Are we currently showing "all episodes"/section or a single channel?
|
||||
self._section_view = False
|
||||
|
||||
self.ICON_WEB_BROWSER = 'web-browser'
|
||||
self.ICON_AUDIO_FILE = 'audio-x-generic'
|
||||
self.ICON_VIDEO_FILE = 'video-x-generic'
|
||||
self.ICON_IMAGE_FILE = 'image-x-generic'
|
||||
|
@ -466,6 +467,12 @@ class EpisodeListModel(Gtk.ListStore):
|
|||
if episode.state == gpodder.STATE_NORMAL and episode.is_new:
|
||||
view_show_downloaded = self._config.ui.gtk.episode_list.always_show_new
|
||||
view_show_unplayed = True
|
||||
elif not episode.url:
|
||||
tooltip.append(_('No downloadable content'))
|
||||
status_icon = self.ICON_WEB_BROWSER
|
||||
if episode.state == gpodder.STATE_NORMAL and episode.is_new:
|
||||
view_show_downloaded = self._config.ui.gtk.episode_list.always_show_new
|
||||
view_show_unplayed = True
|
||||
elif episode.state == gpodder.STATE_NORMAL and episode.is_new:
|
||||
tooltip.append(_('New episode'))
|
||||
view_show_downloaded = self._config.ui.gtk.episode_list.always_show_new
|
||||
|
|
|
@ -351,7 +351,11 @@ class PodcastEpisode(PodcastModelObject):
|
|||
if link_has_media:
|
||||
return episode
|
||||
|
||||
return None
|
||||
# The episode has no downloadable content.
|
||||
# It is either a blog post or it links to a webpage with content accessible from shownotes title.
|
||||
# Remove the URL so downloading will fail.
|
||||
episode.url = ''
|
||||
return episode
|
||||
|
||||
def __init__(self, channel):
|
||||
self.parent = channel
|
||||
|
|
Loading…
Reference in New Issue