mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
update sync settings
This commit is contained in:
parent
8ba393c549
commit
0a7858143c
16 changed files with 98 additions and 131 deletions
|
@ -16,7 +16,7 @@
|
|||
Dashboard.hideLoadingMsg();
|
||||
}
|
||||
|
||||
function saveUser(page, user) {
|
||||
function saveUser(page) {
|
||||
|
||||
var chkUploadServer = page.querySelectorAll('.chkUploadServer');
|
||||
var cameraUploadServers = [];
|
||||
|
@ -47,13 +47,7 @@
|
|||
|
||||
Dashboard.showLoadingMsg();
|
||||
|
||||
var userId = getParameterByName('userId') || Dashboard.getCurrentUserId();
|
||||
|
||||
ApiClient.getUser(userId).then(function (user) {
|
||||
|
||||
saveUser(view, user);
|
||||
|
||||
});
|
||||
saveUser(view);
|
||||
|
||||
// Disable default form submission
|
||||
e.preventDefault();
|
||||
|
@ -72,6 +66,11 @@
|
|||
loadForm(page, user);
|
||||
});
|
||||
});
|
||||
|
||||
view.addEventListener('viewbeforehide', function () {
|
||||
|
||||
saveUser(this);
|
||||
});
|
||||
};
|
||||
|
||||
});
|
|
@ -2057,7 +2057,8 @@
|
|||
if (this.checked) {
|
||||
require(['syncDialog'], function (syncDialog) {
|
||||
syncDialog.showMenu({
|
||||
items: [currentItem]
|
||||
items: [currentItem],
|
||||
isLocalSync: true
|
||||
}).then(function () {
|
||||
reload(view, params);
|
||||
}, resetSyncStatus);
|
||||
|
|
|
@ -62,9 +62,7 @@ define(['appSettings', 'userSettings', 'appStorage', 'datetime'], function (appS
|
|||
var currentSrc = (self.getCurrentSrc(mediaRenderer) || '').toLowerCase();
|
||||
|
||||
if (currentSrc.indexOf('.m3u8') != -1) {
|
||||
if (currentSrc.indexOf('forcelivestream=true') == -1) {
|
||||
return true;
|
||||
}
|
||||
return true;
|
||||
} else {
|
||||
var duration = mediaRenderer.duration();
|
||||
return duration && !isNaN(duration) && duration != Number.POSITIVE_INFINITY && duration != Number.NEGATIVE_INFINITY;
|
||||
|
@ -538,11 +536,6 @@ define(['appSettings', 'userSettings', 'appStorage', 'datetime'], function (appS
|
|||
|
||||
if (mediaSource.TranscodingSubProtocol == 'hls') {
|
||||
|
||||
if (mediaUrl.toLowerCase().indexOf('forcelivestream=true') != -1) {
|
||||
startPositionInSeekParam = 0;
|
||||
startTimeTicksOffset = startPosition || 0;
|
||||
}
|
||||
|
||||
contentType = 'application/x-mpegURL';
|
||||
|
||||
} else {
|
||||
|
|
|
@ -1,45 +1,26 @@
|
|||
define(['appSettings', 'apphost'], function (appSettings, appHost) {
|
||||
define(['appSettings', 'apphost', 'emby-checkbox', 'emby-select', 'emby-input'], function (appSettings, appHost) {
|
||||
|
||||
function loadForm(page, user) {
|
||||
|
||||
page.querySelector('#txtSyncPath').value = appSettings.syncPath() || '';
|
||||
page.querySelector('#chkWifi').checked = appSettings.syncOnlyOnWifi();
|
||||
|
||||
Dashboard.hideLoadingMsg();
|
||||
page.querySelector('.selectAudioBitrate').value = appSettings.maxStaticMusicBitrate() || '';
|
||||
}
|
||||
|
||||
function saveUser(page, user) {
|
||||
function saveUser(page) {
|
||||
|
||||
var syncPath = page.querySelector('#txtSyncPath').value;
|
||||
|
||||
appSettings.syncPath(syncPath);
|
||||
appSettings.syncOnlyOnWifi(page.querySelector('#chkWifi').checked);
|
||||
|
||||
Dashboard.hideLoadingMsg();
|
||||
require(['toast'], function (toast) {
|
||||
toast(Globalize.translate('SettingsSaved'));
|
||||
});
|
||||
|
||||
if (syncPath) {
|
||||
if (window.MainActivity) {
|
||||
MainActivity.authorizeStorage();
|
||||
}
|
||||
}
|
||||
appSettings.maxStaticMusicBitrate(page.querySelector('.selectAudioBitrate').value || null);
|
||||
}
|
||||
|
||||
return function (view, params) {
|
||||
|
||||
view.querySelector('form').addEventListener('submit', function (e) {
|
||||
|
||||
Dashboard.showLoadingMsg();
|
||||
|
||||
var userId = getParameterByName('userId') || Dashboard.getCurrentUserId();
|
||||
|
||||
ApiClient.getUser(userId).then(function (user) {
|
||||
|
||||
saveUser(view, user);
|
||||
|
||||
});
|
||||
saveUser(view);
|
||||
|
||||
// Disable default form submission
|
||||
e.preventDefault();
|
||||
|
@ -61,8 +42,6 @@
|
|||
view.addEventListener('viewshow', function () {
|
||||
var page = this;
|
||||
|
||||
Dashboard.showLoadingMsg();
|
||||
|
||||
var userId = getParameterByName('userId') || Dashboard.getCurrentUserId();
|
||||
|
||||
ApiClient.getUser(userId).then(function (user) {
|
||||
|
@ -76,6 +55,11 @@
|
|||
page.querySelector('.fldSyncPath').classList.add('hide');
|
||||
}
|
||||
});
|
||||
|
||||
view.addEventListener('viewbeforehide', function () {
|
||||
|
||||
saveUser(this);
|
||||
});
|
||||
};
|
||||
|
||||
});
|
|
@ -922,6 +922,7 @@ var Dashboard = {
|
|||
}
|
||||
|
||||
profile.MaxStreamingBitrate = bitrateSetting;
|
||||
profile.MaxStaticMusicBitrate = appSettings.maxStaticMusicBitrate();
|
||||
|
||||
resolve(profile);
|
||||
});
|
||||
|
|
|
@ -86,7 +86,7 @@
|
|||
|
||||
return new Promise(function (resolve, reject) {
|
||||
|
||||
require(['emby-checkbox', 'emby-input', 'emby-collapse'], function () {
|
||||
require(['emby-checkbox', 'emby-input', 'emby-select'], function () {
|
||||
|
||||
appHost.appInfo().then(function (appInfo) {
|
||||
renderFormInternal(options, appInfo, resolve);
|
||||
|
@ -104,22 +104,22 @@
|
|||
|
||||
var html = '';
|
||||
|
||||
var targetContainerClass = options.isLocalSync ? ' hide' : '';
|
||||
|
||||
if (options.showName || dialogOptions.Options.indexOf('Name') != -1) {
|
||||
|
||||
html += '<div class="inputContainer">';
|
||||
html += '<div class="inputContainer' + targetContainerClass + '">';
|
||||
html += '<input is="emby-input" type="text" id="txtSyncJobName" class="txtSyncJobName" required="required" label="' + Globalize.translate('LabelSyncJobName') + '"/>';
|
||||
html += '</div>';
|
||||
html += '<br/>';
|
||||
}
|
||||
|
||||
html += '<div>';
|
||||
if (options.readOnlySyncTarget) {
|
||||
html += '<div class="inputContainer">';
|
||||
html += '<div class="inputContainer' + targetContainerClass + '">';
|
||||
html += '<input is="emby-input" type="text" id="selectSyncTarget" readonly label="' + Globalize.translate('LabelSyncTo') + '"/>';
|
||||
html += '</div>';
|
||||
} else {
|
||||
html += '<label for="selectSyncTarget" class="selectLabel">' + Globalize.translate('LabelSyncTo') + '</label>';
|
||||
html += '<select id="selectSyncTarget" required="required" data-mini="true">';
|
||||
html += '<div class="selectContainer' + targetContainerClass + '">';
|
||||
html += '<select is="emby-select" id="selectSyncTarget" required="required" label="' + Globalize.translate('LabelSyncTo') + '">';
|
||||
|
||||
html += targets.map(function (t) {
|
||||
|
||||
|
@ -133,34 +133,26 @@
|
|||
html += '<div class="fieldDescription">' + Globalize.translate('LabelSyncNoTargetsHelp') + '</div>';
|
||||
html += '<div class="fieldDescription"><a href="https://github.com/MediaBrowser/Wiki/wiki/Sync" target="_blank">' + Globalize.translate('ButtonLearnMore') + '</a></div>';
|
||||
}
|
||||
html += '</div>';
|
||||
}
|
||||
html += '</div>';
|
||||
|
||||
html += '<div class="fldProfile" style="display:none;">';
|
||||
html += '<br/>';
|
||||
html += '<label for="selectProfile" class="selectLabel">' + Globalize.translate('LabelProfile') + '</label>';
|
||||
html += '<select id="selectProfile" data-mini="true">';
|
||||
html += '<div class="fldProfile selectContainer" style="display:none;">';
|
||||
html += '<select is="emby-select" id="selectProfile" label="' + Globalize.translate('LabelProfile') + '">';
|
||||
html += '</select>';
|
||||
html += '<div class="fieldDescription profileDescription"></div>';
|
||||
html += '</div>';
|
||||
|
||||
html += '<div class="fldQuality" style="display:none;">';
|
||||
html += '<br/>';
|
||||
html += '<label for="selectQuality" class="selectLabel">' + Globalize.translate('LabelQuality') + '</label>';
|
||||
html += '<select id="selectQuality" data-mini="true" required="required">';
|
||||
html += '<div class="fldQuality selectContainer" style="display:none;">';
|
||||
html += '<select is="emby-select" id="selectQuality" data-mini="true" required="required" label="' + Globalize.translate('LabelQuality') + '">';
|
||||
html += '</select>';
|
||||
html += '<div class="fieldDescription qualityDescription"></div>';
|
||||
html += '</div>';
|
||||
|
||||
html += '<div class="fldBitrate" style="display:none;">';
|
||||
html += '<br/>';
|
||||
html += '<div class="inputContainer">';
|
||||
html += '<div class="fldBitrate inputContainer" style="display:none;">';
|
||||
html += '<input is="emby-input" type="number" step=".1" min=".1" id="txtBitrate" label="' + Globalize.translate('LabelBitrateMbps') + '"/>';
|
||||
html += '</div>';
|
||||
html += '</div>';
|
||||
|
||||
if (dialogOptions.Options.indexOf('UnwatchedOnly') != -1) {
|
||||
html += '<br/>';
|
||||
html += '<div class="checkboxContainer checkboxContainer-withDescription">';
|
||||
html += '<label>';
|
||||
html += '<input is="emby-checkbox" type="checkbox" id="chkUnwatchedOnly"/>';
|
||||
|
@ -170,31 +162,21 @@
|
|||
html += '</div>';
|
||||
}
|
||||
|
||||
if (dialogOptions.Options.indexOf('SyncNewContent') != -1 ||
|
||||
dialogOptions.Options.indexOf('ItemLimit') != -1) {
|
||||
|
||||
html += '<div is="emby-collapse" title="' + Globalize.translate('HeaderAdvanced') + '">';
|
||||
html += '<div class="collapseContent">';
|
||||
if (dialogOptions.Options.indexOf('SyncNewContent') != -1) {
|
||||
html += '<br/>';
|
||||
html += '<div class="checkboxContainer checkboxContainer-withDescription">';
|
||||
html += '<label>';
|
||||
html += '<input is="emby-checkbox" type="checkbox" id="chkSyncNewContent"/>';
|
||||
html += '<span>' + Globalize.translate('OptionAutomaticallySyncNewContent') + '</span>';
|
||||
html += '</label>';
|
||||
html += '<div class="fieldDescription checkboxFieldDescription">' + Globalize.translate('OptionAutomaticallySyncNewContentHelp') + '</div>';
|
||||
html += '</div>';
|
||||
}
|
||||
|
||||
if (dialogOptions.Options.indexOf('ItemLimit') != -1) {
|
||||
html += '<div class="inputContainer">';
|
||||
html += '<input is="emby-input" type="number" step="1" min="1" id="txtItemLimit" label="' + Globalize.translate('LabelItemLimit') + '"/>';
|
||||
html += '<div class="fieldDescription">' + Globalize.translate('LabelItemLimitHelp') + '</div>';
|
||||
html += '</div>';
|
||||
}
|
||||
if (dialogOptions.Options.indexOf('SyncNewContent') != -1) {
|
||||
html += '<div class="checkboxContainer checkboxContainer-withDescription">';
|
||||
html += '<label>';
|
||||
html += '<input is="emby-checkbox" type="checkbox" id="chkSyncNewContent"/>';
|
||||
html += '<span>' + Globalize.translate('OptionAutomaticallySyncNewContent') + '</span>';
|
||||
html += '</label>';
|
||||
html += '<div class="fieldDescription checkboxFieldDescription">' + Globalize.translate('OptionAutomaticallySyncNewContentHelp') + '</div>';
|
||||
html += '</div>';
|
||||
}
|
||||
|
||||
if (dialogOptions.Options.indexOf('ItemLimit') != -1) {
|
||||
html += '<div class="inputContainer">';
|
||||
html += '<input is="emby-input" type="number" step="1" min="1" id="txtItemLimit" label="' + Globalize.translate('LabelItemLimit') + '"/>';
|
||||
html += '<div class="fieldDescription">' + Globalize.translate('LabelItemLimitHelp') + '</div>';
|
||||
html += '</div>';
|
||||
html += '<br/>';
|
||||
}
|
||||
|
||||
//html += '</div>';
|
||||
|
@ -312,7 +294,8 @@
|
|||
renderForm({
|
||||
elem: dlg.querySelector('.formFields'),
|
||||
dialogOptions: dialogOptions,
|
||||
dialogOptionsFn: getTargetDialogOptionsFn(dialogOptionsQuery)
|
||||
dialogOptionsFn: getTargetDialogOptionsFn(dialogOptionsQuery),
|
||||
isLocalSync: options.isLocalSync
|
||||
});
|
||||
|
||||
return promise.then(function () {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue