Files

80 lines
4.5 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Personal Recordings</title>
</head>
<body>
<div id="PersonalRecordingsConfigPage" data-role="page" class="page type-interior pluginConfigurationPage" data-require="emby-input,emby-button,emby-checkbox">
<div data-role="content">
<div class="content-primary">
<form id="PersonalRecordingsConfigForm">
<div class="checkboxContainer checkboxContainer-withDescription">
<label class="emby-checkbox-label">
<input id="Enabled" name="Enabled" type="checkbox" is="emby-checkbox" />
<span>Enable personal recording moves</span>
</label>
<div class="fieldDescription">When enabled, completed recordings are moved into per-user folders.</div>
</div>
<div class="inputContainer">
<label class="inputLabel inputLabelUnfocused" for="TargetRootPath">Target root path</label>
<input id="TargetRootPath" name="TargetRootPath" type="text" is="emby-input" />
<div class="fieldDescription">Recordings are moved to {TargetRootPath}/{Username}/ (default: /recordings)</div>
</div>
<div class="inputContainer">
<label class="inputLabel inputLabelUnfocused" for="PollIntervalSeconds">Poll interval (seconds)</label>
<input id="PollIntervalSeconds" name="PollIntervalSeconds" type="number" is="emby-input" min="15" />
<div class="fieldDescription">How often to check for completed recordings (minimum 15).</div>
</div>
<div class="checkboxContainer checkboxContainer-withDescription">
<label class="emby-checkbox-label">
<input id="DryRun" name="DryRun" type="checkbox" is="emby-checkbox" />
<span>Dry run</span>
</label>
<div class="fieldDescription">Log intended moves without changing files.</div>
</div>
<div>
<button is="emby-button" type="submit" class="raised button-submit block emby-button">
<span>Save</span>
</button>
</div>
</form>
</div>
</div>
<script type="text/javascript">
var PersonalRecordingsConfig = {
pluginUniqueId: '7f3e9c2a-4b1d-4e8f-9a6c-2d5e8f1b3c4a'
};
document.querySelector('#PersonalRecordingsConfigPage')
.addEventListener('pageshow', function () {
Dashboard.showLoadingMsg();
ApiClient.getPluginConfiguration(PersonalRecordingsConfig.pluginUniqueId).then(function (config) {
document.querySelector('#Enabled').checked = config.Enabled;
document.querySelector('#TargetRootPath').value = config.TargetRootPath || '/recordings';
document.querySelector('#PollIntervalSeconds').value = config.PollIntervalSeconds || 60;
document.querySelector('#DryRun').checked = !!config.DryRun;
Dashboard.hideLoadingMsg();
});
});
document.querySelector('#PersonalRecordingsConfigForm')
.addEventListener('submit', function (e) {
Dashboard.showLoadingMsg();
ApiClient.getPluginConfiguration(PersonalRecordingsConfig.pluginUniqueId).then(function (config) {
config.Enabled = document.querySelector('#Enabled').checked;
config.TargetRootPath = document.querySelector('#TargetRootPath').value;
config.PollIntervalSeconds = parseInt(document.querySelector('#PollIntervalSeconds').value, 10) || 60;
config.DryRun = document.querySelector('#DryRun').checked;
ApiClient.updatePluginConfiguration(PersonalRecordingsConfig.pluginUniqueId, config).then(function (result) {
Dashboard.processPluginConfigurationUpdateResult(result);
});
});
e.preventDefault();
return false;
});
</script>
</div>
</body>
</html>