jellyfin-web/dashboard-ui/scripts/metadataimagespage.js

96 lines
5.6 KiB
JavaScript
Raw Normal View History

2013-02-20 18:33:05 -07:00
var MetadataImagesPage = {
onPageShow: function () {
Dashboard.showLoadingMsg();
var page = this;
ApiClient.getServerConfiguration().done(function(result) {
MetadataImagesPage.load(page, result);
});
},
load: function (page, config) {
$('#chkRefreshItemImages', page).checked(!config.RefreshItemImages).checkboxradio("refresh");
2013-02-20 18:33:05 -07:00
$('#txtNumbackdrops', page).val(config.MaxBackdrops);
2013-03-04 09:59:35 -07:00
$('#chkDownloadMovieArt', page).checked(config.DownloadMovieImages.Art).checkboxradio("refresh");
2013-05-12 15:57:51 -07:00
$('#chkDownloadMovieBackdrops', page).checked(config.DownloadMovieImages.Backdrops).checkboxradio("refresh");
2013-03-04 09:59:35 -07:00
$('#chkDownloadMovieBanner', page).checked(config.DownloadMovieImages.Banner).checkboxradio("refresh");
$('#chkDownloadMovieDisc', page).checked(config.DownloadMovieImages.Disc).checkboxradio("refresh");
$('#chkDownloadMovieLogo', page).checked(config.DownloadMovieImages.Logo).checkboxradio("refresh");
$('#chkDownloadMovieThumb', page).checked(config.DownloadMovieImages.Thumb).checkboxradio("refresh");
2013-05-12 15:57:51 -07:00
2013-03-04 09:59:35 -07:00
$('#chKDownloadTVArt', page).checked(config.DownloadSeriesImages.Art).checkboxradio("refresh");
2013-05-12 15:57:51 -07:00
$('#chkDownloadTVBackdrops', page).checked(config.DownloadSeriesImages.Backdrops).checkboxradio("refresh");
2013-03-04 09:59:35 -07:00
$('#chkDownloadTVBanner', page).checked(config.DownloadSeriesImages.Banner).checkboxradio("refresh");
$('#chkDownloadTVLogo', page).checked(config.DownloadSeriesImages.Logo).checkboxradio("refresh");
$('#chkDownloadTVThumb', page).checked(config.DownloadSeriesImages.Thumb).checkboxradio("refresh");
2013-05-12 15:57:51 -07:00
2013-03-04 09:59:35 -07:00
$('#chkDownloadSeasonBanner', page).checked(config.DownloadSeasonImages.Banner).checkboxradio("refresh");
$('#chkDownloadSeasonThumb', page).checked(config.DownloadSeasonImages.Thumb).checkboxradio("refresh");
$('#chkDownloadSeasonBackdrops', page).checked(config.DownloadSeasonImages.Backdrops).checkboxradio("refresh");
2013-05-12 06:13:57 -07:00
$('#chkDownloadArtistThumb', page).checked(config.DownloadMusicArtistImages.Primary).checkboxradio("refresh");
2013-03-04 09:59:35 -07:00
$('#chkDownloadArtistBackdrops', page).checked(config.DownloadMusicArtistImages.Backdrops).checkboxradio("refresh");
$('#chkDownloadArtistLogo', page).checked(config.DownloadMusicArtistImages.Logo).checkboxradio("refresh");
$('#chkDownloadArtistBanner', page).checked(config.DownloadMusicArtistImages.Banner).checkboxradio("refresh");
2013-05-01 09:06:57 -07:00
2013-03-04 09:59:35 -07:00
$('#chkDownloadAlbumPrimary', page).checked(config.DownloadMusicAlbumImages.Primary).checkboxradio("refresh");
$('#chkDownloadAlbumBackdrops', page).checked(config.DownloadMusicAlbumImages.Backdrops).checkboxradio("refresh");
2013-05-01 09:06:57 -07:00
$('#chkMusicAlbumDisc', page).checked(config.DownloadMusicAlbumImages.Disc).checkboxradio("refresh");
2013-02-20 18:33:05 -07:00
$('#chkVIdeoImages', page).checked(config.EnableVideoImageExtraction).checkboxradio("refresh");
2013-02-20 18:33:05 -07:00
Dashboard.hideLoadingMsg();
},
onSubmit: function () {
var form = this;
2013-04-16 21:58:32 -07:00
Dashboard.showLoadingMsg();
2013-02-20 18:33:05 -07:00
ApiClient.getServerConfiguration().done(function (config) {
config.RefreshItemImages = !$('#chkRefreshItemImages', form).checked();
2013-02-20 18:33:05 -07:00
config.MaxBackdrops = $('#txtNumbackdrops', form).val();
2013-03-04 09:59:35 -07:00
config.DownloadMovieImages.Art = $('#chkDownloadMovieArt', form).checked();
2013-05-12 15:57:51 -07:00
config.DownloadMovieImages.Backdrops = $('#chkDownloadMovieBackdrops', form).checked();
2013-03-04 09:59:35 -07:00
config.DownloadMovieImages.Banner = $('#chkDownloadMovieBanner', form).checked();
config.DownloadMovieImages.Disc = $('#chkDownloadMovieDisc', form).checked();
config.DownloadMovieImages.Logo = $('#chkDownloadMovieLogo', form).checked();
config.DownloadMovieImages.Thumb = $('#chkDownloadMovieThumb', form).checked();
2013-05-12 15:57:51 -07:00
2013-03-04 09:59:35 -07:00
config.DownloadSeriesImages.Art = $('#chKDownloadTVArt', form).checked();
2013-05-12 15:57:51 -07:00
config.DownloadSeriesImages.Backdrops = $('#chkDownloadMovieBackdrops', form).checked();
2013-03-04 09:59:35 -07:00
config.DownloadSeriesImages.Banner = $('#chkDownloadTVBanner', form).checked();
config.DownloadSeriesImages.Logo = $('#chkDownloadTVLogo', form).checked();
config.DownloadSeriesImages.Thumb = $('#chkDownloadTVThumb', form).checked();
2013-05-12 15:57:51 -07:00
2013-03-04 09:59:35 -07:00
config.DownloadSeasonImages.Banner = $('#chkDownloadSeasonBanner', form).checked();
config.DownloadSeasonImages.Thumb = $('#chkDownloadSeasonThumb', form).checked();
config.DownloadSeasonImages.Backdrops = $('#chkDownloadSeasonBackdrops', form).checked();
2013-05-12 06:13:57 -07:00
2013-03-04 09:59:35 -07:00
config.DownloadMusicArtistImages.Backdrops = $('#chkDownloadArtistBackdrops', form).checked();
config.DownloadMusicArtistImages.Logo = $('#chkDownloadArtistLogo', form).checked();
2013-05-12 06:13:57 -07:00
config.DownloadMusicArtistImages.Primary = $('#chkDownloadArtistThumb', form).checked();
2013-03-04 09:59:35 -07:00
config.DownloadMusicArtistImages.Banner = $('#chkDownloadArtistBanner', form).checked();
2013-05-01 09:06:57 -07:00
2013-03-04 09:59:35 -07:00
config.DownloadMusicAlbumImages.Primary = $('#chkDownloadAlbumPrimary', form).checked();
config.DownloadMusicAlbumImages.Backdrops = $('#chkDownloadAlbumBackdrops', form).checked();
2013-05-01 09:06:57 -07:00
config.DownloadMusicAlbumImages.Disc = $('#chkMusicAlbumDisc', form).checked();
2013-02-20 18:33:05 -07:00
config.EnableVideoImageExtraction = $('#chkVIdeoImages', form).checked();
2013-04-16 21:58:32 -07:00
ApiClient.updateServerConfiguration(config).done(Dashboard.processServerConfigurationUpdateResult);
2013-02-20 18:33:05 -07:00
});
// Disable default form submission
return false;
}
};
$(document).on('pageshow', "#metadataImagesConfigurationPage", MetadataImagesPage.onPageShow);