mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
convert games to new providers
This commit is contained in:
parent
6194dac647
commit
84d3728b86
5 changed files with 376 additions and 234 deletions
|
@ -11,7 +11,11 @@
|
||||||
<div class="content-primary">
|
<div class="content-primary">
|
||||||
<div data-role="controlgroup" data-type="horizontal" class="localnav" data-mini="true">
|
<div data-role="controlgroup" data-type="horizontal" class="localnav" data-mini="true">
|
||||||
<a href="#" data-role="button" class="ui-btn-active">Basics</a>
|
<a href="#" data-role="button" class="ui-btn-active">Basics</a>
|
||||||
<a href="metadataimages.html" data-role="button">More Options</a>
|
<a href="metadataimages.html?type=movies" data-role="button">Movies</a>
|
||||||
|
<a href="metadataimages.html?type=tv" data-role="button">TV</a>
|
||||||
|
<a href="metadataimages.html?type=games" data-role="button">Games</a>
|
||||||
|
<a href="metadataimages.html?type=music" data-role="button">Music</a>
|
||||||
|
<a href="metadataimages.html?type=others" data-role="button">Others</a>
|
||||||
<a href="metadataadvanced.html" data-role="button">Advanced</a>
|
<a href="metadataadvanced.html" data-role="button">Advanced</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -26,6 +30,14 @@
|
||||||
<label for="chkSaveLocal">Save metadata and images within media folders </label>
|
<label for="chkSaveLocal">Save metadata and images within media folders </label>
|
||||||
<div class="fieldDescription">Save downloaded metadata and images into media folders where they can be stored permanently and easily edited.</div>
|
<div class="fieldDescription">Save downloaded metadata and images into media folders where they can be stored permanently and easily edited.</div>
|
||||||
</li>
|
</li>
|
||||||
|
<li>
|
||||||
|
<label for="selectImageSavingConvention">Image saving convention: </label>
|
||||||
|
<select name="selectImageSavingConvention" id="selectImageSavingConvention" data-mini="true">
|
||||||
|
<option value="Compatible">Compatible - MB3/Plex/Xbmc</option>
|
||||||
|
<option value="Legacy">Standard - MB3/MB2</option>
|
||||||
|
</select>
|
||||||
|
<div class="fieldDescription">Media Browser recognizes images from most major media applications. Choosing your downloading convention is useful if you also use other products.</div>
|
||||||
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<label for="selectLanguage">Preferred language: </label>
|
<label for="selectLanguage">Preferred language: </label>
|
||||||
<select name="selectLanguage" id="selectLanguage" data-mini="true" required="required"></select>
|
<select name="selectLanguage" id="selectLanguage" data-mini="true" required="required"></select>
|
||||||
|
|
|
@ -11,7 +11,11 @@
|
||||||
<div class="content-primary">
|
<div class="content-primary">
|
||||||
<div data-role="controlgroup" data-type="horizontal" class="localnav" data-mini="true">
|
<div data-role="controlgroup" data-type="horizontal" class="localnav" data-mini="true">
|
||||||
<a href="metadata.html" data-role="button">Basics</a>
|
<a href="metadata.html" data-role="button">Basics</a>
|
||||||
<a href="metadataimages.html" data-role="button">More Options</a>
|
<a href="metadataimages.html?type=movies" data-role="button">Movies</a>
|
||||||
|
<a href="metadataimages.html?type=tv" data-role="button">TV</a>
|
||||||
|
<a href="metadataimages.html?type=games" data-role="button">Games</a>
|
||||||
|
<a href="metadataimages.html?type=music" data-role="button">Music</a>
|
||||||
|
<a href="metadataimages.html?type=others" data-role="button">Others</a>
|
||||||
<a href="#" data-role="button" class="ui-btn-active">Advanced</a>
|
<a href="#" data-role="button" class="ui-btn-active">Advanced</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
@ -9,175 +9,117 @@
|
||||||
<div data-role="content">
|
<div data-role="content">
|
||||||
|
|
||||||
<div class="content-primary">
|
<div class="content-primary">
|
||||||
<div data-role="controlgroup" data-type="horizontal" class="localnav" data-mini="true">
|
<div data-role="controlgroup" data-type="horizontal" class="localnav" data-mini="true" style="margin-bottom: 20px!important;">
|
||||||
<a href="metadata.html" data-role="button">Basics</a>
|
<a href="metadata.html" data-role="button">Basics</a>
|
||||||
<a href="#" data-role="button" class="ui-btn-active">More Options</a>
|
<a href="metadataimages.html?type=movies" data-role="button" class="categoryTab moviesTab">Movies</a>
|
||||||
|
<a href="metadataimages.html?type=tv" data-role="button" class="categoryTab tvTab">TV</a>
|
||||||
|
<a href="metadataimages.html?type=games" data-role="button" class="categoryTab gamesTab">Games</a>
|
||||||
|
<a href="metadataimages.html?type=music" data-role="button" class="categoryTab musicTab">Music</a>
|
||||||
|
<a href="metadataimages.html?type=others" data-role="button" class="categoryTab othersTab">Others</a>
|
||||||
<a href="metadataadvanced.html" data-role="button">Advanced</a>
|
<a href="metadataadvanced.html" data-role="button">Advanced</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<form id="metadataImagesConfigurationForm">
|
<p>Customize options per media type</p>
|
||||||
<ul data-role="listview" class="ulForm">
|
|
||||||
<li>
|
|
||||||
<label for="selectImageSavingConvention">Image saving convention: </label>
|
|
||||||
<select name="selectImageSavingConvention" id="selectImageSavingConvention" data-mini="true">
|
|
||||||
<option value="Compatible">Compatible - MB3/Plex/Xbmc</option>
|
|
||||||
<option value="Legacy">Standard - MB3/MB2</option>
|
|
||||||
</select>
|
|
||||||
<div class="fieldDescription">Media Browser recognizes images from most major media applications. Choosing your downloading convention is useful if you also use other products.</div>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
<p>Customize options per media type</p>
|
|
||||||
<div data-role="collapsible">
|
|
||||||
<h3>Movies</h3>
|
|
||||||
<div>
|
|
||||||
|
|
||||||
<div style="padding: 1em 0;">
|
|
||||||
<label for="txtMaxMovieBackdrops">Max number of backdrops per item: </label>
|
<div class="tabs">
|
||||||
<input type="number" id="txtMaxMovieBackdrops" name="txtMaxMovieBackdrops" pattern="[0-9]*" required="required" min="1" data-mini="true" />
|
</div>
|
||||||
|
|
||||||
|
<br />
|
||||||
|
<div class="tabContent">
|
||||||
|
<form class="metadataImagesConfigurationForm">
|
||||||
|
|
||||||
|
<div class="metadataReaders" style="margin-bottom: 2em;">
|
||||||
|
</div>
|
||||||
|
<div class="metadataFetchers" style="margin-bottom: 2em;">
|
||||||
|
</div>
|
||||||
|
<div class="metadataSavers" style="margin-bottom: 2em;">
|
||||||
|
</div>
|
||||||
|
<div class="imageFetchers" style="margin-bottom: 2em;">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="backdropFields" style="margin-bottom: 2em; display: none;">
|
||||||
|
<div>
|
||||||
|
<label for="txtMaxBackdrops">Max number of backdrops per item: </label>
|
||||||
|
<input type="number" id="txtMaxBackdrops" name="txtMaxBackdrops" pattern="[0-9]*" required="required" min="1" data-mini="true" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div style="padding: 1em 0;">
|
<div>
|
||||||
<label for="txtMinMovieBackdropDownloadWidth">Minimum backdrop download width: </label>
|
<label for="txtMinBackdropDownloadWidth">Minimum backdrop download width: </label>
|
||||||
<input type="number" id="txtMinMovieBackdropDownloadWidth" name="txtMinMovieBackdropDownloadWidth" pattern="[0-9]*" required="required" min="1" data-mini="true" />
|
<input type="number" id="txtMinBackdropDownloadWidth" name="txtMinBackdropDownloadWidth" pattern="[0-9]*" required="required" min="1" data-mini="true" />
|
||||||
</div>
|
|
||||||
|
|
||||||
<h3>Download Movie Images</h3>
|
|
||||||
<div data-role="controlgroup">
|
|
||||||
<input type="checkbox" data-mini="true" id="chkDownloadMovieArt" name="chkDownloadMovieArt" />
|
|
||||||
<label for="chkDownloadMovieArt">Movie Art</label>
|
|
||||||
|
|
||||||
<input type="checkbox" data-mini="true" id="chkDownloadMovieBackdrops" name="chkDownloadMovieBackdrops" />
|
|
||||||
<label for="chkDownloadMovieBackdrops">Movie Backdrops</label>
|
|
||||||
|
|
||||||
<input type="checkbox" data-mini="true" id="chkDownloadMovieBanner" name="chkDownloadMovieBanner" />
|
|
||||||
<label for="chkDownloadMovieBanner">Movie Banner</label>
|
|
||||||
|
|
||||||
<input type="checkbox" data-mini="true" id="chkDownloadMovieDisc" name="chkDownloadMovieDisc" />
|
|
||||||
<label for="chkDownloadMovieDisc">Movie Disc</label>
|
|
||||||
|
|
||||||
<input type="checkbox" data-mini="true" id="chkDownloadMovieLogo" name="chkDownloadMovieLogo" />
|
|
||||||
<label for="chkDownloadMovieLogo">Movie Logo</label>
|
|
||||||
|
|
||||||
<input type="checkbox" data-mini="true" id="chkDownloadMovieThumb" name="chkDownloadMovieThumb" />
|
|
||||||
<label for="chkDownloadMovieThumb">Movie Thumb</label>
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
<div data-role="collapsible">
|
|
||||||
<h3>TV</h3>
|
|
||||||
<div>
|
|
||||||
|
|
||||||
<div style="padding: 1em 0;">
|
<fieldset data-role="controlgroup" style="border-bottom: 1px solid #ddd;">
|
||||||
<label for="txtMaxTvBackdrops">Max number of backdrops per item: </label>
|
<legend>Fetch Images:</legend>
|
||||||
<input type="number" id="txtMaxTvBackdrops" name="txtMaxTvBackdrops" pattern="[0-9]*" required="required" min="1" data-mini="true" />
|
<div class="imageType" data-imagetype="Primary" style="display: none;">
|
||||||
|
<input type="checkbox" data-mini="true" id="chkDownloadPrimary" name="chkDownloadPrimary" />
|
||||||
|
<label for="chkDownloadPrimary">Primary</label>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div style="padding: 1em 0;">
|
|
||||||
<label for="txtMinTvBackdropDownloadWidth">Minimum backdrop download width: </label>
|
<div class="imageType" data-imagetype="Art" style="display: none;">
|
||||||
<input type="number" id="txtMinTvBackdropDownloadWidth" name="txtMinTvBackdropDownloadWidth" pattern="[0-9]*" required="required" min="1" data-mini="true" />
|
<input type="checkbox" data-mini="true" id="chkDownloadArt" name="chkDownloadArt" />
|
||||||
|
<label for="chkDownloadArt">Art</label>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<h3>Download TV Images</h3>
|
<div class="imageType" data-imagetype="BoxRear" style="display: none;">
|
||||||
|
<input type="checkbox" data-mini="true" id="chkBack" name="chkBack" />
|
||||||
<div data-role="controlgroup">
|
<label for="chkBack">Back</label>
|
||||||
<input type="checkbox" data-mini="true" id="chKDownloadTVArt" name="chKDownloadTVArt" />
|
|
||||||
<label for="chKDownloadTVArt">Series Art</label>
|
|
||||||
|
|
||||||
<input type="checkbox" data-mini="true" id="chkDownloadTVBackdrops" name="chkDownloadTVBackdrops" />
|
|
||||||
<label for="chkDownloadTVBackdrops">Series Backdrops</label>
|
|
||||||
|
|
||||||
<input type="checkbox" data-mini="true" id="chkDownloadTVBanner" name="chkDownloadTVBanner" />
|
|
||||||
<label for="chkDownloadTVBanner">Series Banner</label>
|
|
||||||
|
|
||||||
<input type="checkbox" data-mini="true" id="chkDownloadTVLogo" name="chkDownloadTVLogo" />
|
|
||||||
<label for="chkDownloadTVLogo">Series Logo</label>
|
|
||||||
|
|
||||||
<input type="checkbox" data-mini="true" id="chkDownloadTVThumb" name="chkDownloadTVThumb" />
|
|
||||||
<label for="chkDownloadTVThumb">Series Thumb</label>
|
|
||||||
<input type="checkbox" data-mini="true" id="chkDownloadSeasonBackdrops" name="chkDownloadSeasonBackdrops" />
|
|
||||||
<label for="chkDownloadSeasonBackdrops">Season Backdrops</label>
|
|
||||||
|
|
||||||
<input type="checkbox" data-mini="true" id="chkDownloadSeasonBanner" name="chkDownloadSeasonBanner" />
|
|
||||||
<label for="chkDownloadSeasonBanner">Season Banner</label>
|
|
||||||
|
|
||||||
<input type="checkbox" data-mini="true" id="chkDownloadSeasonThumb" name="chkDownloadSeasonThumb" />
|
|
||||||
<label for="chkDownloadSeasonThumb">Season Thumb</label>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div data-role="collapsible">
|
|
||||||
<h3>Music</h3>
|
|
||||||
<div>
|
|
||||||
|
|
||||||
<div style="padding: 1em 0;">
|
|
||||||
<label for="txtMaxMusicBackdrops">Max number of backdrops per item: </label>
|
|
||||||
<input type="number" id="txtMaxMusicBackdrops" name="txtMaxMusicBackdrops" pattern="[0-9]*" required="required" min="1" data-mini="true" />
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div style="padding: 1em 0;">
|
<div class="imageType" data-imagetype="Banner" style="display: none;">
|
||||||
<label for="txtMinMusicBackdropDownloadWidth">Minimum backdrop download width: </label>
|
<input type="checkbox" data-mini="true" id="chkDownloadBanner" name="chkDownloadBanner" />
|
||||||
<input type="number" id="txtMinMusicBackdropDownloadWidth" name="txtMinMusicBackdropDownloadWidth" pattern="[0-9]*" required="required" min="1" data-mini="true" />
|
<label for="chkDownloadBanner">Banner</label>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<h3>Download Music Images</h3>
|
<div class="imageType" data-imagetype="Box" style="display: none;">
|
||||||
<div data-role="controlgroup">
|
<input type="checkbox" data-mini="true" id="chkDownloadBox" name="chkDownloadBox" />
|
||||||
<input type="checkbox" data-mini="true" id="chkDownloadArtistThumb" name="chkDownloadArtistThumb" />
|
<label for="chkDownloadBox">Box</label>
|
||||||
<label for="chkDownloadArtistThumb">Artist Image</label>
|
|
||||||
|
|
||||||
<input type="checkbox" data-mini="true" id="chkDownloadArtistBackdrops" name="chkDownloadArtistBackdrops" />
|
|
||||||
<label for="chkDownloadArtistBackdrops">Artist Backdrops</label>
|
|
||||||
|
|
||||||
<input type="checkbox" data-mini="true" id="chkDownloadArtistLogo" name="chkDownloadArtistLogo" />
|
|
||||||
<label for="chkDownloadArtistLogo">Artist Logo</label>
|
|
||||||
|
|
||||||
<input type="checkbox" data-mini="true" id="chkDownloadArtistBanner" name="chkDownloadArtistBanner" />
|
|
||||||
<label for="chkDownloadArtistBanner">Artist Banner</label>
|
|
||||||
|
|
||||||
<input type="checkbox" data-mini="true" id="chkDownloadAlbumPrimary" name="chkDownloadAlbumPrimary" />
|
|
||||||
<label for="chkDownloadAlbumPrimary">Album Cover</label>
|
|
||||||
|
|
||||||
<input type="checkbox" data-mini="true" id="chkDownloadAlbumBackdrops" name="chkDownloadAlbumBackdrops" />
|
|
||||||
<label for="chkDownloadAlbumBackdrops">Album Backdrops</label>
|
|
||||||
|
|
||||||
<input type="checkbox" data-mini="true" id="chkMusicAlbumDisc" name="chkMusicAlbumDisc" />
|
|
||||||
<label for="chkMusicAlbumDisc">Album Disc</label>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div data-role="collapsible">
|
|
||||||
<h3>Games</h3>
|
|
||||||
<div>
|
|
||||||
<div style="padding: 1em 0;">
|
|
||||||
<label for="txtMaxGameBackdrops">Max number of backdrops per item: </label>
|
|
||||||
<input type="number" id="txtMaxGameBackdrops" name="txtMaxGameBackdrops" pattern="[0-9]*" required="required" min="1" data-mini="true" />
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div style="padding: 1em 0;">
|
<div class="imageType" data-imagetype="Disc" style="display: none;">
|
||||||
<label for="txtMinGameBackdropDownloadWidth">Minimum backdrop download width: </label>
|
<input type="checkbox" data-mini="true" id="chkDownloadDisc" name="chkDownloadDisc" />
|
||||||
<input type="number" id="txtMinGameBackdropDownloadWidth" name="txtMinGameBackdropDownloadWidth" pattern="[0-9]*" required="required" min="1" data-mini="true" />
|
<label for="chkDownloadDisc">Disc</label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
</div>
|
<div class="imageType" data-imagetype="Logo" style="display: none;">
|
||||||
<br />
|
<input type="checkbox" data-mini="true" id="chkDownloadLogo" name="chkDownloadLogo" />
|
||||||
<ul data-role="listview" class="ulForm">
|
<label for="chkDownloadLogo">Logo</label>
|
||||||
<li>
|
</div>
|
||||||
<button type="submit" data-theme="b" data-icon="check" data-mini="true">
|
|
||||||
Save
|
<div class="imageType" data-imagetype="Menu" style="display: none;">
|
||||||
</button>
|
<input type="checkbox" data-mini="true" id="chkDownloadMenu" name="chkDownloadMenu" />
|
||||||
<button type="button" onclick="Dashboard.navigate('dashboard.html');" data-icon="delete" data-mini="true">
|
<label for="chkDownloadMenu">Menu</label>
|
||||||
Cancel
|
</div>
|
||||||
</button>
|
|
||||||
</li>
|
<div class="imageType" data-imagetype="Thumb" style="display: none;">
|
||||||
</ul>
|
<input type="checkbox" data-mini="true" id="chkDownloadThumb" name="chkDownloadThumb" />
|
||||||
</form>
|
<label for="chkDownloadThumb">Thumb</label>
|
||||||
|
</div>
|
||||||
|
</fieldset>
|
||||||
|
|
||||||
|
<br />
|
||||||
|
<br />
|
||||||
|
<ul data-role="listview" class="ulForm">
|
||||||
|
<li>
|
||||||
|
<button type="submit" data-theme="b" data-icon="check" data-mini="true">
|
||||||
|
Save
|
||||||
|
</button>
|
||||||
|
<button type="button" onclick="Dashboard.navigate('dashboard.html');" data-icon="delete" data-mini="true">
|
||||||
|
Cancel
|
||||||
|
</button>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
$('#metadataImagesConfigurationForm').on('submit', MetadataImagesPage.onSubmit);
|
$('.metadataImagesConfigurationForm').off('submit', MetadataImagesPage.onSubmit).on('submit', MetadataImagesPage.onSubmit);
|
||||||
</script>
|
</script>
|
||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
|
|
|
@ -43,6 +43,8 @@
|
||||||
$('#selectCountry', page).val(config.MetadataCountryCode).selectmenu("refresh");
|
$('#selectCountry', page).val(config.MetadataCountryCode).selectmenu("refresh");
|
||||||
$('#chkEnableInternetProviders', page).checked(config.EnableInternetProviders).checkboxradio("refresh");
|
$('#chkEnableInternetProviders', page).checked(config.EnableInternetProviders).checkboxradio("refresh");
|
||||||
|
|
||||||
|
$('#selectImageSavingConvention', page).val(config.ImageSavingConvention).selectmenu("refresh");
|
||||||
|
|
||||||
Dashboard.hideLoadingMsg();
|
Dashboard.hideLoadingMsg();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -53,6 +55,8 @@
|
||||||
|
|
||||||
ApiClient.getServerConfiguration().done(function (config) {
|
ApiClient.getServerConfiguration().done(function (config) {
|
||||||
|
|
||||||
|
config.ImageSavingConvention = $('#selectImageSavingConvention', form).val();
|
||||||
|
|
||||||
config.EnableInternetProviders = $('#chkEnableInternetProviders', form).checked();
|
config.EnableInternetProviders = $('#chkEnableInternetProviders', form).checked();
|
||||||
config.SaveLocalMeta = $('#chkSaveLocal', form).checked();
|
config.SaveLocalMeta = $('#chkSaveLocal', form).checked();
|
||||||
config.PreferredMetadataLanguage = $('#selectLanguage', form).val();
|
config.PreferredMetadataLanguage = $('#selectLanguage', form).val();
|
||||||
|
|
|
@ -1,117 +1,297 @@
|
||||||
var MetadataImagesPage = {
|
(function ($, document, window) {
|
||||||
|
|
||||||
onPageShow: function () {
|
function loadTabs(page, tabs) {
|
||||||
|
|
||||||
|
var html = '';
|
||||||
|
|
||||||
|
html += '<div data-role="controlgroup" data-type="horizontal" data-mini="true">';
|
||||||
|
|
||||||
|
for (var i = 0, length = tabs.length; i < length; i++) {
|
||||||
|
|
||||||
|
var tab = tabs[i];
|
||||||
|
|
||||||
|
html += '<input type="radio" name="radioTypeTab" class="radioTypeTab" id="' + tab.type + '" value="' + tab.type + '">';
|
||||||
|
html += '<label for="' + tab.type + '">' + tab.name + '</label>';
|
||||||
|
}
|
||||||
|
|
||||||
|
html += '</div>';
|
||||||
|
|
||||||
|
var elem = $('.tabs', page).html(html).trigger('create');
|
||||||
|
|
||||||
|
Dashboard.hideLoadingMsg();
|
||||||
|
|
||||||
|
$('.radioTypeTab', elem).on('change', function () {
|
||||||
|
|
||||||
|
if (this.checked) {
|
||||||
|
|
||||||
|
loadType(page, this.id);
|
||||||
|
}
|
||||||
|
|
||||||
|
})[0].click();
|
||||||
|
}
|
||||||
|
|
||||||
|
function loadType(page, type) {
|
||||||
|
|
||||||
Dashboard.showLoadingMsg();
|
Dashboard.showLoadingMsg();
|
||||||
|
|
||||||
var page = this;
|
var promise1 = ApiClient.getServerConfiguration();
|
||||||
|
var promise2 = $.getJSON(ApiClient.getUrl("System/Configuration/MetadataPlugins"));
|
||||||
|
|
||||||
ApiClient.getServerConfiguration().done(function(result) {
|
$.when(promise1, promise2).done(function (response1, response2) {
|
||||||
MetadataImagesPage.load(page, result);
|
|
||||||
|
renderType(page, type, response1[0], response2[0]);
|
||||||
|
|
||||||
|
Dashboard.hideLoadingMsg();
|
||||||
});
|
});
|
||||||
},
|
|
||||||
|
|
||||||
load: function (page, config) {
|
}
|
||||||
|
|
||||||
// Movie options
|
function renderType(page, type, config, metadataPlugins) {
|
||||||
$('#txtMaxMovieBackdrops', page).val(config.MovieOptions.MaxBackdrops);
|
|
||||||
$('#txtMinMovieBackdropDownloadWidth', page).val(config.MovieOptions.MinBackdropWidth);
|
|
||||||
|
|
||||||
// Tv options
|
|
||||||
$('#txtMaxTvBackdrops', page).val(config.TvOptions.MaxBackdrops);
|
|
||||||
$('#txtMinTvBackdropDownloadWidth', page).val(config.TvOptions.MinBackdropWidth);
|
|
||||||
|
|
||||||
// Music options
|
var metadataInfo = metadataPlugins.filter(function (f) {
|
||||||
$('#txtMaxMusicBackdrops', page).val(config.MusicOptions.MaxBackdrops);
|
|
||||||
$('#txtMinMusicBackdropDownloadWidth', page).val(config.MusicOptions.MinBackdropWidth);
|
|
||||||
|
|
||||||
// Game options
|
return type == f.ItemType;
|
||||||
$('#txtMaxGameBackdrops', page).val(config.GameOptions.MaxBackdrops);
|
})[0];
|
||||||
$('#txtMinGameBackdropDownloadWidth', page).val(config.GameOptions.MinBackdropWidth);
|
|
||||||
|
|
||||||
$('#chkDownloadMovieArt', page).checked(config.DownloadMovieImages.Art).checkboxradio("refresh");
|
if (metadataInfo.SupportedImageTypes.indexOf('Backdrop') == -1) {
|
||||||
$('#chkDownloadMovieBackdrops', page).checked(config.DownloadMovieImages.Backdrops).checkboxradio("refresh");
|
$('.backdropFields', page).hide();
|
||||||
$('#chkDownloadMovieBanner', page).checked(config.DownloadMovieImages.Banner).checkboxradio("refresh");
|
} else {
|
||||||
$('#chkDownloadMovieDisc', page).checked(config.DownloadMovieImages.Disc).checkboxradio("refresh");
|
$('.backdropFields', page).show();
|
||||||
$('#chkDownloadMovieLogo', page).checked(config.DownloadMovieImages.Logo).checkboxradio("refresh");
|
}
|
||||||
$('#chkDownloadMovieThumb', page).checked(config.DownloadMovieImages.Thumb).checkboxradio("refresh");
|
|
||||||
|
|
||||||
$('#chKDownloadTVArt', page).checked(config.DownloadSeriesImages.Art).checkboxradio("refresh");
|
|
||||||
$('#chkDownloadTVBackdrops', page).checked(config.DownloadSeriesImages.Backdrops).checkboxradio("refresh");
|
|
||||||
$('#chkDownloadTVBanner', page).checked(config.DownloadSeriesImages.Banner).checkboxradio("refresh");
|
|
||||||
$('#chkDownloadTVLogo', page).checked(config.DownloadSeriesImages.Logo).checkboxradio("refresh");
|
|
||||||
$('#chkDownloadTVThumb', page).checked(config.DownloadSeriesImages.Thumb).checkboxradio("refresh");
|
|
||||||
|
|
||||||
$('#chkDownloadSeasonBanner', page).checked(config.DownloadSeasonImages.Banner).checkboxradio("refresh");
|
|
||||||
$('#chkDownloadSeasonThumb', page).checked(config.DownloadSeasonImages.Thumb).checkboxradio("refresh");
|
|
||||||
$('#chkDownloadSeasonBackdrops', page).checked(config.DownloadSeasonImages.Backdrops).checkboxradio("refresh");
|
|
||||||
|
|
||||||
$('#chkDownloadArtistThumb', page).checked(config.DownloadMusicArtistImages.Primary).checkboxradio("refresh");
|
|
||||||
$('#chkDownloadArtistBackdrops', page).checked(config.DownloadMusicArtistImages.Backdrops).checkboxradio("refresh");
|
|
||||||
$('#chkDownloadArtistLogo', page).checked(config.DownloadMusicArtistImages.Logo).checkboxradio("refresh");
|
|
||||||
$('#chkDownloadArtistBanner', page).checked(config.DownloadMusicArtistImages.Banner).checkboxradio("refresh");
|
|
||||||
|
|
||||||
$('#chkDownloadAlbumPrimary', page).checked(config.DownloadMusicAlbumImages.Primary).checkboxradio("refresh");
|
$('.imageType', page).each(function () {
|
||||||
$('#chkDownloadAlbumBackdrops', page).checked(config.DownloadMusicAlbumImages.Backdrops).checkboxradio("refresh");
|
|
||||||
$('#chkMusicAlbumDisc', page).checked(config.DownloadMusicAlbumImages.Disc).checkboxradio("refresh");
|
|
||||||
|
|
||||||
$('#selectImageSavingConvention', page).val(config.ImageSavingConvention).selectmenu("refresh");
|
var imageType = this.getAttribute('data-imagetype');
|
||||||
|
|
||||||
Dashboard.hideLoadingMsg();
|
if (metadataInfo.SupportedImageTypes.indexOf(imageType) == -1) {
|
||||||
},
|
$(this).hide();
|
||||||
|
} else {
|
||||||
|
$(this).show();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
renderMetadataLocals(page, type, config, metadataInfo);
|
||||||
|
renderMetadataFetchers(page, type, config, metadataInfo);
|
||||||
|
renderMetadataSavers(page, type, config, metadataInfo);
|
||||||
|
renderImageFetchers(page, type, config, metadataInfo);
|
||||||
|
}
|
||||||
|
|
||||||
|
function renderImageFetchers(page, type, config, metadataInfo) {
|
||||||
|
|
||||||
|
var plugins = metadataInfo.Plugins.filter(function (p) {
|
||||||
|
return p.Type == 'ImageFetcher';
|
||||||
|
});
|
||||||
|
|
||||||
|
var html = '';
|
||||||
|
|
||||||
|
if (!plugins.length) {
|
||||||
|
$('.imageFetchers', page).html(html).hide().trigger('create');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
html += '<fieldset data-role="controlgroup">';
|
||||||
|
html += '<legend>Image Fetchers:</legend>';
|
||||||
|
|
||||||
|
for (var i = 0, length = plugins.length; i < length; i++) {
|
||||||
|
|
||||||
|
var plugin = plugins[i];
|
||||||
|
|
||||||
|
var id = 'chkImageFetcher' + i;
|
||||||
|
|
||||||
|
html += '<input type="checkbox" name="' + id + '" id="' + id + '" data-mini="true">';
|
||||||
|
html += '<label for="' + id + '">' + plugin.Name + '</label>';
|
||||||
|
}
|
||||||
|
|
||||||
|
html += '</fieldset>';
|
||||||
|
|
||||||
|
$('.imageFetchers', page).html(html).show().trigger('create');
|
||||||
|
}
|
||||||
|
|
||||||
|
function renderMetadataSavers(page, type, config, metadataInfo) {
|
||||||
|
|
||||||
|
var plugins = metadataInfo.Plugins.filter(function (p) {
|
||||||
|
return p.Type == 'MetadataSaver';
|
||||||
|
});
|
||||||
|
|
||||||
|
var html = '';
|
||||||
|
|
||||||
|
if (!plugins.length) {
|
||||||
|
$('.metadataSavers', page).html(html).hide().trigger('create');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
html += '<fieldset data-role="controlgroup">';
|
||||||
|
html += '<legend>Metadata Savers:</legend>';
|
||||||
|
|
||||||
|
for (var i = 0, length = plugins.length; i < length; i++) {
|
||||||
|
|
||||||
|
var plugin = plugins[i];
|
||||||
|
|
||||||
|
var id = 'chkMetadataSaver' + i;
|
||||||
|
|
||||||
|
html += '<input type="checkbox" name="' + id + '" id="' + id + '" data-mini="true">';
|
||||||
|
html += '<label for="' + id + '">' + plugin.Name + '</label>';
|
||||||
|
}
|
||||||
|
|
||||||
|
html += '</fieldset>';
|
||||||
|
|
||||||
|
$('.metadataSavers', page).html(html).show().trigger('create');
|
||||||
|
}
|
||||||
|
|
||||||
|
function renderMetadataFetchers(page, type, config, metadataInfo) {
|
||||||
|
|
||||||
|
var plugins = metadataInfo.Plugins.filter(function (p) {
|
||||||
|
return p.Type == 'MetadataFetcher';
|
||||||
|
});
|
||||||
|
|
||||||
|
var html = '';
|
||||||
|
|
||||||
|
if (!plugins.length) {
|
||||||
|
$('.metadataFetchers', page).html(html).hide().trigger('create');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
html += '<fieldset data-role="controlgroup">';
|
||||||
|
html += '<legend>Metadata Fetchers:</legend>';
|
||||||
|
|
||||||
|
for (var i = 0, length = plugins.length; i < length; i++) {
|
||||||
|
|
||||||
|
var plugin = plugins[i];
|
||||||
|
|
||||||
|
var id = 'chkMetadataFetcher' + i;
|
||||||
|
|
||||||
|
html += '<input type="checkbox" name="' + id + '" id="' + id + '" data-mini="true">';
|
||||||
|
html += '<label for="' + id + '">' + plugin.Name + '</label>';
|
||||||
|
}
|
||||||
|
|
||||||
|
html += '</fieldset>';
|
||||||
|
|
||||||
|
$('.metadataFetchers', page).html(html).show().trigger('create');
|
||||||
|
}
|
||||||
|
|
||||||
|
function renderMetadataLocals(page, type, config, metadataInfo) {
|
||||||
|
|
||||||
|
var plugins = metadataInfo.Plugins.filter(function (p) {
|
||||||
|
return p.Type == 'LocalMetadataProvider';
|
||||||
|
});
|
||||||
|
|
||||||
|
var html = '';
|
||||||
|
|
||||||
|
if (!plugins.length) {
|
||||||
|
$('.metadataReaders', page).html(html).hide().trigger('create');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
html += '<fieldset data-role="controlgroup">';
|
||||||
|
html += '<legend>Local Metadata Readers:</legend>';
|
||||||
|
|
||||||
|
for (var i = 0, length = plugins.length; i < length; i++) {
|
||||||
|
|
||||||
|
var plugin = plugins[i];
|
||||||
|
|
||||||
|
var id = 'chkMetadataLocal' + i;
|
||||||
|
|
||||||
|
html += '<input type="checkbox" name="' + id + '" id="' + id + '" data-mini="true">';
|
||||||
|
html += '<label for="' + id + '">' + plugin.Name + '</label>';
|
||||||
|
}
|
||||||
|
|
||||||
|
html += '</fieldset>';
|
||||||
|
|
||||||
|
$('.metadataReaders', page).html(html).show().trigger('create');
|
||||||
|
}
|
||||||
|
|
||||||
|
function loadPage(page) {
|
||||||
|
|
||||||
|
var type = getParameterByName('type');
|
||||||
|
|
||||||
|
$('.categoryTab', page).removeClass('ui-btn-active');
|
||||||
|
|
||||||
|
if (type == 'games') {
|
||||||
|
|
||||||
|
loadTabs(page, [
|
||||||
|
|
||||||
|
{ name: 'Game', type: 'Game' },
|
||||||
|
{ name: 'Game System', type: 'GameSystem' }
|
||||||
|
]);
|
||||||
|
|
||||||
|
$('.gamesTab', page).addClass('ui-btn-active');
|
||||||
|
}
|
||||||
|
else if (type == 'movies') {
|
||||||
|
|
||||||
|
loadTabs(page, [
|
||||||
|
|
||||||
|
{ name: 'Movie', type: 'Movie' },
|
||||||
|
{ name: 'Trailer', type: 'Trailer' },
|
||||||
|
{ name: 'Collection', type: 'BoxSet' }
|
||||||
|
]);
|
||||||
|
|
||||||
|
$('.moviesTab', page).addClass('ui-btn-active');
|
||||||
|
}
|
||||||
|
else if (type == 'tv') {
|
||||||
|
|
||||||
|
loadTabs(page, [
|
||||||
|
|
||||||
|
{ name: 'Series', type: 'Series' },
|
||||||
|
{ name: 'Season', type: 'Season' },
|
||||||
|
{ name: 'Episode', type: 'Episode' }
|
||||||
|
]);
|
||||||
|
|
||||||
|
$('.tvTab', page).addClass('ui-btn-active');
|
||||||
|
}
|
||||||
|
else if (type == 'music') {
|
||||||
|
|
||||||
|
loadTabs(page, [
|
||||||
|
|
||||||
|
{ name: 'Artist', type: 'MusicArtist' },
|
||||||
|
{ name: 'Album', type: 'MusicAlbum' },
|
||||||
|
{ name: 'Song', type: 'Audio' }
|
||||||
|
]);
|
||||||
|
|
||||||
|
$('.musicTab', page).addClass('ui-btn-active');
|
||||||
|
}
|
||||||
|
else if (type == 'others') {
|
||||||
|
|
||||||
|
loadTabs(page, [
|
||||||
|
|
||||||
|
{ name: 'Person', type: 'Person' },
|
||||||
|
{ name: 'Genre', type: 'Genre' },
|
||||||
|
{ name: 'Game Genre', type: 'GameGenre' },
|
||||||
|
{ name: 'Music Genre', type: 'MusicGenre' },
|
||||||
|
{ name: 'Studio', type: 'Studio' },
|
||||||
|
{ name: 'Book', type: 'Book' }
|
||||||
|
]);
|
||||||
|
|
||||||
|
$('.othersTab', page).addClass('ui-btn-active');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function onSubmit() {
|
||||||
|
|
||||||
onSubmit: function () {
|
|
||||||
var form = this;
|
var form = this;
|
||||||
|
|
||||||
Dashboard.showLoadingMsg();
|
Dashboard.showLoadingMsg();
|
||||||
|
|
||||||
ApiClient.getServerConfiguration().done(function (config) {
|
ApiClient.getServerConfiguration().done(function (config) {
|
||||||
|
|
||||||
config.ImageSavingConvention = $('#selectImageSavingConvention', form).val();
|
|
||||||
|
|
||||||
// Movie options
|
|
||||||
config.MovieOptions.MaxBackdrops = $('#txtMaxMovieBackdrops', form).val();
|
|
||||||
config.MovieOptions.MinBackdropWidth = $('#txtMinMovieBackdropDownloadWidth', form).val();
|
|
||||||
config.DownloadMovieImages.Art = $('#chkDownloadMovieArt', form).checked();
|
|
||||||
config.DownloadMovieImages.Backdrops = $('#chkDownloadMovieBackdrops', form).checked();
|
|
||||||
config.DownloadMovieImages.Banner = $('#chkDownloadMovieBanner', form).checked();
|
|
||||||
config.DownloadMovieImages.Disc = $('#chkDownloadMovieDisc', form).checked();
|
|
||||||
config.DownloadMovieImages.Logo = $('#chkDownloadMovieLogo', form).checked();
|
|
||||||
config.DownloadMovieImages.Thumb = $('#chkDownloadMovieThumb', form).checked();
|
|
||||||
|
|
||||||
// Tv options
|
|
||||||
config.TvOptions.MaxBackdrops = $('#txtMaxTvBackdrops', form).val();
|
|
||||||
config.TvOptions.MinBackdropWidth = $('#txtMinTvBackdropDownloadWidth', form).val();
|
|
||||||
config.DownloadSeriesImages.Art = $('#chKDownloadTVArt', form).checked();
|
|
||||||
config.DownloadSeriesImages.Backdrops = $('#chkDownloadMovieBackdrops', form).checked();
|
|
||||||
config.DownloadSeriesImages.Banner = $('#chkDownloadTVBanner', form).checked();
|
|
||||||
config.DownloadSeriesImages.Logo = $('#chkDownloadTVLogo', form).checked();
|
|
||||||
config.DownloadSeriesImages.Thumb = $('#chkDownloadTVThumb', form).checked();
|
|
||||||
config.DownloadSeasonImages.Banner = $('#chkDownloadSeasonBanner', form).checked();
|
|
||||||
config.DownloadSeasonImages.Thumb = $('#chkDownloadSeasonThumb', form).checked();
|
|
||||||
config.DownloadSeasonImages.Backdrops = $('#chkDownloadSeasonBackdrops', form).checked();
|
|
||||||
|
|
||||||
// Music options
|
|
||||||
config.MusicOptions.MaxBackdrops = $('#txtMaxMusicBackdrops', form).val();
|
|
||||||
config.MusicOptions.MinBackdropWidth = $('#txtMinMusicBackdropDownloadWidth', form).val();
|
|
||||||
config.DownloadMusicArtistImages.Backdrops = $('#chkDownloadArtistBackdrops', form).checked();
|
|
||||||
config.DownloadMusicArtistImages.Logo = $('#chkDownloadArtistLogo', form).checked();
|
|
||||||
config.DownloadMusicArtistImages.Primary = $('#chkDownloadArtistThumb', form).checked();
|
|
||||||
config.DownloadMusicArtistImages.Banner = $('#chkDownloadArtistBanner', form).checked();
|
|
||||||
config.DownloadMusicAlbumImages.Primary = $('#chkDownloadAlbumPrimary', form).checked();
|
|
||||||
config.DownloadMusicAlbumImages.Backdrops = $('#chkDownloadAlbumBackdrops', form).checked();
|
|
||||||
config.DownloadMusicAlbumImages.Disc = $('#chkMusicAlbumDisc', form).checked();
|
|
||||||
|
|
||||||
// Game options
|
|
||||||
config.GameOptions.MaxBackdrops = $('#txtMaxGameBackdrops', form).val();
|
|
||||||
config.GameOptions.MinBackdropWidth = $('#txtMinGameBackdropDownloadWidth', form).val();
|
|
||||||
|
|
||||||
ApiClient.updateServerConfiguration(config).done(Dashboard.processServerConfigurationUpdateResult);
|
ApiClient.updateServerConfiguration(config).done(Dashboard.processServerConfigurationUpdateResult);
|
||||||
});
|
});
|
||||||
|
|
||||||
// Disable default form submission
|
// Disable default form submission
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
};
|
|
||||||
|
|
||||||
$(document).on('pageshow', "#metadataImagesConfigurationPage", MetadataImagesPage.onPageShow);
|
$(document).on('pageshow', "#metadataImagesConfigurationPage", function () {
|
||||||
|
|
||||||
|
Dashboard.showLoadingMsg();
|
||||||
|
|
||||||
|
var page = this;
|
||||||
|
|
||||||
|
loadPage(page);
|
||||||
|
});
|
||||||
|
|
||||||
|
window.MetadataImagesPage = {
|
||||||
|
|
||||||
|
onSubmit: onSubmit
|
||||||
|
};
|
||||||
|
|
||||||
|
})(jQuery, document, window);
|
Loading…
Add table
Add a link
Reference in a new issue