X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/6d42bc478e3d1bd90eb294464748c21e4de0fc63..1959361810afbb5f1de88b7d717da32979c7235d:/src/catalogue/helpers.py?ds=sidebyside diff --git a/src/catalogue/helpers.py b/src/catalogue/helpers.py index 796ed0483..b1ee96e10 100644 --- a/src/catalogue/helpers.py +++ b/src/catalogue/helpers.py @@ -1,5 +1,5 @@ -# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. -# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# This file is part of Wolne Lektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Wolne Lektury. See NOTICE for more information. # from django.conf import settings from django.contrib.contenttypes.models import ContentType @@ -77,7 +77,7 @@ def update_counters(): count_for_book(child, count_by_combination, combs_for_child) count_by_combination = defaultdict(lambda: 0) - for b in Book.objects.filter(parent=None): + for b in Book.objects.filter(findable=True, parent=None): count_for_book(b, count_by_combination) next_combinations = defaultdict(set) @@ -101,7 +101,7 @@ def update_counters(): def get_audiobook_tags(): audiobook_tag_ids = cache.get('audiobook_tags') if audiobook_tag_ids is None: - books_with_audiobook = Book.objects.filter(media__type__in=('mp3', 'ogg'))\ + books_with_audiobook = Book.objects.filter(findable=True, media__type__in=('mp3', 'ogg'))\ .distinct().values_list('pk', flat=True) audiobook_tag_ids = Tag.objects.filter( items__content_type=ContentType.objects.get_for_model(Book),