X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/967eed676fc83d15b26149047f353ac61faa8217..2a54a1a2eaf66e7d65dcfbb6023a9ebc0ef138a0:/src/catalogue/management/commands/checkcovers.py diff --git a/src/catalogue/management/commands/checkcovers.py b/src/catalogue/management/commands/checkcovers.py index 66a69c78f..db9fc4c47 100644 --- a/src/catalogue/management/commands/checkcovers.py +++ b/src/catalogue/management/commands/checkcovers.py @@ -10,7 +10,7 @@ from catalogue import app_settings def ancestor_has_cover(book): while book.parent: book = book.parent - if book.extra_info.get('cover_url'): + if book.get_extra_info_json().get('cover_url'): return True return False @@ -54,7 +54,7 @@ class Command(BaseCommand): with transaction.atomic(): for book in Book.objects.all().order_by('slug').iterator(): - extra_info = book.extra_info + extra_info = book.get_extra_info_json() if not extra_info.get('cover_url'): if ancestor_has_cover(book): with_ancestral_cover.append(book) @@ -100,9 +100,10 @@ Bad licenses used: %s (%d covers without license). for book in no_license: print() print(full_url(book)) - print(book.extra_info.get('cover_by')) - print(book.extra_info.get('cover_source')) - print(book.extra_info.get('cover_url')) + extra_info = book.get_extra_info_json() + print(extra_info.get('cover_by')) + print(extra_info.get('cover_source')) + print(extra_info.get('cover_url')) if not_redakcja: print() @@ -111,9 +112,10 @@ Bad licenses used: %s (%d covers without license). for book in not_redakcja: print() print(full_url(book)) - print(book.extra_info.get('cover_by')) - print(book.extra_info.get('cover_source')) - print(book.extra_info.get('cover_url')) + extra_info = book.get_extra_info_json() + print(extra_info.get('cover_by')) + print(extra_info.get('cover_source')) + print(extra_info.get('cover_url')) if without_cover: print()