Skip to content

Commit

Permalink
Merge pull request #33 from Keeper-of-the-Keys/episode-art-refinement
Browse files Browse the repository at this point in the history
Episode art refinement
  • Loading branch information
Keeper-of-the-Keys authored Apr 9, 2020
2 parents f5b6422 + 3325146 commit 9e59ad2
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 8 deletions.
2 changes: 1 addition & 1 deletion share/man/man1/gpo.1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.TH GPO "1" "March 2020" "gpodder 4.11.0" "User Commands"
.TH GPO "1" "April 2020" "gpodder 4.11.1" "User Commands"
.SH NAME
gpo \- gPodder command-line interface
.SH SYNOPSIS
Expand Down
4 changes: 2 additions & 2 deletions src/gpodder/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@
# This metadata block gets parsed by setup.py - use single quotes only
__tagline__ = 'Media and podcast aggregator'
__author__ = 'Thomas Perl <[email protected]>'
__version__ = '4.11.0'
__date__ = '2020-03-31'
__version__ = '4.11.1'
__date__ = '2020-04-10'
__relname__ = 'Geshem'
__copyright__ = '© 2005-2020 Thomas Perl and the gPodder Team'
__license__ = 'ISC / GPLv3 or later'
Expand Down
2 changes: 1 addition & 1 deletion src/gpodder/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ class PodcastEpisode(EpisodeModelFields, PodcastModelMixin):
MAX_FILENAME_LENGTH = 200

UPDATE_KEYS = ('title', 'url', 'description', 'link', 'published', 'guid', 'file_size',
'payment_url', 'subtitle', 'description_html')
'payment_url', 'subtitle', 'description_html', 'episode_art_url')

class __minidb_defaults__:
url = ''
Expand Down
13 changes: 9 additions & 4 deletions src/gpodder/plugins/soundcloud.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,16 +233,21 @@ def get_new_episodes(self, channel):

def _get_new_episodes(self, channel, track_type):
tracks = [t for t in self.sc_user.get_tracks(track_type, channel)]

existing_guids = [episode.guid for episode in channel.episodes]
existing_guids = dict((episode.guid, episode) for episode in channel.episodes)
seen_guids = [track['guid'] for track in tracks]
new_episodes = []

for track in tracks:
if track['guid'] not in existing_guids:
episode = existing_guids.get(track['guid'])

if not episode:
episode = channel.episode_factory(track.items())
episode.save()
new_episodes.append(episode)
logger.info('Found new episode: %s', episode.guid)
else:
episode.update_from_dict(track)
logger.info('Updating existing episode: %s', episode.guid)
episode.save()

return new_episodes, seen_guids

Expand Down

0 comments on commit 9e59ad2

Please sign in to comment.