From 40fbc55ab3511ec4d0894f42736de3f4a173d6ac Mon Sep 17 00:00:00 2001 From: JonnyWong16 <9099342+JonnyWong16@users.noreply.github.com> Date: Mon, 3 Aug 2020 21:28:13 -0700 Subject: [PATCH] Add file size to export table --- .../default/js/tables/export_table.js | 41 ++++++++++++------- data/interfaces/default/library.html | 3 +- plexpy/__init__.py | 2 +- plexpy/exporter.py | 15 ++++--- 4 files changed, 39 insertions(+), 22 deletions(-) diff --git a/data/interfaces/default/js/tables/export_table.js b/data/interfaces/default/js/tables/export_table.js index 9657f87b..f5a173e0 100644 --- a/data/interfaces/default/js/tables/export_table.js +++ b/data/interfaces/default/js/tables/export_table.js @@ -61,22 +61,11 @@ export_table_options = { $(td).html('' + cellData + ''); } }, - "width": "8%", + "width": "6%", "className": "no-wrap" }, { "targets": [3], - "data": "file_format", - "createdCell": function (td, cellData, rowData, row, col) { - if (cellData !== '') { - $(td).html(cellData); - } - }, - "width": "8%", - "className": "no-wrap" - }, - { - "targets": [4], "data": "filename", "createdCell": function (td, cellData, rowData, row, col) { if (cellData !== '') { @@ -86,8 +75,30 @@ export_table_options = { "width": "50%", "className": "no-wrap" }, + { + "targets": [4], + "data": "file_format", + "createdCell": function (td, cellData, rowData, row, col) { + if (cellData !== '') { + $(td).html(cellData); + } + }, + "width": "6%", + "className": "no-wrap" + }, { "targets": [5], + "data": "file_size", + "createdCell": function (td, cellData, rowData, row, col) { + if (cellData !== '' && cellData !== null) { + $(td).html(humanFileSize(cellData)); + } + }, + "width": "6%", + "className": "no-wrap" + }, + { + "targets": [6], "data": "complete", "createdCell": function (td, cellData, rowData, row, col) { if (cellData === 1 && rowData['exists']) { @@ -100,11 +111,11 @@ export_table_options = { $(td).html(' Not Found'); } }, - "width": "8%", + "width": "7%", "className": "export_download" }, { - "targets": [6], + "targets": [7], "data": null, "createdCell": function (td, cellData, rowData, row, col) { if (rowData['complete'] !== 0) { @@ -113,7 +124,7 @@ export_table_options = { $(td).html(' Delete'); } }, - "width": "8%", + "width": "7%", "className": "export_delete" } ], diff --git a/data/interfaces/default/library.html b/data/interfaces/default/library.html index 54a08851..ee7c1681 100644 --- a/data/interfaces/default/library.html +++ b/data/interfaces/default/library.html @@ -342,8 +342,9 @@ DOCUMENTATION :: END