Add setting to enable calculating total file sizes

* Setting is disabled by default
This commit is contained in:
JonnyWong16 2016-01-17 16:15:28 -08:00
parent 0d7e261bd1
commit 1809b95e2d
9 changed files with 71 additions and 43 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

View file

@ -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();
}

View file

@ -196,7 +196,7 @@ DOCUMENTATION :: END
<div class="container-fluid">
<div class="row">
<div class="col-md-12">
% 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']:
<div id="get_file_sizes_message" style="text-align: center; margin-top: 20px;">
% else:
<div id="get_file_sizes_message" style="text-align: center; margin-top: 20px; display: none;">
@ -214,7 +214,7 @@ DOCUMENTATION :: END
</span>
</div>
<div class="button-bar">
% 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']:
<button class="btn btn-dark refresh-media-info-table-button" id="refresh-media-info-table" style="margin-right: 5px;" disabled>
<i class="fa fa-refresh"></i> Refresh media info
</button>
@ -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
</script>
<script src="interfaces/default/js/moment-with-locale.js"></script>
<script src="interfaces/default/js/tables/history_table.js"></script>

View file

@ -89,5 +89,5 @@ DOCUMENTATION :: END
% endfor
</ul>
% else:
<div class="text-muted">No stats to show for the selected period.</div><br>
<div class="text-muted">No stats to show.</div><br>
% endif

View file

@ -453,6 +453,13 @@ available_notification_agents = sorted(notifiers.available_notification_agents()
</label>
<p class="help-block">If you have media indexing enabled on your server, use these on the activity pane.</p>
</div>
<div class="checkbox">
<label>
<input type="checkbox" id="get_file_sizes" name="get_file_sizes" value="1" ${config['get_file_sizes']}> Calculate Total File Sizes [experimental]
</label>
<p class="help-block">Enable if you want PlexPy to calculate the total file size for TV Shows/Seasons and Artists/Albums on the media info tables.<br />
This is currently experimental.</p>
</div>
<div class="padded-header">
<h3>PlexWatch Import Tool</h3>
@ -478,9 +485,10 @@ available_notification_agents = sorted(notifiers.available_notification_agents()
</div>
<div class="checkbox">
<label>
<input type="checkbox" class="monitor-settings" id="monitoring_use_websocket" name="monitoring_use_websocket" value="1" ${config['monitoring_use_websocket']}> Use Websocket (requires restart)
<input type="checkbox" class="monitor-settings" id="monitoring_use_websocket" name="monitoring_use_websocket" value="1" ${config['monitoring_use_websocket']}> Use Websocket (requires restart) [experimental]
</label>
<p class="help-block">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.</p>
<p class="help-block">Instead of polling the server at regular intervals let the server tell us when something happens.<br />
This is currently experimental. Encrypted websocket is not currently supported.</p>
</div>
<div class="checkbox">
<label>