mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Merge branch 'patch-18' of https://github.com/Sophist-UK/calibre
Fixes #1926848 [Private Eye recipe broken](https://bugs.launchpad.net/calibre/+bug/1926848)
This commit is contained in:
commit
47211fff5c
@ -80,11 +80,11 @@ class PrivateEyeRecipe(BasicNewsRecipe):
|
|||||||
return url
|
return url
|
||||||
|
|
||||||
urls = []
|
urls = []
|
||||||
publication_date = ""
|
edition_date = ""
|
||||||
|
|
||||||
def add_article(self, title, url, description="", date=None):
|
def add_article(self, title, url, description="", date=None):
|
||||||
if date is None:
|
if date is None:
|
||||||
date = self.publication_date
|
date = self.edition_date
|
||||||
if url and url not in self.urls:
|
if url and url not in self.urls:
|
||||||
self.urls.append(url)
|
self.urls.append(url)
|
||||||
self.log.info(
|
self.log.info(
|
||||||
@ -139,9 +139,9 @@ class PrivateEyeRecipe(BasicNewsRecipe):
|
|||||||
date = datetime.strptime(
|
date = datetime.strptime(
|
||||||
" ".join((day, month, year)), "%d %B %Y")
|
" ".join((day, month, year)), "%d %B %Y")
|
||||||
date = date - timedelta(11)
|
date = date - timedelta(11)
|
||||||
self.publication_date = datetime.strftime(
|
self.edition_date = datetime.strftime(
|
||||||
date, "%d %B %Y").lstrip("0")
|
date, "%d %B %Y").lstrip("0")
|
||||||
self.log.debug("Publication date: %s" % self.publication_date)
|
self.log.debug("Publication date: %s" % self.edition_date)
|
||||||
self.title_with_date = self.title + datetime.strftime(
|
self.title_with_date = self.title + datetime.strftime(
|
||||||
date, " %Y-%m-%d")
|
date, " %Y-%m-%d")
|
||||||
break
|
break
|
||||||
|
Loading…
x
Reference in New Issue
Block a user