Add books dialog: Exclude zip and rar files from the default list of books types. These are rarely single books these days. And they can still be selected using the archives option. Fixes #1602 (Allows you to default to exclude some file types when adding books)

This commit is contained in:
Kovid Goyal 2022-03-07 21:01:38 +05:30
parent 528efd3d88
commit 894f7d547a
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -30,8 +30,9 @@ from polyglot.builtins import iteritems, string_or_bytes
def get_filters(): def get_filters():
archives = ['zip', 'rar']
return [ return [
(_('Books'), BOOK_EXTENSIONS), (_('Books'), [x for x in BOOK_EXTENSIONS if x not in archives]),
(_('EPUB books'), ['epub', 'kepub']), (_('EPUB books'), ['epub', 'kepub']),
(_('Kindle books'), ['mobi', 'prc', 'azw', 'azw3', 'kfx', 'tpz', 'azw1', 'azw4']), (_('Kindle books'), ['mobi', 'prc', 'azw', 'azw3', 'kfx', 'tpz', 'azw1', 'azw4']),
(_('PDF books'), ['pdf', 'azw4']), (_('PDF books'), ['pdf', 'azw4']),
@ -39,7 +40,7 @@ def get_filters():
(_('LIT books'), ['lit']), (_('LIT books'), ['lit']),
(_('Text books'), ['txt', 'text', 'rtf', 'md', 'markdown', 'textile', 'txtz']), (_('Text books'), ['txt', 'text', 'rtf', 'md', 'markdown', 'textile', 'txtz']),
(_('Comics'), ['cbz', 'cbr', 'cbc']), (_('Comics'), ['cbz', 'cbr', 'cbc']),
(_('Archives'), ['zip', 'rar']), (_('Archives'), archives),
(_('Wordprocessor files'), ['odt', 'doc', 'docx']), (_('Wordprocessor files'), ['odt', 'doc', 'docx']),
] ]