mirror of
				https://github.com/kovidgoyal/calibre.git
				synced 2025-10-30 18:22:25 -04:00 
			
		
		
		
	GwR resolve with KG fixes
This commit is contained in:
		
						commit
						11e1b5b2bc
					
				| @ -12,7 +12,6 @@ __docformat__ = 'restructuredtext en' | |||||||
| from struct import pack, unpack | from struct import pack, unpack | ||||||
| from cStringIO import StringIO | from cStringIO import StringIO | ||||||
| 
 | 
 | ||||||
| from calibre import prints |  | ||||||
| from calibre.ebooks.mobi import MobiError | from calibre.ebooks.mobi import MobiError | ||||||
| from calibre.ebooks.mobi.writer import rescale_image, MAX_THUMB_DIMEN | from calibre.ebooks.mobi.writer import rescale_image, MAX_THUMB_DIMEN | ||||||
| from calibre.ebooks.mobi.langcodes import iana2mobi | from calibre.ebooks.mobi.langcodes import iana2mobi | ||||||
|  | |||||||
| @ -11,7 +11,7 @@ from calibre.customize.conversion import OptionRecommendation, DummyReporter | |||||||
| from calibre.ebooks.BeautifulSoup import BeautifulSoup, BeautifulStoneSoup, Tag, NavigableString | from calibre.ebooks.BeautifulSoup import BeautifulSoup, BeautifulStoneSoup, Tag, NavigableString | ||||||
| from calibre.ptempfile import PersistentTemporaryDirectory | from calibre.ptempfile import PersistentTemporaryDirectory | ||||||
| from calibre.utils.logging import Log | from calibre.utils.logging import Log | ||||||
| from calibre.utils.date import isoformat | from calibre.utils.date import isoformat, now as nowf | ||||||
| 
 | 
 | ||||||
| FIELDS = ['all', 'author_sort', 'authors', 'comments', | FIELDS = ['all', 'author_sort', 'authors', 'comments', | ||||||
|           'cover', 'formats', 'id', 'isbn', 'pubdate', 'publisher', 'rating', |           'cover', 'formats', 'id', 'isbn', 'pubdate', 'publisher', 'rating', | ||||||
| @ -1761,9 +1761,8 @@ class EPUB_MOBI(CatalogPlugin): | |||||||
|                         book['title_sort'] = self.generateSortTitle(book['title']) |                         book['title_sort'] = self.generateSortTitle(book['title']) | ||||||
|                 self.booksByDateRange = sorted(nspt, key=lambda x:(x['timestamp'], x['timestamp']),reverse=True) |                 self.booksByDateRange = sorted(nspt, key=lambda x:(x['timestamp'], x['timestamp']),reverse=True) | ||||||
| 
 | 
 | ||||||
|             today = datetime.datetime.now() |  | ||||||
|             date_range_list = [] |             date_range_list = [] | ||||||
|             today_time = datetime.datetime(today.year, today.month, today.day, 23, 59, 59) |             today_time = nowf().replace(hour=23, minute=59, second=59) | ||||||
|             books_added_in_date_range = False |             books_added_in_date_range = False | ||||||
|             for (i, date) in enumerate(self.DATE_RANGE): |             for (i, date) in enumerate(self.DATE_RANGE): | ||||||
|                 date_range_limit = self.DATE_RANGE[i] |                 date_range_limit = self.DATE_RANGE[i] | ||||||
| @ -1773,11 +1772,7 @@ class EPUB_MOBI(CatalogPlugin): | |||||||
|                     date_range = 'Last %d days' % (self.DATE_RANGE[i]) |                     date_range = 'Last %d days' % (self.DATE_RANGE[i]) | ||||||
| 
 | 
 | ||||||
|                 for book in self.booksByDateRange: |                 for book in self.booksByDateRange: | ||||||
|                     book_time = datetime.datetime(book['timestamp'].year, |                     book_time = book['timestamp'] | ||||||
|                                                   book['timestamp'].month, |  | ||||||
|                                                   book['timestamp'].day, |  | ||||||
|                                                   book['timestamp'].hour, |  | ||||||
|                                                   book['timestamp'].minute) |  | ||||||
|                     delta = today_time-book_time |                     delta = today_time-book_time | ||||||
|                     if delta.days <= date_range_limit: |                     if delta.days <= date_range_limit: | ||||||
|                         date_range_list.append(book) |                         date_range_list.append(book) | ||||||
| @ -3469,7 +3464,6 @@ class EPUB_MOBI(CatalogPlugin): | |||||||
|         # If exclude_genre is blank, assume user wants all genre tags included |         # If exclude_genre is blank, assume user wants all genre tags included | ||||||
|         if opts.exclude_genre.strip() == '': |         if opts.exclude_genre.strip() == '': | ||||||
|             opts.exclude_genre = '\[^.\]' |             opts.exclude_genre = '\[^.\]' | ||||||
|             #log(" converting empty exclude_genre to '\[^.\]'") |  | ||||||
|             build_log.append(" converting empty exclude_genre to '\[^.\]'") |             build_log.append(" converting empty exclude_genre to '\[^.\]'") | ||||||
| 
 | 
 | ||||||
|         if opts.connected_device['name']: |         if opts.connected_device['name']: | ||||||
|  | |||||||
| @ -1467,7 +1467,6 @@ class LibraryDatabase2(LibraryDatabase): | |||||||
|         db_id, existing = None, False |         db_id, existing = None, False | ||||||
|         if matches: |         if matches: | ||||||
|             db_id = list(matches)[0] |             db_id = list(matches)[0] | ||||||
|             existing = True |  | ||||||
|         if db_id is None: |         if db_id is None: | ||||||
|             obj = self.conn.execute('INSERT INTO books(title, author_sort) VALUES (?, ?)', |             obj = self.conn.execute('INSERT INTO books(title, author_sort) VALUES (?, ?)', | ||||||
|                                 (title, 'calibre')) |                                 (title, 'calibre')) | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user