1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

make chapter images a per-library setting

This commit is contained in:
Luke Pulverenti 2016-08-29 17:06:24 -04:00
parent fc63d39e27
commit 0659c5bdc1
6 changed files with 41 additions and 61 deletions

View file

@ -38,6 +38,14 @@
} else { } else {
parent.querySelector('.chkEnablePhotosContainer').classList.add('hide'); parent.querySelector('.chkEnablePhotosContainer').classList.add('hide');
} }
if (contentType == 'tvshows' || contentType == 'movies' || contentType == 'homevideos' || contentType == 'musicvideos' || contentType == 'mixed' || !contentType) {
parent.querySelector('.fldExtractChaptersDuringLibraryScan').classList.remove('hide');
parent.querySelector('.fldExtractChapterImages').classList.remove('hide');
} else {
parent.querySelector('.fldExtractChaptersDuringLibraryScan').classList.add('hide');
parent.querySelector('.fldExtractChapterImages').classList.add('hide');
}
} }
function getLibraryOptions(parent) { function getLibraryOptions(parent) {
@ -45,7 +53,9 @@
var options = { var options = {
EnableArchiveMediaFiles: parent.querySelector('.chkArhiveAsMedia').checked, EnableArchiveMediaFiles: parent.querySelector('.chkArhiveAsMedia').checked,
EnablePhotos: parent.querySelector('.chkEnablePhotos').checked, EnablePhotos: parent.querySelector('.chkEnablePhotos').checked,
EnableRealtimeMonitor: parent.querySelector('.chkEnableRealtimeMonitor').checked EnableRealtimeMonitor: parent.querySelector('.chkEnableRealtimeMonitor').checked,
ExtractChapterImagesDuringLibraryScan: parent.querySelector('.chkExtractChaptersDuringLibraryScan').checked,
EnableChapterImageExtraction: parent.querySelector('.chkExtractChapterImages').checked
}; };
return options; return options;
@ -56,6 +66,8 @@
parent.querySelector('.chkArhiveAsMedia').checked = options.EnableArchiveMediaFiles; parent.querySelector('.chkArhiveAsMedia').checked = options.EnableArchiveMediaFiles;
parent.querySelector('.chkEnablePhotos').checked = options.EnablePhotos; parent.querySelector('.chkEnablePhotos').checked = options.EnablePhotos;
parent.querySelector('.chkEnableRealtimeMonitor').checked = options.EnableRealtimeMonitor; parent.querySelector('.chkEnableRealtimeMonitor').checked = options.EnableRealtimeMonitor;
parent.querySelector('.chkExtractChaptersDuringLibraryScan').checked = options.ExtractChapterImagesDuringLibraryScan;
parent.querySelector('.chkExtractChapterImages').checked = options.EnableChapterImageExtraction;
} }
return { return {

View file

@ -8,12 +8,28 @@
</div> </div>
<div class="checkboxContainer checkboxContainer-withDescription"> <div class="checkboxContainer checkboxContainer-withDescription">
<label> <label>
<input type="checkbox" is="emby-checkbox" class="chkEnableRealtimeMonitor" /> <input type="checkbox" is="emby-checkbox" class="chkEnableRealtimeMonitor"/>
<span>${LabelEnableRealtimeMonitor}</span> <span>${LabelEnableRealtimeMonitor}</span>
</label> </label>
<div class="fieldDescription checkboxFieldDescription">${LabelEnableRealtimeMonitorHelp}</div> <div class="fieldDescription checkboxFieldDescription">${LabelEnableRealtimeMonitorHelp}</div>
</div> </div>
<div class="checkboxContainer checkboxContainer-withDescription fldExtractChapterImages hide">
<label>
<input type="checkbox" is="emby-checkbox" class="chkExtractChapterImages" />
<span>${OptionExtractChapterImage}</span>
</label>
<div class="fieldDescription checkboxFieldDescription">${ExtractChapterImagesHelp}</div>
</div>
<div class="checkboxContainer checkboxContainer-withDescription fldExtractChaptersDuringLibraryScan hide">
<label>
<input type="checkbox" is="emby-checkbox" class="chkExtractChaptersDuringLibraryScan" />
<span>${LabelExtractChaptersDuringLibraryScan}</span>
</label>
<div class="fieldDescription checkboxFieldDescription">${LabelExtractChaptersDuringLibraryScanHelp}</div>
</div>
<div class="checkboxContainer checkboxContainer-withDescription chkArhiveAsMediaContainer"> <div class="checkboxContainer checkboxContainer-withDescription chkArhiveAsMediaContainer">
<label> <label>
<input type="checkbox" is="emby-checkbox" class="chkArhiveAsMedia" /> <input type="checkbox" is="emby-checkbox" class="chkArhiveAsMedia" />

View file

@ -35,17 +35,6 @@
$('#txtFanartApiKey', page).val(config.UserApiKey || ''); $('#txtFanartApiKey', page).val(config.UserApiKey || '');
} }
function loadChapters(page, config, providers) {
$('#chkChaptersMovies', page).checked(config.EnableMovieChapterImageExtraction);
$('#chkChaptersEpisodes', page).checked(config.EnableEpisodeChapterImageExtraction);
$('#chkChaptersOtherVideos', page).checked(config.EnableOtherVideoChapterImageExtraction);
$('#chkExtractChaptersDuringLibraryScan', page).checked(config.ExtractDuringLibraryScan);
Dashboard.hideLoadingMsg();
}
function saveFanart(form) { function saveFanart(form) {
ApiClient.getNamedConfiguration("fanart").then(function (config) { ApiClient.getNamedConfiguration("fanart").then(function (config) {
@ -66,20 +55,6 @@
}); });
} }
function saveChapters(form) {
ApiClient.getNamedConfiguration("chapters").then(function (config) {
config.EnableMovieChapterImageExtraction = $('#chkChaptersMovies', form).checked();
config.EnableEpisodeChapterImageExtraction = $('#chkChaptersEpisodes', form).checked();
config.EnableOtherVideoChapterImageExtraction = $('#chkChaptersOtherVideos', form).checked();
config.ExtractDuringLibraryScan = $('#chkExtractChaptersDuringLibraryScan', form).checked();
ApiClient.updateNamedConfiguration("chapters", config);
});
}
function onSubmit() { function onSubmit() {
Dashboard.showLoadingMsg(); Dashboard.showLoadingMsg();
@ -108,7 +83,6 @@
ApiClient.updateServerConfiguration(config).then(Dashboard.processServerConfigurationUpdateResult); ApiClient.updateServerConfiguration(config).then(Dashboard.processServerConfigurationUpdateResult);
}); });
saveChapters(form);
saveMetadata(form); saveMetadata(form);
saveFanart(form); saveFanart(form);
@ -185,14 +159,6 @@
loadFanartConfig(page, metadata); loadFanartConfig(page, metadata);
}); });
var promise1 = ApiClient.getNamedConfiguration("chapters");
var promise2 = ApiClient.getJSON(ApiClient.getUrl("Providers/Chapters"));
Promise.all([promise1, promise2]).then(function (responses) {
loadChapters(page, responses[0], responses[1]);
});
}); });
}; };

View file

@ -26,28 +26,6 @@
<br /> <br />
</div> </div>
<br /> <br />
<div is="emby-collapse" title="${HeaderChapters}">
<div class="collapseContent">
<br />
<div>
<div class="paperListLabel">${HeaderExtractChapterImagesFor}</div>
<div class="paperCheckboxList">
<paper-checkbox id="chkChaptersMovies">${OptionMovies}</paper-checkbox>
<paper-checkbox id="chkChaptersEpisodes">${OptionEpisodes}</paper-checkbox>
<paper-checkbox id="chkChaptersOtherVideos">${OptionOtherVideos}</paper-checkbox>
</div>
<div class="fieldDescription paperCheckboxFieldDescription">${ExtractChapterImagesHelp}</div>
</div>
<br />
<div>
<paper-checkbox id="chkExtractChaptersDuringLibraryScan">${LabelExtractChaptersDuringLibraryScan}</paper-checkbox>
<div class="fieldDescription paperCheckboxFieldDescription">${LabelExtractChaptersDuringLibraryScanHelp}</div>
</div>
<br />
</div>
</div>
<div is="emby-collapse" title="${HeaderPeople}"> <div is="emby-collapse" title="${HeaderPeople}">
<div class="collapseContent"> <div class="collapseContent">

View file

@ -1250,10 +1250,16 @@
var errorMsg = Globalize.translate('MessageErrorPlayingVideo'); var errorMsg = Globalize.translate('MessageErrorPlayingVideo');
var item = self.currentItem; var item = self.currentItem;
var mediaSource = self.currentMediaSource;
if (item && item.Type == "TvChannel") { if (item && item.Type == "TvChannel") {
errorMsg += '<p>'; errorMsg += '<br/>';
errorMsg += '<br/>';
errorMsg += Globalize.translate('MessageEnsureOpenTuner'); errorMsg += Globalize.translate('MessageEnsureOpenTuner');
errorMsg += '</p>'; }
if (mediaSource && mediaSource.VideoType != "VideoFile") {
errorMsg += '<br/>';
errorMsg += '<br/>';
errorMsg += Globalize.translate('MessageFolderRipPlaybackExperimental');
} }
Dashboard.alert({ Dashboard.alert({

View file

@ -2224,5 +2224,7 @@
"LabelMaxAudioFileBitrateHelp": "Audio files with a higher bitrate will be converted by Emby Server. Select a higher value for better quality, or a lower value to conserve local storage space.", "LabelMaxAudioFileBitrateHelp": "Audio files with a higher bitrate will be converted by Emby Server. Select a higher value for better quality, or a lower value to conserve local storage space.",
"LabelVaapiDevice": "VA API Device:", "LabelVaapiDevice": "VA API Device:",
"LabelVaapiDeviceHelp": "This is the render node that is used for hardware acceleration.", "LabelVaapiDeviceHelp": "This is the render node that is used for hardware acceleration.",
"HowToConnectFromEmbyApps": "How to Connect from Emby apps" "HowToConnectFromEmbyApps": "How to Connect from Emby apps",
"MessageFolderRipPlaybackExperimental": "Support for playback of folder rips and ISOs in this app is only expirimental. For best results, try an Emby app that supports these formats natively, or use plain video files.",
"OptionExtractChapterImage": "Enable chapter image extraction"
} }