@@ -1367,17 +1367,17 @@ def search_library(self, query:str=None, entries=True, collations=True,
1367
1367
query : str = query .strip ().lower ()
1368
1368
query_words : list [str ] = query .split (' ' )
1369
1369
all_tag_terms : list [str ] = []
1370
- only_untagged : bool = True if 'untagged' in query or 'no tags' in query else False
1371
- only_empty : bool = True if 'empty' in query or 'no fields' in query else False
1372
- only_missing : bool = True if 'missing' in query or 'no file' in query else False
1373
- allow_adv : bool = True if 'filename:' in query_words else False
1374
- tag_only : bool = True if 'tag_id:' in query_words else False
1370
+ only_untagged : bool = ( 'untagged' in query or 'no tags' in query )
1371
+ only_empty : bool = ( 'empty' in query or 'no fields' in query )
1372
+ only_missing : bool = ( 'missing' in query or 'no file' in query )
1373
+ allow_adv : bool = 'filename:' in query_words
1374
+ tag_only : bool = 'tag_id:' in query_words
1375
1375
if allow_adv :
1376
1376
query_words .remove ('filename:' )
1377
1377
if tag_only :
1378
1378
query_words .remove ('tag_id:' )
1379
1379
# TODO: Expand this to allow for dynamic fields to work.
1380
- only_no_author : bool = True if 'no author' in query or 'no artist' in query else False
1380
+ only_no_author : bool = ( 'no author' in query or 'no artist' in query )
1381
1381
1382
1382
# Preprocess the Tag terms.
1383
1383
if query_words :
@@ -1400,7 +1400,7 @@ def search_library(self, query:str=None, entries=True, collations=True,
1400
1400
# non_entry_count = 0
1401
1401
# Iterate over all Entries =============================================================
1402
1402
for entry in self .entries :
1403
- allowed_ext : bool = False if os .path .splitext (entry .filename )[1 ][1 :].lower () in self .ignored_extensions else True
1403
+ allowed_ext : bool = os .path .splitext (entry .filename )[1 ][1 :].lower () not in self .ignored_extensions
1404
1404
# try:
1405
1405
# entry: Entry = self.entries[self.file_to_library_index_map[self._source_filenames[i]]]
1406
1406
# print(f'{entry}')
@@ -1522,7 +1522,7 @@ def search_library(self, query:str=None, entries=True, collations=True,
1522
1522
1523
1523
for entry in self .entries :
1524
1524
added = False
1525
- allowed_ext : bool = False if os .path .splitext (entry .filename )[1 ][1 :].lower () in self .ignored_extensions else True
1525
+ allowed_ext : bool = os .path .splitext (entry .filename )[1 ][1 :].lower () not in self .ignored_extensions
1526
1526
if allowed_ext :
1527
1527
for f in entry .fields :
1528
1528
if self .get_field_attr (f , 'type' ) == 'collation' :
0 commit comments