X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/357027375ff8867f42ca34bcbfb5a78b5b185fc3..7b2b19383cd52f1df1e7d1bb8a29d6e099ce7a5b:/src/catalogue/signals.py?ds=inline

diff --git a/src/catalogue/signals.py b/src/catalogue/signals.py
index 660d26493..f3cacaaf7 100644
--- a/src/catalogue/signals.py
+++ b/src/catalogue/signals.py
@@ -19,6 +19,7 @@ from .models import BookMedia, Book, Collection, Fragment, Tag
 
 @receiver([post_save, post_delete], sender=BookMedia)
 def bookmedia_save(sender, instance, **kwargs):
+    instance.book.set_audio_length()
     instance.book.save()
 
 
@@ -92,8 +93,7 @@ def tag_after_change(sender, instance, languages, **kwargs):
 
 @receiver(tags_updated)
 def receive_tags_updated(sender, instance, affected_tags, **kwargs):
-    categories = set(tag.category for tag in affected_tags
-        if tag.category not in ('set', 'book'))
+    categories = set(tag.category for tag in affected_tags if tag.category not in ('set', 'book'))
     if not categories:
         return