test jellyfin plugin, would be nice
This commit is contained in:
+30
@@ -0,0 +1,30 @@
|
||||
using MediaBrowser.Model.Plugins;
|
||||
|
||||
namespace Jellyfin.Plugin.PersonalRecordings.Configuration;
|
||||
|
||||
/// <summary>
|
||||
/// Plugin configuration.
|
||||
/// </summary>
|
||||
public class PluginConfiguration : BasePluginConfiguration
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether the plugin is enabled.
|
||||
/// </summary>
|
||||
public bool Enabled { get; set; } = true;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the root folder for per-user recordings (e.g. /recordings).
|
||||
/// Files are moved to {TargetRootPath}/{Username}/.
|
||||
/// </summary>
|
||||
public string TargetRootPath { get; set; } = "/recordings";
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the poll interval in seconds for completed recordings.
|
||||
/// </summary>
|
||||
public int PollIntervalSeconds { get; set; } = 60;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether to only log moves without changing files.
|
||||
/// </summary>
|
||||
public bool DryRun { get; set; }
|
||||
}
|
||||
+79
@@ -0,0 +1,79 @@
|
||||
<!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>
|
||||
Reference in New Issue
Block a user