mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix #975338 (OZON.ru metadata source always returns wrong Published date)
This commit is contained in:
parent
fe5ad61f02
commit
27ed4f7a10
@ -6,7 +6,6 @@ __copyright__ = '2011, Roman Mukhin <ramses_ru at hotmail.com>'
|
|||||||
__docformat__ = 'restructuredtext en'
|
__docformat__ = 'restructuredtext en'
|
||||||
|
|
||||||
import re
|
import re
|
||||||
import datetime
|
|
||||||
from urllib import quote_plus
|
from urllib import quote_plus
|
||||||
from Queue import Queue, Empty
|
from Queue import Queue, Empty
|
||||||
|
|
||||||
@ -14,6 +13,7 @@ from calibre import as_unicode
|
|||||||
from calibre.ebooks.metadata import check_isbn
|
from calibre.ebooks.metadata import check_isbn
|
||||||
from calibre.ebooks.metadata.sources.base import Source
|
from calibre.ebooks.metadata.sources.base import Source
|
||||||
from calibre.ebooks.metadata.book.base import Metadata
|
from calibre.ebooks.metadata.book.base import Metadata
|
||||||
|
from calibre.utils.date import parse_only_date
|
||||||
|
|
||||||
class Ozon(Source):
|
class Ozon(Source):
|
||||||
name = 'OZON.ru'
|
name = 'OZON.ru'
|
||||||
@ -454,9 +454,7 @@ def toPubdate(log, yearAsString): # {{{
|
|||||||
res = None
|
res = None
|
||||||
if yearAsString:
|
if yearAsString:
|
||||||
try:
|
try:
|
||||||
year = int(yearAsString)
|
res = parse_only_date(yearAsString)
|
||||||
# only year is available, so use 1-st of Jan
|
|
||||||
res = datetime.datetime(year, 1, 1)
|
|
||||||
except:
|
except:
|
||||||
log.error('cannot parse to date %s'%yearAsString)
|
log.error('cannot parse to date %s'%yearAsString)
|
||||||
return res
|
return res
|
||||||
|
Loading…
x
Reference in New Issue
Block a user