fnp
/
audio.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
fccf766
)
Minor view changes.
author
Radek Czajka
<rczajka@rczajka.pl>
Mon, 27 Dec 2021 13:10:19 +0000
(14:10 +0100)
committer
Radek Czajka
<rczajka@rczajka.pl>
Mon, 27 Dec 2021 13:10:19 +0000
(14:10 +0100)
src/archive/models.py
patch
|
blob
|
history
src/archive/templates/archive/book.html
patch
|
blob
|
history
src/archive/templates/archive/list_publishing.html
patch
|
blob
|
history
src/archive/views.py
patch
|
blob
|
history
diff --git
a/src/archive/models.py
b/src/archive/models.py
index
aa84ce4
..
b467a68
100644
(file)
--- a/
src/archive/models.py
+++ b/
src/archive/models.py
@@
-198,7
+198,7
@@
class Audiobook(models.Model):
return (
not self.youtube_volume
or not type(self)
return (
not self.youtube_volume
or not type(self)
- .objects.filter(youtube_volume=self.youtube_volume, index__lt=self.index)
+ .objects.filter(
slug=self.slug,
youtube_volume=self.youtube_volume, index__lt=self.index)
.exists()
)
.exists()
)
diff --git
a/src/archive/templates/archive/book.html
b/src/archive/templates/archive/book.html
index
9c44a9c
..
9cb1c80
100644
(file)
--- a/
src/archive/templates/archive/book.html
+++ b/
src/archive/templates/archive/book.html
@@
-51,7
+51,11
@@
</form>
</td>
<td>
</form>
</td>
<td>
- {{ audiobook.total|duration }}
+ {% if audiobook.youtube_volume %}
+ {{ audiobook.total|duration }}
+ {% else %}
+ <small class="text-secondary">{{ audiobook.subtotal|duration }}</small>
+ {% endif %}
</td>
<td>
{{ audiobook.duration|duration }}
</td>
<td>
{{ audiobook.duration|duration }}
@@
-72,6
+76,7
@@
</span>
</td>
<td>
</span>
</td>
<td>
+ <small class="text-secondary">{{ audiobook.subtotal|duration }}</small>
</td>
<td class="text-secondary">
{{ audiobook.duration|duration }}
</td>
<td class="text-secondary">
{{ audiobook.duration|duration }}
diff --git
a/src/archive/templates/archive/list_publishing.html
b/src/archive/templates/archive/list_publishing.html
index
ad13504
..
2a8512d
100644
(file)
--- a/
src/archive/templates/archive/list_publishing.html
+++ b/
src/archive/templates/archive/list_publishing.html
@@
-17,7
+17,18
@@
<table class="table">
{% for file in objects %}
<tr>
<table class="table">
{% for file in objects %}
<tr>
- <td><a href='{% url "file" file.id %}'>{{ file }}</a></td>
+ <td>
+ <a href='{% url "file" file.id %}'>
+ {{ file }}
+ {% if file.youtube_status == k.0 and file.youtube_volume %}
+ <br>
+ <small>
+ ({{ file.youtube_volume_index }}/{{ file.youtube_volume_count }})
+ {{ file.youtube_volume }}
+ </small>
+ {% endif %}
+ </a>
+ </td>
<td class="text-warning">
{% if file.mp3_status == k.0 %}MP3{% endif %}
</td>
<td class="text-warning">
{% if file.mp3_status == k.0 %}MP3{% endif %}
</td>
diff --git
a/src/archive/views.py
b/src/archive/views.py
index
87eee5b
..
0b5a5ac
100644
(file)
--- a/
src/archive/views.py
+++ b/
src/archive/views.py
@@
-292,11
+292,17
@@
class BookView(ListView):
"index"
)
last_vol = None
"index"
)
last_vol = None
+ last_vol_sub = None
for b in qs:
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
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.total += b.duration
+ last_vol_sub.total_for_sub += b.duration
+ b.subtotal = last_vol_sub.total_for_sub
return list(qs)
return list(qs)