From 894f7d547a4d9fa6141935ab8eba78d89486090a Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 7 Mar 2022 21:01:38 +0530 Subject: [PATCH] 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) --- src/calibre/gui2/actions/add.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/calibre/gui2/actions/add.py b/src/calibre/gui2/actions/add.py index 605c3591be..b2df3ee82e 100644 --- a/src/calibre/gui2/actions/add.py +++ b/src/calibre/gui2/actions/add.py @@ -30,8 +30,9 @@ from polyglot.builtins import iteritems, string_or_bytes def get_filters(): + archives = ['zip', 'rar'] return [ - (_('Books'), BOOK_EXTENSIONS), + (_('Books'), [x for x in BOOK_EXTENSIONS if x not in archives]), (_('EPUB books'), ['epub', 'kepub']), (_('Kindle books'), ['mobi', 'prc', 'azw', 'azw3', 'kfx', 'tpz', 'azw1', 'azw4']), (_('PDF books'), ['pdf', 'azw4']), @@ -39,7 +40,7 @@ def get_filters(): (_('LIT books'), ['lit']), (_('Text books'), ['txt', 'text', 'rtf', 'md', 'markdown', 'textile', 'txtz']), (_('Comics'), ['cbz', 'cbr', 'cbc']), - (_('Archives'), ['zip', 'rar']), + (_('Archives'), archives), (_('Wordprocessor files'), ['odt', 'doc', 'docx']), ]