From 1809b95e2decad4693d39b60a25904f573292390 Mon Sep 17 00:00:00 2001 From: JonnyWong16 Date: Sun, 17 Jan 2016 16:15:28 -0800 Subject: [PATCH] Add setting to enable calculating total file sizes * Setting is disabled by default --- .../default/images/media_info/576.png | Bin 0 -> 3469 bytes .../default/images/media_info/8ch.png | Bin 0 -> 2109 bytes .../default/js/tables/media_info_table.js | 15 ++--- data/interfaces/default/library.html | 10 +++- data/interfaces/default/library_stats.html | 2 +- data/interfaces/default/settings.html | 12 +++- plexpy/config.py | 3 +- plexpy/libraries.py | 52 +++++++++++------- plexpy/webserve.py | 20 ++++--- 9 files changed, 71 insertions(+), 43 deletions(-) create mode 100644 data/interfaces/default/images/media_info/576.png create mode 100644 data/interfaces/default/images/media_info/8ch.png diff --git a/data/interfaces/default/images/media_info/576.png b/data/interfaces/default/images/media_info/576.png new file mode 100644 index 0000000000000000000000000000000000000000..9871f3f980840b81c4577060a86260f013dc941e GIT binary patch literal 3469 zcma);eP~r>9LLXwY-_kR1S`T!rJ${blxS*@_M%p9E~AKE3}mULwmzT3dF*t&-uZ>kecpc0@A*Bi_q=dx z_mZ0G+0{`L)pQl|%Sc-wS5?99neAJiBe`s4VfkZGRJ&8kUYb{X1;*ER|!Lr?`bfMb->7>&E&pTtP}0^9>eycIUV3Ai*( zPEJNp4R6Em7vUS~uZ9jd3Kz2r^{--61^TXo0r&yVC1|%EW`j0UGA)@-Eon2%0B0Fi zf^4kvkRdgnF59HNzVxGP4|Qy5^f*kw`=H%*a35Ir1pEypRpx9^D|`TUd<1@hbTDTr z9|i|$%Cu38gIZ3y5`F@=cm&#EGk9bkg*QRJ{V)K(!7cCwlvc9r1=2rZ7(513ZbinX zf$}~$15ZPF!dg=0QK*36cP9Bgp#6$eeQ3WR4O?H&bUft8;AH8kUC`&v6y zv2j8(!DHaj+60#@1GQsg(ql2{oe%>3mi#NQ0Zv0PbyI1uuFShBgB*D;*Fl&LYv3ku z=M4O17y%a~$jPL2zRf`G=oY9vc*NNI|V;NTc&+k z(&mK`-|0J`A3g`=h4LcmSO5Ci4O_vneZLRE%^LXVt^seRk9s8rh$etK#fD_U^%VqMQWwd3$q`_ z(uPU?IH^JEub5BUR0ztv3*m+Gf|_rGYFKTc{or4ogWU`Mt)+EkQgG$c&aX-8{rmH! z$m(Y*^wkI+ldSlXi)G*RBFv&}Tu#76cmsy47>9b$pc!^TPy?Ax(9xbGC5dP0)~m0f z*orwZ2Wo*X*a5*VM}ARKK0vAr%p>s(j3i|jChlY74$z_7zY6Ap6KH^^U_KlKI|n(C z6VuT+6qAE)2W?isUEns>!9%bR#^GZ~OMCG`#X-i6Tz#JmpORle9e}sMj|`usKfn(M zpQG@+w37GDvrqQ@3^t~;Irk^sk+b>h40aLb@^EU zUMO$$VR#Mp!hc&p0eLw*yKe7?Q0y{MeO~^J_Q37ndEW@z!2UrVi$*vG6YxKsy8rT} StLm1-_FXr2=ilk#)MX?Z(B#mLk-4uxg8<7RyT|~6dPOx#s+B9i| zSShB9q9DX~BM261q2goHq)_p>KG*Me@4)r4Gg;U@@Xfh%?my?uJ$D{wcaH4nNOh-- zF&%|`ZVbN?I)gANCveto*fnD+OD+_qg?mnX{YJ(WbMR2oK@ zhB*7dBuUJCoXDNaWHN2VV)0lI1RE07YV{G5Sy$kU|Jdm`jE$a=c=DKyA7Y)6j@% z@AQ<;!aleHwFiev{+(rsX%#AD%BmI|jY>nqmAGnA67lmM72$+UOhpWX$;o z=IXB6ZFhRvUu2ND-Ve3viPbdi+#)Hm4cLsg@#=9) z%q^lfbsbdTUQ4puByN!`u`YN6&+U9moL@vAL=~BDNp_ngd{0ztwT->Rf41X#POCi# zOJE9~L9B&E^hxNo%Ga@1)SkX^G#PjRaYg=hDlDQCeeS=)LaoyGNIKn^{zXxyId!BG t7E$0js8tL7H}s-j1U>SvAj-727vR%)u7C8-q2xme3)@F>(?fet{{<2*PDTI# literal 0 HcmV?d00001 diff --git a/data/interfaces/default/js/tables/media_info_table.js b/data/interfaces/default/js/tables/media_info_table.js index 1a746e11..860f06ab 100644 --- a/data/interfaces/default/js/tables/media_info_table.js +++ b/data/interfaces/default/js/tables/media_info_table.js @@ -10,7 +10,6 @@ $.ajax({ } }); -var get_file_sizes = false; var refresh_child_tables = false; media_info_table_options = { @@ -24,7 +23,7 @@ media_info_table_options = { "emptyTable": "No data in table" }, "pagingType": "bootstrap", - "stateSave": true, + "stateSave": false, "processing": false, "serverSide": true, "pageLength": 25, @@ -102,7 +101,7 @@ media_info_table_options = { } } }, - "width": "24%" + "width": "20%" }, { "targets": [2], @@ -112,7 +111,7 @@ media_info_table_options = { $(td).html(cellData); } }, - "width": "5%", + "width": "6%", "className": "no-wrap hidden-sm hidden-xs" }, { @@ -123,7 +122,7 @@ media_info_table_options = { $(td).html(cellData + ' kbps'); } }, - "width": "5%", + "width": "6%", "className": "no-wrap hidden-md hidden-sm hidden-xs", "searchable": false }, @@ -189,7 +188,9 @@ media_info_table_options = { if (cellData !== null && cellData !== '') { $(td).html(Math.round(cellData / Math.pow(1024, 2)).toString() + ' MiB'); } else { - if (rowData['section_type'] != 'photo') { get_file_sizes = true; } + if (rowData['section_type'] != 'photo' && get_file_sizes != null) { + get_file_sizes = true; + } } }, "width": "7%", @@ -375,6 +376,7 @@ function childTableOptionsMedia(rowData) { createChildTableMedia(this, childrowData) } }); + } if (get_file_sizes) { $('#refresh-media-info-table').prop('disabled', true); @@ -395,7 +397,6 @@ function childTableOptionsMedia(rowData) { }); get_file_sizes = false; } - } $(this).closest('div.slider').slideDown(); } diff --git a/data/interfaces/default/library.html b/data/interfaces/default/library.html index 85e253bd..4f75e7fd 100644 --- a/data/interfaces/default/library.html +++ b/data/interfaces/default/library.html @@ -196,7 +196,7 @@ DOCUMENTATION :: END
- % if data['section_id'] in config['get_file_sizes']['section_ids']: + % if config['get_file_sizes'] and data['section_id'] in config['get_file_sizes_hold']['section_ids']:
% else:
- % if data['section_id'] in config['get_file_sizes']['section_ids']: + % if config['get_file_sizes'] and data['section_id'] in config['get_file_sizes_hold']['section_ids']: @@ -316,6 +316,12 @@ DOCUMENTATION :: END % endif var section_name = '${data['section_name'].replace("'", "\\'")}'; var refresh_table = false; + + % if config['get_file_sizes']: + var get_file_sizes = false; + % else: + var get_file_sizes = null; + % endif diff --git a/data/interfaces/default/library_stats.html b/data/interfaces/default/library_stats.html index 5c8a909a..048d5e6f 100644 --- a/data/interfaces/default/library_stats.html +++ b/data/interfaces/default/library_stats.html @@ -89,5 +89,5 @@ DOCUMENTATION :: END % endfor % else: -
No stats to show for the selected period.

+
No stats to show.

% endif \ No newline at end of file diff --git a/data/interfaces/default/settings.html b/data/interfaces/default/settings.html index 94bac875..e7f0f4bd 100644 --- a/data/interfaces/default/settings.html +++ b/data/interfaces/default/settings.html @@ -453,6 +453,13 @@ available_notification_agents = sorted(notifiers.available_notification_agents()

If you have media indexing enabled on your server, use these on the activity pane.

+
+ +

Enable if you want PlexPy to calculate the total file size for TV Shows/Seasons and Artists/Albums on the media info tables.
+ This is currently experimental.

+

PlexWatch Import Tool

@@ -478,9 +485,10 @@ available_notification_agents = sorted(notifiers.available_notification_agents()
-

Instead of polling the server at regular intervals let the server tell us when something happens. This is currently experimental. Encrypted websocket is not currently supported.

+

Instead of polling the server at regular intervals let the server tell us when something happens.
+ This is currently experimental. Encrypted websocket is not currently supported.