From b3621d6041ef1af75ca658099f7e91cda8d4f2b9 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Stefan=20K=C3=B6gl?= Date: Mon, 17 Jan 2011 11:37:47 +0200 Subject: [PATCH] removed redundant episode data --- feedservice/feeddownloader.py | 3 --- feedservice/index.html | 5 +---- feedservice/mimetype.py | 2 +- 3 files changed, 2 insertions(+), 8 deletions(-) diff --git a/feedservice/feeddownloader.py b/feedservice/feeddownloader.py index fa23402..d010d81 100644 --- a/feedservice/feeddownloader.py +++ b/feedservice/feeddownloader.py @@ -125,9 +125,6 @@ def get_episode_metadata(entry, files): 'duration': get_duration(entry), 'language': entry.get('language', ''), 'files': [ dict(url=k, mimetype=v[0], filesize=v[1]) for (k, v) in files.items()], - 'url': files.keys()[0], - 'filesize': files.values()[0][1], - 'mimetype': files.values()[0][0], } try: d['timestamp'] = datetime.datetime(*(entry.updated_parsed)[:6]).strftime('%Y-%m-%dT%H:%M:%S') diff --git a/feedservice/index.html b/feedservice/index.html index f702c97..89a982f 100644 --- a/feedservice/index.html +++ b/feedservice/index.html @@ -70,10 +70,7 @@ a, a:visited {
  • author: the episode's author
  • duration: the episode's duration in seconds
  • language: the episode's language
  • -
  • files: a list of all files linked by the episode. Each files is represented by an object containing url, filesize and mimetype. See below for description
  • -
  • url: The URL of the first linked file
  • -
  • filesize: the size of the first linked file in Byte
  • -
  • mimetype: the mimetype of the first linked file
  • +
  • files: a list of all files linked by the episode. Each files is represented by an object containing url, filesize (in Bytes) and mimetype.
  • diff --git a/feedservice/mimetype.py b/feedservice/mimetype.py index 58cb366..457c08a 100644 --- a/feedservice/mimetype.py +++ b/feedservice/mimetype.py @@ -17,7 +17,7 @@ def get_podcast_types(podcast): """ types = defaultdict() for e in podcast['episodes']: - t = get_type(e['mimetype']) + t = get_type(e['files'][0].get('mimetype', '')) types[t] = types.get(t, 0) + 1 max_episodes = sum(types.itervalues()) -- 2.11.4.GIT