refactor(api): remove unnecessary or wrong is keyword usage
This commit is contained in:
parent
62d9cd4d80
commit
64e7c68699
12 changed files with 14 additions and 16 deletions
|
|
@ -135,10 +135,7 @@ class ArtistFilter(
|
|||
return queryset.playable_by(actor, value).distinct()
|
||||
|
||||
def filter_has_albums(self, queryset, name, value):
|
||||
if value is True:
|
||||
return queryset.filter(albums__isnull=False)
|
||||
else:
|
||||
return queryset.filter(albums__isnull=True)
|
||||
return queryset.filter(albums__isnull=not value)
|
||||
|
||||
|
||||
class TrackFilter(
|
||||
|
|
|
|||
|
|
@ -355,7 +355,7 @@ class Command(BaseCommand):
|
|||
batch_duration = None
|
||||
self.stdout.write("Starting import of new files…")
|
||||
for i, entries in enumerate(batch(crawler, options["batch_size"])):
|
||||
if options.get("update_cache", False) is True:
|
||||
if options.get("update_cache", False):
|
||||
# check to see if the scan was cancelled
|
||||
if cache.get("fs-import:status") == "canceled":
|
||||
raise CommandError("Import cancelled")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue