X-Git-Url: https://git.mdrn.pl/audio.git/blobdiff_plain/fccf7669328b236987c1c49c03e35d3916c0093c..631597417095f9adeaef8314862c1b9974e960c9:/src/archive/views.py diff --git a/src/archive/views.py b/src/archive/views.py index 87eee5b..0b5a5ac 100644 --- a/src/archive/views.py +++ b/src/archive/views.py @@ -292,11 +292,17 @@ class BookView(ListView): "index" ) last_vol = None + last_vol_sub = None for b in qs: - if last_vol is None or last_vol.youtube_volume != b.youtube_volume: + if last_vol is None or last_vol.youtube_volume_index != b.youtube_volume_index: last_vol = b b.total = 0 + if last_vol_sub is None or b.youtube_volume: + last_vol_sub = last_vol + last_vol_sub.total_for_sub = 0 last_vol.total += b.duration + last_vol_sub.total_for_sub += b.duration + b.subtotal = last_vol_sub.total_for_sub return list(qs)