Metadata download: Try harder to preserve the month in the published date.

This commit is contained in:
Kovid Goyal 2011-07-06 09:43:28 -06:00
parent 2cebf59638
commit 6f73a2982b

View File

@ -298,6 +298,14 @@ class ISBNMerge(object):
# Published date
if min_year:
for r in results:
year = getattr(r.pubdate, 'year', None)
if year == min_year:
ans.pubdate = r.pubdate
break
if getattr(ans.pubdate, 'year', None) == min_year:
min_date = datetime(min_year, ans.month, ans.day)
else:
min_date = datetime(min_year, 1, 2, tzinfo=utc_tz)
ans.pubdate = min_date
else: