From 672835e2ac0de571d05b53633fd636b2a21b2520 Mon Sep 17 00:00:00 2001 From: herby2212 <12448284+herby2212@users.noreply.github.com> Date: Sun, 29 Oct 2023 17:35:27 +0100 Subject: [PATCH] duration for items in media info --- .../default/js/tables/media_info_table.js | 19 ++++++++++++++++++- data/interfaces/default/library.html | 1 + plexpy/pmsconnect.py | 2 +- plexpy/webserve.py | 1 + 4 files changed, 21 insertions(+), 2 deletions(-) diff --git a/data/interfaces/default/js/tables/media_info_table.js b/data/interfaces/default/js/tables/media_info_table.js index f4d80d53..cf020c2f 100644 --- a/data/interfaces/default/js/tables/media_info_table.js +++ b/data/interfaces/default/js/tables/media_info_table.js @@ -224,6 +224,22 @@ media_info_table_options = { }, { "targets": [10], + "data": "duration", + "createdCell": function (td, cellData, rowData, row, col) { + if (cellData !== null && cellData !== '') { + $(td).html(humanDuration(cellData)); + } else { + if (rowData['section_type'] != 'photo' && get_file_sizes != null) { + get_file_sizes = true; + } + } + }, + "width": "7%", + "className": "no-wrap", + "searchable": false + }, + { + "targets": [11], "data": "last_played", "createdCell": function (td, cellData, rowData, row, col) { if (cellData !== null && cellData !== '') { @@ -236,7 +252,7 @@ media_info_table_options = { "searchable": false }, { - "targets": [11], + "targets": [12], "data": "play_count", "createdCell": function (td, cellData, rowData, row, col) { if (cellData !== null && cellData !== '') { @@ -457,6 +473,7 @@ function childTableFormatMedia(rowData) { '