show MOBI as separate item, with correct DRM status

This commit is contained in:
Tomasz Długosz 2012-03-24 16:27:38 +01:00
parent be268d092f
commit 31030fe6fd

View File

@ -82,11 +82,17 @@ class WoblinkStore(BasicStoreConfig, StorePlugin):
s.detail_item = id.strip() s.detail_item = id.strip()
# MOBI should be send first, # MOBI should be send first,
if 'MOBI' in formats: if 'MOBI' in formats:
s.drm = SearchResult.DRM_UNLOCKED t = SearchResult()
s.formats = 'MOBI' t.cover_url = s.cover_url
t.title = s.title +' MOBI'
t.author = s.author
t.price = s.price
t.detail_item = s.detail_item
t.drm = SearchResult.DRM_UNLOCKED
t.formats = 'MOBI'
formats.remove('MOBI') formats.remove('MOBI')
counter -= 1 counter -= 1
yield s yield t
# and the remaining formats (if any) next # and the remaining formats (if any) next
if formats: if formats: