add shared media control allowing jellyfin to control LMS by pointing to files on shared storage
Build Plugin / build (push) Successful in 2m15s
Release Plugin / build-and-release (push) Successful in 2m8s

This commit is contained in:
2025-12-16 19:50:15 +01:00
parent 1b7b836b3e
commit c02469c6d0
4 changed files with 176 additions and 23 deletions
@@ -62,4 +62,24 @@ public class PluginConfiguration : BasePluginConfiguration
/// Gets or sets the Jellyfin API key for authenticating stream requests from LMS.
/// </summary>
public string JellyfinApiKey { get; set; } = string.Empty;
/// <summary>
/// Gets or sets a value indicating whether to use direct file paths instead of HTTP streaming.
/// When enabled, LMS accesses files directly from shared storage, enabling native seeking.
/// </summary>
public bool UseDirectFilePath { get; set; }
/// <summary>
/// Gets or sets the media path prefix as seen by Jellyfin.
/// Used for path mapping when UseDirectFilePath is enabled.
/// Example: /media/music or C:\Music.
/// </summary>
public string JellyfinMediaPath { get; set; } = string.Empty;
/// <summary>
/// Gets or sets the media path prefix as seen by LMS.
/// Used for path mapping when UseDirectFilePath is enabled.
/// Example: /mnt/music or //nas/music.
/// </summary>
public string LmsMediaPath { get; set; } = string.Empty;
}
@@ -141,6 +141,33 @@
</div>
</div>
<div class="verticalSection">
<h3>Direct File Access (Optional)</h3>
<p class="fieldDescription">If LMS and Jellyfin share the same storage (e.g., NAS), enable direct file access for native seeking support. This provides smooth seeking without audio restart.</p>
<div class="checkboxContainer checkboxContainer-withDescription">
<label class="emby-checkbox-label">
<input id="UseDirectFilePath" name="UseDirectFilePath" type="checkbox" is="emby-checkbox" />
<span>Enable Direct File Access</span>
</label>
<div class="fieldDescription checkboxFieldDescription">When enabled, LMS will access files directly instead of streaming via HTTP</div>
</div>
<div id="directPathSettings" style="margin-top: 15px;">
<div class="inputContainer">
<label class="inputLabel inputLabelUnfocused" for="JellyfinMediaPath">Jellyfin Media Path</label>
<input id="JellyfinMediaPath" name="JellyfinMediaPath" type="text" is="emby-input" placeholder="/media/music" />
<div class="fieldDescription">The path prefix as Jellyfin sees your media library (e.g., /media/music)</div>
</div>
<div class="inputContainer">
<label class="inputLabel inputLabelUnfocused" for="LmsMediaPath">LMS Media Path</label>
<input id="LmsMediaPath" name="LmsMediaPath" type="text" is="emby-input" placeholder="/mnt/music" />
<div class="fieldDescription">The same location as LMS sees it (e.g., /mnt/music or //nas/music)</div>
</div>
</div>
</div>
<div class="verticalSection">
<h3>Player Sync</h3>
<p class="fieldDescription">Select players to sync together for multi-room audio. Synced players play in perfect sync.</p>
@@ -418,6 +445,9 @@
document.querySelector('#ConnectionTimeoutSeconds').value = config.ConnectionTimeoutSeconds || 10;
document.querySelector('#EnableAutoSync').checked = config.EnableAutoSync !== false;
document.querySelector('#DefaultPlayerMac').value = config.DefaultPlayerMac || '';
document.querySelector('#UseDirectFilePath').checked = config.UseDirectFilePath || false;
document.querySelector('#JellyfinMediaPath').value = config.JellyfinMediaPath || '';
document.querySelector('#LmsMediaPath').value = config.LmsMediaPath || '';
Dashboard.hideLoadingMsg();
loadPlayers();
@@ -460,6 +490,9 @@
config.ConnectionTimeoutSeconds = parseInt(document.querySelector('#ConnectionTimeoutSeconds').value) || 10;
config.EnableAutoSync = document.querySelector('#EnableAutoSync').checked;
config.DefaultPlayerMac = document.querySelector('#DefaultPlayerMac').value;
config.UseDirectFilePath = document.querySelector('#UseDirectFilePath').checked;
config.JellyfinMediaPath = document.querySelector('#JellyfinMediaPath').value;
config.LmsMediaPath = document.querySelector('#LmsMediaPath').value;
ApiClient.updatePluginConfiguration(JellyLmsConfig.pluginUniqueId, config).then(function (result) {
Dashboard.processPluginConfigurationUpdateResult(result);
});