Fix history table sorting by play duration

This commit is contained in:
JonnyWong16 2023-04-13 15:17:22 -07:00
parent 2921c1fc30
commit b0921b5f4a
No known key found for this signature in database
GPG key ID: B1F1F9807184697A
7 changed files with 9 additions and 8 deletions

View file

@ -84,7 +84,7 @@
<th align="left" id="started">Started</th>
<th align="left" id="paused_counter">Paused</th>
<th align="left" id="stopped">Stopped</th>
<th align="left" id="duration">Duration</th>
<th align="left" id="play_duration">Duration</th>
<th align="left" id="percent_complete"></th>
</tr>
</thead>

View file

@ -32,7 +32,7 @@
<th align="left" id="started">Started</th>
<th align="left" id="paused_counter">Paused</th>
<th align="left" id="stopped">Stopped</th>
<th align="left" id="duration">Duration</th>
<th align="left" id="play_duration">Duration</th>
<th align="left" id="percent_complete"></th>
</tr>
</thead>

View file

@ -692,7 +692,7 @@ DOCUMENTATION :: END
<th align="left" id="started">Started</th>
<th align="left" id="paused_counter">Paused</th>
<th align="left" id="stopped">Stopped</th>
<th align="left" id="duration">Duration</th>
<th align="left" id="play_duration">Duration</th>
<th align="left" id="percent_complete"></th>
</tr>
</thead>

View file

@ -247,7 +247,7 @@ history_table_options = {
},
{
"targets": [11],
"data": "duration",
"data": "play_duration",
"render": function (data, type, full) {
if (data !== null) {
return Math.round(moment.duration(data, 'seconds').as('minutes')) + ' mins';
@ -529,7 +529,7 @@ function childTableFormat(rowData) {
'<th align="left" id="started">Started</th>' +
'<th align="left" id="paused_counter">Paused</th>' +
'<th align="left" id="stopped">Stopped</th>' +
'<th align="left" id="duration">Duration</th>' +
'<th align="left" id="play_duration">Duration</th>' +
'<th align="left" id="percent_complete"></th>' +
'</tr>' +
'</thead>' +

View file

@ -248,7 +248,7 @@ DOCUMENTATION :: END
<th align="left" id="started">Started</th>
<th align="left" id="paused_counter">Paused</th>
<th align="left" id="stopped">Stopped</th>
<th align="left" id="duration">Duration</th>
<th align="left" id="play_duration">Duration</th>
<th align="left" id="percent_complete"></th>
</tr>
</thead>

View file

@ -212,7 +212,7 @@ DOCUMENTATION :: END
<th align="left" id="started">Started</th>
<th align="left" id="paused_counter">Paused</th>
<th align="left" id="stopped">Stopped</th>
<th align="left" id="duration">Duration</th>
<th align="left" id="play_duration">Duration</th>
<th align="left" id="percent_complete"></th>
</tr>
</thead>

View file

@ -308,7 +308,8 @@ class DataFactory(object):
'date': item['date'],
'started': item['started'],
'stopped': item['stopped'],
'duration': item['play_duration'],
'duration': item['play_duration'], # Keep for backwards compatibility
'play_duration': item['play_duration'],
'paused_counter': item['paused_counter'],
'user_id': item['user_id'],
'user': item['user'],