mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
add options to library setup
This commit is contained in:
parent
d28cb2cc7e
commit
1895de9249
8 changed files with 94 additions and 45 deletions
|
@ -0,0 +1,55 @@
|
|||
define(['globalize', 'emby-checkbox'], function (globalize) {
|
||||
|
||||
function embed(parent, contentType) {
|
||||
|
||||
return new Promise(function (resolve, reject) {
|
||||
|
||||
var xhr = new XMLHttpRequest();
|
||||
xhr.open('GET', 'components/libraryoptionseditor/libraryoptionseditor.template.html', true);
|
||||
|
||||
xhr.onload = function (e) {
|
||||
|
||||
var template = this.response;
|
||||
parent.innerHTML = globalize.translateDocument(template);
|
||||
|
||||
setContentType(parent, contentType);
|
||||
|
||||
resolve();
|
||||
}
|
||||
|
||||
xhr.send();
|
||||
});
|
||||
}
|
||||
|
||||
function setContentType(parent, contentType) {
|
||||
|
||||
if (contentType == 'music' || contentType == 'tvshows' || contentType == 'movies' || contentType == 'homevideos' || contentType == 'musicvideos' || contentType == 'mixed') {
|
||||
parent.querySelector('.chkArhiveAsMediaContainer').classList.remove('hide');
|
||||
} else {
|
||||
parent.querySelector('.chkArhiveAsMediaContainer').classList.add('hide');
|
||||
}
|
||||
|
||||
if (contentType == 'music' || contentType == 'tvshows' || contentType == 'movies' || contentType == 'homevideos' || contentType == 'musicvideos' || contentType == 'mixed') {
|
||||
parent.classList.remove('hide');
|
||||
} else {
|
||||
parent.classList.add('hide');
|
||||
}
|
||||
}
|
||||
|
||||
function getLibraryOptions(parent) {
|
||||
|
||||
var options = {
|
||||
EnableVideoArchiveFiles: parent.querySelector('.chkArhiveAsMedia').checked
|
||||
};
|
||||
|
||||
options.EnableAudioArchiveFiles = options.EnableVideoArchiveFiles;
|
||||
|
||||
return options;
|
||||
}
|
||||
|
||||
return {
|
||||
embed: embed,
|
||||
setContentType: setContentType,
|
||||
getLibraryOptions: getLibraryOptions
|
||||
};
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue