first commit
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
using MediaBrowser.Model.Plugins;
|
||||
|
||||
namespace Jellyfin.Plugin.JRay.Configuration;
|
||||
|
||||
/// <summary>
|
||||
/// Plugin configuration.
|
||||
/// </summary>
|
||||
public class PluginConfiguration : BasePluginConfiguration
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="PluginConfiguration"/> class.
|
||||
/// </summary>
|
||||
public PluginConfiguration()
|
||||
{
|
||||
TruthFileSuffix = ".jray.json";
|
||||
CacheDurationMinutes = 60;
|
||||
EnableOverlay = true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the filename suffix used to find a scene-actor-extraction
|
||||
/// "truth" file for a media item. The plugin looks for a file named
|
||||
/// "<media file basename><TruthFileSuffix>" next to the media file,
|
||||
/// e.g. "Movie.mkv" -> "Movie.jray.json".
|
||||
/// </summary>
|
||||
public string TruthFileSuffix { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets how long (in minutes) a loaded truth file is cached in
|
||||
/// memory before being re-read from disk.
|
||||
/// </summary>
|
||||
public int CacheDurationMinutes { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether JRay should inject its
|
||||
/// pause-overlay script into the web client's index.html. When disabled,
|
||||
/// any previously injected script is removed.
|
||||
/// </summary>
|
||||
public bool EnableOverlay { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>JRay</title>
|
||||
</head>
|
||||
<body>
|
||||
<div id="JRayConfigPage" data-role="page" class="page type-interior pluginConfigurationPage" data-require="emby-input,emby-button,emby-select,emby-checkbox">
|
||||
<div data-role="content">
|
||||
<div class="content-primary">
|
||||
<form id="JRayConfigForm">
|
||||
<div class="inputContainer">
|
||||
<label class="inputLabel inputLabelUnfocused" for="TruthFileSuffix">Truth file suffix</label>
|
||||
<input id="TruthFileSuffix" name="TruthFileSuffix" type="text" is="emby-input" />
|
||||
<div class="fieldDescription">
|
||||
Filename suffix used to find the scene-actor-extraction output for a media
|
||||
file, e.g. "Movie.mkv" with suffix ".jray.json" looks for "Movie.jray.json"
|
||||
in the same folder.
|
||||
</div>
|
||||
</div>
|
||||
<div class="inputContainer">
|
||||
<label class="inputLabel inputLabelUnfocused" for="CacheDurationMinutes">Cache duration (minutes)</label>
|
||||
<input id="CacheDurationMinutes" name="CacheDurationMinutes" type="number" is="emby-input" min="0" />
|
||||
<div class="fieldDescription">How long a loaded truth file is cached before being re-read from disk.</div>
|
||||
</div>
|
||||
<div class="checkboxContainer checkboxContainer-withDescription">
|
||||
<label>
|
||||
<input id="EnableOverlay" name="EnableOverlay" type="checkbox" is="emby-checkbox" />
|
||||
<span>Enable pause overlay</span>
|
||||
</label>
|
||||
<div class="fieldDescription">
|
||||
Injects a small script into the web client that shows on-screen actors
|
||||
when playback is paused. Disabling this removes the injected script.
|
||||
</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 JRayConfig = {
|
||||
pluginUniqueId: '96a22d9d-23fd-49bb-8970-5e153817d223'
|
||||
};
|
||||
|
||||
document.querySelector('#JRayConfigPage')
|
||||
.addEventListener('pageshow', function() {
|
||||
Dashboard.showLoadingMsg();
|
||||
ApiClient.getPluginConfiguration(JRayConfig.pluginUniqueId).then(function (config) {
|
||||
document.querySelector('#TruthFileSuffix').value = config.TruthFileSuffix;
|
||||
document.querySelector('#CacheDurationMinutes').value = config.CacheDurationMinutes;
|
||||
document.querySelector('#EnableOverlay').checked = config.EnableOverlay;
|
||||
Dashboard.hideLoadingMsg();
|
||||
});
|
||||
});
|
||||
|
||||
document.querySelector('#JRayConfigForm')
|
||||
.addEventListener('submit', function(e) {
|
||||
Dashboard.showLoadingMsg();
|
||||
ApiClient.getPluginConfiguration(JRayConfig.pluginUniqueId).then(function (config) {
|
||||
config.TruthFileSuffix = document.querySelector('#TruthFileSuffix').value;
|
||||
config.CacheDurationMinutes = parseInt(document.querySelector('#CacheDurationMinutes').value, 10);
|
||||
config.EnableOverlay = document.querySelector('#EnableOverlay').checked;
|
||||
ApiClient.updatePluginConfiguration(JRayConfig.pluginUniqueId, config).then(function (result) {
|
||||
Dashboard.processPluginConfigurationUpdateResult(result);
|
||||
});
|
||||
});
|
||||
|
||||
e.preventDefault();
|
||||
return false;
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user