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) {
'
Audio Codec | ' +
'Audio Channels | ' +
'File Size | ' +
+ 'Duration | ' +
'Last Played | ' +
'Total Plays | ' +
'' +
diff --git a/data/interfaces/default/library.html b/data/interfaces/default/library.html
index bfdcb79d..94064523 100644
--- a/data/interfaces/default/library.html
+++ b/data/interfaces/default/library.html
@@ -318,6 +318,7 @@ DOCUMENTATION :: END
Audio Codec |
Audio Channels |
File Size |
+ Duration |
Last Played |
Total Plays |
diff --git a/plexpy/pmsconnect.py b/plexpy/pmsconnect.py
index 90de5c89..e0138799 100644
--- a/plexpy/pmsconnect.py
+++ b/plexpy/pmsconnect.py
@@ -2806,7 +2806,7 @@ class PmsConnect(object):
'parent_thumb': helpers.get_xml_attr(item, 'thumb'),
'grandparent_thumb': helpers.get_xml_attr(item, 'grandparentThumb'),
'added_at': helpers.get_xml_attr(item, 'addedAt'),
- 'duration': helpers.get_xml_attr(item, 'duration') if section_type == 'movie' else 0
+ 'duration': helpers.get_xml_attr(item, 'duration') if section_type in ('movie', 'episode', 'track') else 0
}
if get_media_info:
diff --git a/plexpy/webserve.py b/plexpy/webserve.py
index 4707e78a..833a8d9b 100644
--- a/plexpy/webserve.py
+++ b/plexpy/webserve.py
@@ -881,6 +881,7 @@ class WebInterface(object):
("video_framerate", True, True),
("audio_codec", True, True),
("audio_channels", True, True),
+ ("duration", True, False),
("file_size", True, False),
("last_played", True, False),
("play_count", True, False)]