Remove unused device setting

This commit is contained in:
Bill Thornton 2021-09-01 12:23:27 -04:00
parent 6172c00c3c
commit 99a3ca1cbd
4 changed files with 0 additions and 64 deletions

View File

@ -58,32 +58,6 @@ class TimeSyncCore {
this.timeSyncServer.forceUpdate(); this.timeSyncServer.forceUpdate();
} }
/**
* Gets the list of available devices for time sync.
* @returns {Array} The list of devices.
*/
getDevices() {
const devices = [{
type: 'server',
id: 'server',
name: 'Server',
timeOffset: this.timeSyncServer.getTimeOffset(),
ping: this.timeSyncServer.getPing(),
peerTimeOffset: 0,
peerPing: 0
}];
return devices;
}
/**
* Gets the identifier of the selected device for time sync. Default value is 'server'.
* @returns {string} The identifier.
*/
getActiveDevice() {
return this.timeSyncDeviceId;
}
/** /**
* Gets the display name of the selected device for time sync. * Gets the display name of the selected device for time sync.
* @returns {string} The display name. * @returns {string} The display name.

View File

@ -39,14 +39,6 @@ class SettingsEditor {
this.tabs = {}; this.tabs = {};
this.embed(); this.embed();
Events.on(this.timeSyncCore, 'refresh-devices', () => {
this.refreshTimeSyncDevices();
});
Events.on(this.timeSyncCore, 'time-sync-server-update', () => {
this.refreshTimeSyncDevices();
});
} }
insertBefore(newNode, existingNode) { insertBefore(newNode, existingNode) {
@ -163,27 +155,6 @@ class SettingsEditor {
context.querySelector('#txtMinDelaySkipToSync').value = SyncPlay.Settings.getFloat('minDelaySkipToSync', 400.0); context.querySelector('#txtMinDelaySkipToSync').value = SyncPlay.Settings.getFloat('minDelaySkipToSync', 400.0);
context.querySelector('#chkSpeedToSync').checked = SyncPlay.Settings.getBool('useSpeedToSync', true); context.querySelector('#chkSpeedToSync').checked = SyncPlay.Settings.getBool('useSpeedToSync', true);
context.querySelector('#chkSkipToSync').checked = SyncPlay.Settings.getBool('useSkipToSync', true); context.querySelector('#chkSkipToSync').checked = SyncPlay.Settings.getBool('useSkipToSync', true);
this.refreshTimeSyncDevices();
const timeSyncSelect = context.querySelector('#selectTimeSync');
timeSyncSelect.value = this.timeSyncCore.getActiveDevice();
this.timeSyncSelectedValue = timeSyncSelect.value;
timeSyncSelect.addEventListener('change', () => {
this.timeSyncSelectedValue = timeSyncSelect.value;
});
}
refreshTimeSyncDevices() {
const { context } = this;
const timeSyncSelect = context.querySelector('#selectTimeSync');
const devices = this.timeSyncCore.getDevices();
timeSyncSelect.innerHTML = devices.map(device => {
return `<option value="${device.id}">${device.name} (time offset: ${device.timeOffset} ms; ping: ${device.ping} ms)</option>`;
}).join('');
timeSyncSelect.value = this.timeSyncSelectedValue;
} }
/** /**
@ -218,7 +189,6 @@ class SettingsEditor {
async saveToAppSettings() { async saveToAppSettings() {
const { context } = this; const { context } = this;
const timeSyncDevice = context.querySelector('#selectTimeSync').value;
const extraTimeOffset = context.querySelector('#txtExtraTimeOffset').value; const extraTimeOffset = context.querySelector('#txtExtraTimeOffset').value;
const syncCorrection = context.querySelector('#chkSyncCorrection').checked; const syncCorrection = context.querySelector('#chkSyncCorrection').checked;
const minDelaySpeedToSync = context.querySelector('#txtMinDelaySpeedToSync').value; const minDelaySpeedToSync = context.querySelector('#txtMinDelaySpeedToSync').value;
@ -228,7 +198,6 @@ class SettingsEditor {
const useSpeedToSync = context.querySelector('#chkSpeedToSync').checked; const useSpeedToSync = context.querySelector('#chkSpeedToSync').checked;
const useSkipToSync = context.querySelector('#chkSkipToSync').checked; const useSkipToSync = context.querySelector('#chkSkipToSync').checked;
SyncPlay.Settings.set('timeSyncDevice', timeSyncDevice);
SyncPlay.Settings.set('extraTimeOffset', extraTimeOffset); SyncPlay.Settings.set('extraTimeOffset', extraTimeOffset);
SyncPlay.Settings.set('enableSyncCorrection', syncCorrection); SyncPlay.Settings.set('enableSyncCorrection', syncCorrection);
SyncPlay.Settings.set('minDelaySpeedToSync', minDelaySpeedToSync); SyncPlay.Settings.set('minDelaySpeedToSync', minDelaySpeedToSync);

View File

@ -1,9 +1,4 @@
<form style="margin: auto;"> <form style="margin: auto;">
<h2 class="sectionTitle">${HeaderSyncPlayTimeSyncSettings}</h2>
<div class="selectContainer">
<select id="selectTimeSync" is="emby-select" label="${LabelSyncPlaySettingsTimeSync}"></select>
<div class="fieldDescription">${LabelSyncPlaySettingsTimeSyncHelp}</div>
</div>
<h2 class="sectionTitle">${HeaderSyncPlayPlaybackSettings}</h2> <h2 class="sectionTitle">${HeaderSyncPlayPlaybackSettings}</h2>
<div class="checkboxContainer checkboxContainer-withDescription"> <div class="checkboxContainer checkboxContainer-withDescription">
<label> <label>

View File

@ -875,8 +875,6 @@
"LabelSyncPlaySettingsDescription": "Change SyncPlay preferences", "LabelSyncPlaySettingsDescription": "Change SyncPlay preferences",
"LabelSyncPlaySettingsGroupName": "Group name:", "LabelSyncPlaySettingsGroupName": "Group name:",
"LabelSyncPlaySettingsGroupNameHelp": "Change the group's name.", "LabelSyncPlaySettingsGroupNameHelp": "Change the group's name.",
"LabelSyncPlaySettingsTimeSync": "Device:",
"LabelSyncPlaySettingsTimeSyncHelp": "Pick the device to time sync with. Picking a local peer ensures less noticeable delay between devices on the same network.",
"LabelSyncPlaySettingsExtraTimeOffset": "Extra time offset:", "LabelSyncPlaySettingsExtraTimeOffset": "Extra time offset:",
"LabelSyncPlaySettingsExtraTimeOffsetHelp": "Manually adjust time offset with selected device for time sync. Tweak with care.", "LabelSyncPlaySettingsExtraTimeOffsetHelp": "Manually adjust time offset with selected device for time sync. Tweak with care.",
"LabelSyncPlaySettingsSyncCorrection": "Sync Correction", "LabelSyncPlaySettingsSyncCorrection": "Sync Correction",