mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-06 13:11:15 -07:00
Fix history table sorting by play duration
This commit is contained in:
parent
2921c1fc30
commit
b0921b5f4a
7 changed files with 9 additions and 8 deletions
|
@ -84,7 +84,7 @@
|
||||||
<th align="left" id="started">Started</th>
|
<th align="left" id="started">Started</th>
|
||||||
<th align="left" id="paused_counter">Paused</th>
|
<th align="left" id="paused_counter">Paused</th>
|
||||||
<th align="left" id="stopped">Stopped</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>
|
<th align="left" id="percent_complete"></th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
|
|
|
@ -32,7 +32,7 @@
|
||||||
<th align="left" id="started">Started</th>
|
<th align="left" id="started">Started</th>
|
||||||
<th align="left" id="paused_counter">Paused</th>
|
<th align="left" id="paused_counter">Paused</th>
|
||||||
<th align="left" id="stopped">Stopped</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>
|
<th align="left" id="percent_complete"></th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
|
|
|
@ -692,7 +692,7 @@ DOCUMENTATION :: END
|
||||||
<th align="left" id="started">Started</th>
|
<th align="left" id="started">Started</th>
|
||||||
<th align="left" id="paused_counter">Paused</th>
|
<th align="left" id="paused_counter">Paused</th>
|
||||||
<th align="left" id="stopped">Stopped</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>
|
<th align="left" id="percent_complete"></th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
|
|
|
@ -247,7 +247,7 @@ history_table_options = {
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"targets": [11],
|
"targets": [11],
|
||||||
"data": "duration",
|
"data": "play_duration",
|
||||||
"render": function (data, type, full) {
|
"render": function (data, type, full) {
|
||||||
if (data !== null) {
|
if (data !== null) {
|
||||||
return Math.round(moment.duration(data, 'seconds').as('minutes')) + ' mins';
|
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="started">Started</th>' +
|
||||||
'<th align="left" id="paused_counter">Paused</th>' +
|
'<th align="left" id="paused_counter">Paused</th>' +
|
||||||
'<th align="left" id="stopped">Stopped</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>' +
|
'<th align="left" id="percent_complete"></th>' +
|
||||||
'</tr>' +
|
'</tr>' +
|
||||||
'</thead>' +
|
'</thead>' +
|
||||||
|
|
|
@ -248,7 +248,7 @@ DOCUMENTATION :: END
|
||||||
<th align="left" id="started">Started</th>
|
<th align="left" id="started">Started</th>
|
||||||
<th align="left" id="paused_counter">Paused</th>
|
<th align="left" id="paused_counter">Paused</th>
|
||||||
<th align="left" id="stopped">Stopped</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>
|
<th align="left" id="percent_complete"></th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
|
|
|
@ -212,7 +212,7 @@ DOCUMENTATION :: END
|
||||||
<th align="left" id="started">Started</th>
|
<th align="left" id="started">Started</th>
|
||||||
<th align="left" id="paused_counter">Paused</th>
|
<th align="left" id="paused_counter">Paused</th>
|
||||||
<th align="left" id="stopped">Stopped</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>
|
<th align="left" id="percent_complete"></th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
|
|
|
@ -308,7 +308,8 @@ class DataFactory(object):
|
||||||
'date': item['date'],
|
'date': item['date'],
|
||||||
'started': item['started'],
|
'started': item['started'],
|
||||||
'stopped': item['stopped'],
|
'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'],
|
'paused_counter': item['paused_counter'],
|
||||||
'user_id': item['user_id'],
|
'user_id': item['user_id'],
|
||||||
'user': item['user'],
|
'user': item['user'],
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue