add additional metadata config tab

This commit is contained in:
Luke Pulverenti 2013-12-17 23:39:44 -05:00
parent 121d1de0af
commit 02cd0a7b6f
8 changed files with 111 additions and 45 deletions

View File

@ -11,21 +11,28 @@
<div class="content-primary">
<div data-role="controlgroup" data-type="horizontal" class="localnav" data-mini="true">
<a href="metadata.html" data-role="button">Basics</a>
<a href="metadataimages.html" data-role="button">Images</a>
<a href="metadataimages.html" data-role="button">Image Downloading</a>
<a href="metadataimageextraction.html" data-role="button">Image Extraction</a>
<a href="advancedmetadata.html" data-role="button" class="ui-btn-active">Advanced</a>
</div>
<form id="advancedMetadataConfigurationForm">
<ul data-role="listview" class="ulForm">
<li>
<label>Disable internet providers for:</label>
<div id="divItemTypes"></div>
<input type="checkbox" id="chkEnableTmdbPersonUpdates" name="chkEnableTmdbPersonUpdates" data-mini="true" />
<label for="chkEnableTmdbPersonUpdates">Enable automatic updates from TheMovieDB.org</label>
<div class="fieldDescription">If enabled, movies and people will be updated automatically as they are updated on the TheMovieDB.org.</div>
</li>
<li>
<button type="submit" data-theme="b" data-icon="ok">
<input type="checkbox" id="chkEnableTvdbUpdates" name="chkEnableTvdbUpdates" data-mini="true" />
<label for="chkEnableTvdbUpdates">Enable automatic updates from TheTVDB.com</label>
<div class="fieldDescription">If enabled, tv series and episodes will be updated automatically as they are updated on the TheTVDB.com.</div>
</li>
<li>
<button type="submit" data-theme="b" data-icon="ok" data-mini="true">
Save
</button>
<button type="button" onclick="Dashboard.navigate('dashboard.html');" data-icon="delete">
<button type="button" onclick="Dashboard.navigate('dashboard.html');" data-icon="delete" data-mini="true">
Cancel
</button>
</li>

View File

@ -11,7 +11,8 @@
<div class="content-primary">
<div data-role="controlgroup" data-type="horizontal" class="localnav" data-mini="true">
<a href="metadata.html" data-role="button" class="ui-btn-active">Basics</a>
<a href="metadataimages.html" data-role="button">Images</a>
<a href="metadataimages.html" data-role="button">Image Downloading</a>
<a href="metadataimageextraction.html" data-role="button">Image Extraction</a>
<a href="advancedmetadata.html" data-role="button">Advanced</a>
</div>
@ -33,16 +34,6 @@
<label for="selectCountry">Country: </label>
<select name="selectCountry" id="selectCountry" data-mini="true"></select>
</li>
<li>
<input type="checkbox" id="chkEnableTmdbPersonUpdates" name="chkEnableTmdbPersonUpdates" data-mini="true" />
<label for="chkEnableTmdbPersonUpdates">Enable automatic updates from TheMovieDB.org</label>
<div class="fieldDescription">If enabled, movies and people will be updated automatically as they are updated on the TheMovieDB.org.</div>
</li>
<li>
<input type="checkbox" id="chkEnableTvdbUpdates" name="chkEnableTvdbUpdates" data-mini="true" />
<label for="chkEnableTvdbUpdates">Enable automatic updates from TheTVDB.com</label>
<div class="fieldDescription">If enabled, tv series and episodes will be updated automatically as they are updated on the TheTVDB.com.</div>
</li>
<li>
<button type="submit" data-theme="b" data-icon="ok" data-mini="true">
Save

View File

@ -0,0 +1,45 @@
<!DOCTYPE html>
<html>
<head>
<title>Metadata</title>
</head>
<body>
<div id="metadataImageExtractionPage" data-role="page" class="page type-interior">
<div data-role="content">
<div class="content-primary">
<div data-role="controlgroup" data-type="horizontal" class="localnav" data-mini="true">
<a href="metadata.html" data-role="button">Basics</a>
<a href="metadataimages.html" data-role="button" class="ui-btn-active">Image Downloading</a>
<a href="metadataimageextraction.html" data-role="button">Image Extraction</a>
<a href="advancedmetadata.html" data-role="button">Advanced</a>
</div>
<form id="metadataImageExtractionForm">
<ul data-role="listview" class="ulForm">
<li>
<label for="chkVIdeoImages">Enable video image extraction</label>
<input id="chkVIdeoImages" name="chkVIdeoImages" type="checkbox" checked="checked" data-mini="true" />
<div class="fieldDescription">For videos that don't already have images, and that we're uanble to find internet images for. This will add some additional time to the initial library scan but will result in a more pleasing presentation.</div>
</li>
<li>
<button type="submit" data-theme="b" data-icon="ok">
Save
</button>
<button type="button" onclick="Dashboard.navigate('dashboard.html');" data-icon="delete">
Cancel
</button>
</li>
</ul>
</form>
</div>
</div>
<script type="text/javascript">
$('#metadataImageExtractionForm').on('submit', MetadataImageExtractionPage.onSubmit);
</script>
</div>
</body>
</html>

View File

@ -11,7 +11,8 @@
<div class="content-primary">
<div data-role="controlgroup" data-type="horizontal" class="localnav" data-mini="true">
<a href="metadata.html" data-role="button">Basics</a>
<a href="metadataimages.html" data-role="button" class="ui-btn-active">Images</a>
<a href="metadataimages.html" data-role="button" class="ui-btn-active">Image Downloading</a>
<a href="metadataimageextraction.html" data-role="button">Image Extraction</a>
<a href="advancedmetadata.html" data-role="button">Advanced</a>
</div>
@ -19,7 +20,7 @@
<ul data-role="listview" class="ulForm">
<li>
<label for="selectImageSavingConvention">Image saving convention: </label>
<select name="selectImageSavingConvention" id="selectImageSavingConvention">
<select name="selectImageSavingConvention" id="selectImageSavingConvention" data-mini="true">
<option value="Compatible">Compatible - MB3/Plex/Xbmc</option>
<option value="Legacy">Standard - MB3/MB2</option>
</select>
@ -27,15 +28,15 @@
</li>
<li>
<label for="txtNumbackdrops">Max number of backdrops per item: </label>
<input type="number" id="txtNumbackdrops" name="txtNumbackdrops" pattern="[0-9]*" required="required" min="1" />
<input type="number" id="txtNumbackdrops" name="txtNumbackdrops" pattern="[0-9]*" required="required" min="1" data-mini="true" />
</li>
<li>
<label for="txtMinMovieBackdropDownloadWidth">Minimum movie backdrop download width: </label>
<input type="number" id="txtMinMovieBackdropDownloadWidth" name="txtMinMovieBackdropDownloadWidth" pattern="[0-9]*" required="required" min="1" />
<input type="number" id="txtMinMovieBackdropDownloadWidth" name="txtMinMovieBackdropDownloadWidth" pattern="[0-9]*" required="required" min="1" data-mini="true" />
</li>
<li>
<label for="txtMinSeriesBackdropDownloadWidth">Minimum tv series backdrop download width: </label>
<input type="number" id="txtMinSeriesBackdropDownloadWidth" name="txtMinSeriesBackdropDownloadWidth" pattern="[0-9]*" required="required" min="1" />
<input type="number" id="txtMinSeriesBackdropDownloadWidth" name="txtMinSeriesBackdropDownloadWidth" pattern="[0-9]*" required="required" min="1" data-mini="true" />
</li>
</ul>
<p>Enable additional image downloading:</p>
@ -133,11 +134,6 @@
</div>
<br />
<ul data-role="listview" class="ulForm">
<li>
<label for="chkVIdeoImages">Enable video image extraction</label>
<input id="chkVIdeoImages" name="chkVIdeoImages" type="checkbox" checked="checked" />
<div class="fieldDescription">For videos that don't already have images, and that we're uanble to find internet images for. This will add some additional time to the initial library scan but will result in a more pleasing presentation.</div>
</li>
<li>
<button type="submit" data-theme="b" data-icon="ok">
Save

View File

@ -6,19 +6,18 @@
var page = this;
var promise1 = ApiClient.getServerConfiguration();
var promise2 = ApiClient.getItemTypes({ HasInternetProvider: true });
ApiClient.getServerConfiguration().done(function (configuration) {
$.when(promise1, promise2).done(function (response1, response2) {
AdvancedMetadataConfigurationPage.load(page, response1[0], response2[0]);
AdvancedMetadataConfigurationPage.load(page, configuration);
});
},
load: function (page, config, itemTypes) {
load: function (page, config) {
$('#chkEnableTmdbPersonUpdates', page).checked(config.EnableTmdbUpdates).checkboxradio("refresh");
$('#chkEnableTvdbUpdates', page).checked(config.EnableTvDbUpdates).checkboxradio("refresh");
AdvancedMetadataConfigurationPage.loadItemTypes(page, config, itemTypes);
Dashboard.hideLoadingMsg();
},
@ -49,10 +48,8 @@
ApiClient.getServerConfiguration().done(function (config) {
config.InternetProviderExcludeTypes = $.map($('.chkItemType:checked', form), function (currentCheckbox) {
return currentCheckbox.getAttribute('data-itemtype');
});
config.EnableTvDbUpdates = $('#chkEnableTvdbUpdates', form).checked();
config.EnableTmdbUpdates = $('#chkEnableTmdbPersonUpdates', form).checked();
ApiClient.updateServerConfiguration(config).done(Dashboard.processServerConfigurationUpdateResult);
});

View File

@ -42,8 +42,6 @@
$('#selectLanguage', page).val(config.PreferredMetadataLanguage).selectmenu("refresh");
$('#selectCountry', page).val(config.MetadataCountryCode).selectmenu("refresh");
$('#chkEnableInternetProviders', page).checked(config.EnableInternetProviders).checkboxradio("refresh");
$('#chkEnableTmdbPersonUpdates', page).checked(config.EnableTmdbUpdates).checkboxradio("refresh");
$('#chkEnableTvdbUpdates', page).checked(config.EnableTvDbUpdates).checkboxradio("refresh");
Dashboard.hideLoadingMsg();
},
@ -87,12 +85,10 @@
ApiClient.getServerConfiguration().done(function (config) {
config.EnableTmdbUpdates = $('#chkEnableTmdbPersonUpdates', form).checked();
config.EnableInternetProviders = $('#chkEnableInternetProviders', form).checked();
config.SaveLocalMeta = $('#chkSaveLocal', form).checked();
config.PreferredMetadataLanguage = $('#selectLanguage', form).val();
config.MetadataCountryCode = $('#selectCountry', form).val();
config.EnableTvDbUpdates = $('#chkEnableTvdbUpdates', form).checked();
ApiClient.updateServerConfiguration(config).done(Dashboard.processServerConfigurationUpdateResult);
});

View File

@ -0,0 +1,38 @@
var MetadataImageExtractionPage = {
onPageShow: function () {
Dashboard.showLoadingMsg();
var page = this;
ApiClient.getServerConfiguration().done(function (result) {
MetadataImageExtractionPage.load(page, result);
});
},
load: function (page, config) {
$('#chkVIdeoImages', page).checked(config.EnableVideoImageExtraction).checkboxradio("refresh");
Dashboard.hideLoadingMsg();
},
onSubmit: function () {
var form = this;
Dashboard.showLoadingMsg();
ApiClient.getServerConfiguration().done(function (config) {
config.EnableVideoImageExtraction = $('#chkVIdeoImages', form).checked();
ApiClient.updateServerConfiguration(config).done(Dashboard.processServerConfigurationUpdateResult);
});
// Disable default form submission
return false;
}
};
$(document).on('pageshow', "#metadataImageExtractionPage", MetadataImageExtractionPage.onPageShow);

View File

@ -43,8 +43,6 @@
$('#chkDownloadAlbumBackdrops', page).checked(config.DownloadMusicAlbumImages.Backdrops).checkboxradio("refresh");
$('#chkMusicAlbumDisc', page).checked(config.DownloadMusicAlbumImages.Disc).checkboxradio("refresh");
$('#chkVIdeoImages', page).checked(config.EnableVideoImageExtraction).checkboxradio("refresh");
$('#selectImageSavingConvention', page).val(config.ImageSavingConvention).selectmenu("refresh");
Dashboard.hideLoadingMsg();
@ -89,8 +87,6 @@
config.DownloadMusicAlbumImages.Backdrops = $('#chkDownloadAlbumBackdrops', form).checked();
config.DownloadMusicAlbumImages.Disc = $('#chkMusicAlbumDisc', form).checked();
config.EnableVideoImageExtraction = $('#chkVIdeoImages', form).checked();
ApiClient.updateServerConfiguration(config).done(Dashboard.processServerConfigurationUpdateResult);
});