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

Merge remote-tracking branch 'upstream/master' into es6

This commit is contained in:
Bill Thornton 2020-11-19 13:36:26 -05:00
commit e43d5f6f72
44 changed files with 805 additions and 413 deletions

View file

@ -258,11 +258,9 @@ import '../../elements/emby-input/emby-input';
elem.innerHTML = html;
if (html) {
elem.classList.remove('hide');
page.querySelector('.chkDownloadImagesInAdvanceContainer').classList.remove('hide');
page.querySelector('.chkSaveLocalContainer').classList.remove('hide');
} else {
elem.classList.add('hide');
page.querySelector('.chkDownloadImagesInAdvanceContainer').classList.add('hide');
page.querySelector('.chkSaveLocalContainer').classList.add('hide');
}
return true;
@ -508,7 +506,6 @@ import '../../elements/emby-input/emby-input';
EnableRealtimeMonitor: parent.querySelector('.chkEnableRealtimeMonitor').checked,
ExtractChapterImagesDuringLibraryScan: parent.querySelector('.chkExtractChaptersDuringLibraryScan').checked,
EnableChapterImageExtraction: parent.querySelector('.chkExtractChapterImages').checked,
DownloadImagesInAdvance: parent.querySelector('#chkDownloadImagesInAdvance').checked,
EnableInternetProviders: true,
SaveLocalMetadata: parent.querySelector('#chkSaveLocal').checked,
EnableAutomaticSeriesGrouping: parent.querySelector('.chkAutomaticallyGroupSeries').checked,
@ -565,7 +562,6 @@ import '../../elements/emby-input/emby-input';
parent.querySelector('.chkEnableRealtimeMonitor').checked = options.EnableRealtimeMonitor;
parent.querySelector('.chkExtractChaptersDuringLibraryScan').checked = options.ExtractChapterImagesDuringLibraryScan;
parent.querySelector('.chkExtractChapterImages').checked = options.EnableChapterImageExtraction;
parent.querySelector('#chkDownloadImagesInAdvance').checked = options.DownloadImagesInAdvance;
parent.querySelector('#chkSaveLocal').checked = options.SaveLocalMetadata;
parent.querySelector('.chkAutomaticallyGroupSeries').checked = options.EnableAutomaticSeriesGrouping;
parent.querySelector('#chkEnableEmbeddedTitles').checked = options.EnableEmbeddedTitles;

View file

@ -69,14 +69,6 @@
<div class="fieldDescription checkboxFieldDescription">${LabelSaveLocalMetadataHelp}</div>
</div>
<div class="checkboxContainer checkboxContainer-withDescription hide chkDownloadImagesInAdvanceContainer advanced">
<label>
<input is="emby-checkbox" type="checkbox" id="chkDownloadImagesInAdvance" />
<span>${OptionDownloadImagesInAdvance}</span>
</label>
<div class="fieldDescription checkboxFieldDescription">${OptionDownloadImagesInAdvanceHelp}</div>
</div>
<div class="checkboxContainer checkboxContainer-withDescription chkAutomaticallyGroupSeriesContainer hide advanced">
<label>
<input type="checkbox" is="emby-checkbox" class="chkAutomaticallyGroupSeries" />

View file

@ -85,63 +85,35 @@ export default function (page, providerId, options) {
loading.hide();
}
function sha256(str) {
if (!self.TextEncoder) {
return Promise.resolve('');
}
const buffer = new TextEncoder('utf-8').encode(str);
return crypto.subtle.digest('SHA-256', buffer).then(function (hash) {
return hex(hash);
});
}
function hex(buffer) {
const hexCodes = [];
const view = new DataView(buffer);
for (let i = 0; i < view.byteLength; i += 4) {
const value = view.getUint32(i);
const stringValue = value.toString(16);
const paddedValue = ('00000000' + stringValue).slice(-'00000000'.length);
hexCodes.push(paddedValue);
}
return hexCodes.join('');
}
function submitLoginForm() {
loading.show();
sha256(page.querySelector('.txtPass').value).then(function (passwordHash) {
const info = {
Type: 'SchedulesDirect',
Username: page.querySelector('.txtUser').value,
EnableAllTuners: true,
Password: passwordHash,
Pw: page.querySelector('.txtPass').value
};
const id = providerId;
const info = {
Type: 'SchedulesDirect',
Username: page.querySelector('.txtUser').value,
EnableAllTuners: true,
Password: page.querySelector('.txtPass').value
};
const id = providerId;
if (id) {
info.Id = id;
}
if (id) {
info.Id = id;
}
ApiClient.ajax({
type: 'POST',
url: ApiClient.getUrl('LiveTv/ListingProviders', {
ValidateLogin: true
}),
data: JSON.stringify(info),
contentType: 'application/json',
dataType: 'json'
}).then(function (result) {
Dashboard.processServerConfigurationUpdateResult();
providerId = result.Id;
reload();
}, function () {
Dashboard.alert({ // ApiClient.ajax() error handler
message: globalize.translate('ErrorSavingTvProvider')
});
ApiClient.ajax({
type: 'POST',
url: ApiClient.getUrl('LiveTv/ListingProviders', {
ValidateLogin: true
}),
data: JSON.stringify(info),
contentType: 'application/json',
dataType: 'json'
}).then(function (result) {
Dashboard.processServerConfigurationUpdateResult();
providerId = result.Id;
reload();
}, function () {
Dashboard.alert({ // ApiClient.ajax() error handler
message: globalize.translate('ErrorSavingTvProvider')
});
});
}