From 08e994dc45894e6105d088f77cb5726e5307bea3 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 6 Aug 2010 09:49:34 -0600 Subject: [PATCH] News download: When downloading news for the Kindle, do not add date to the title, to allow the Kindle's periodical archiving to work. Fixes #6411 (Make date in new title configurable from GUI) --- src/calibre/customize/profiles.py | 14 +++++++++----- src/calibre/gui2/wizard/__init__.py | 4 ++-- src/calibre/web/feeds/news.py | 5 ++++- 3 files changed, 15 insertions(+), 8 deletions(-) diff --git a/src/calibre/customize/profiles.py b/src/calibre/customize/profiles.py index 0db3ce6a15..85eae21b8d 100644 --- a/src/calibre/customize/profiles.py +++ b/src/calibre/customize/profiles.py @@ -233,18 +233,20 @@ class OutputProfile(Plugin): 'if you want to produce a document intended to be read at a ' 'computer or on a range of devices.') - # The image size for comics + #: The image size for comics comic_screen_size = (584, 754) - # If True the MOBI renderer on the device supports MOBI indexing + #: If True the MOBI renderer on the device supports MOBI indexing supports_mobi_indexing = False - # If True output should be optimized for a touchscreen interface + #: If True output should be optimized for a touchscreen interface touchscreen = False touchscreen_news_css = '' - # A list of extra (beyond CSS 2.1) modules supported by the device - # Format is a cssutils profile dictionary (see iPad for example) + #: A list of extra (beyond CSS 2.1) modules supported by the device + #: Format is a cssutils profile dictionary (see iPad for example) extra_css_modules = [] + #: If True, the date is appended to the title of downloaded news + periodical_date_in_title = True @classmethod def tags_to_string(cls, tags): @@ -550,6 +552,7 @@ class KindleOutput(OutputProfile): fbase = 16 fsizes = [12, 12, 14, 16, 18, 20, 22, 24] supports_mobi_indexing = True + periodical_date_in_title = False @classmethod def tags_to_string(cls, tags): @@ -567,6 +570,7 @@ class KindleDXOutput(OutputProfile): dpi = 150.0 comic_screen_size = (741, 1022) supports_mobi_indexing = True + periodical_date_in_title = False @classmethod def tags_to_string(cls, tags): diff --git a/src/calibre/gui2/wizard/__init__.py b/src/calibre/gui2/wizard/__init__.py index b831201f2d..e95db8f8b8 100644 --- a/src/calibre/gui2/wizard/__init__.py +++ b/src/calibre/gui2/wizard/__init__.py @@ -166,9 +166,9 @@ class iPhone(Device): class Android(Device): - name = 'Adroid phone + WordPlayer' + name = 'Adroid phone + WordPlayer/Aldiko' output_format = 'EPUB' - manufacturer = 'Google/HTC' + manufacturer = 'Android' id = 'android' class HanlinV3(Device): diff --git a/src/calibre/web/feeds/news.py b/src/calibre/web/feeds/news.py index e915a6c0b2..6df73487ed 100644 --- a/src/calibre/web/feeds/news.py +++ b/src/calibre/web/feeds/news.py @@ -1095,7 +1095,10 @@ class BasicNewsRecipe(Recipe): def create_opf(self, feeds, dir=None): if dir is None: dir = self.output_dir - mi = MetaInformation(self.short_title() + strftime(self.timefmt), [__appname__]) + title = self.short_title() + if self.output_profile.periodical_date_in_title: + title += strftime(self.timefmt) + mi = MetaInformation(title, [__appname__]) mi.publisher = __appname__ mi.author_sort = __appname__ mi.publication_type = 'periodical:'+self.publication_type