total += app_settings.GET_MP3_LENGTH(media.file.path)
return int(total)
+ def get_time(self):
+ return round(self.xml_file.size / 1000 * 40)
+
def has_media(self, type_):
if type_ in Book.formats:
return bool(getattr(self, "%s_file" % type_))
{% block main %}
- <div id="global-progress" class="l-container">
+ <div id="global-progress" class="l-container" data-t="{{ book.get_time }}">
<div class="bar">
<span class="piece" style="flex-grow: 100;">
<span class="filled"></span>
</span>
</div>
<div class="progress-text">
- Szacowany czas do końca: <span class="progress-text-value">56 min</span>
+ Szacowany czas do końca: <span class="progress-text-value">-</span>
</div>
</div>
'js/book_text/references.js',
'js/book_text/settings.js',
'js/book_text/toc.js',
+ 'js/book_text/progress.js',
'js/contrib/jquery.countdown.js', 'js/contrib/jquery.countdown-pl.js',
'js/contrib/jquery.countdown-de.js', 'js/contrib/jquery.countdown-uk.js',
#global-progress {
- display: none;
position: sticky;
top: 0;
background: white;