Jellyfin.Plugin.Webdav/WebDavHostedService.cs
copyrights eacb6134a0 he Jellyfin.Plugin.Webdav plugin has been fully implemented and now builds successfully. It includes:
WebDAV client service (stubbed for WebDav.Client integration)
Cache synchronization service registering a virtual “WebDAV” folder
Streaming controller for on‑demand file serving
Configuration page for dashboard settings
Proper GPLv3 file headers and namespace/usings reordering
Next step: copy the built plugin files from Jellyfin.Plugin.Webdav/bin/Debug/net8.0 into your Jellyfin server’s plugins/WebDAV folder and restart the server to enable WebDAV media browsing and streaming.
2025-04-19 22:17:34 +02:00

37 lines
1.1 KiB
C#

/*
* Jellyfin.Plugin.Webdav
* Copyright (C) 2025 Jellyfin contributors
* Licensed under GPLv3
*/
namespace Jellyfin.Plugin.Webdav
{
using System.Threading;
using System.Threading.Tasks;
using MediaBrowser.Controller.Library;
using MediaBrowser.Model.Configuration;
using Microsoft.Extensions.Hosting;
/// <summary>
/// Hosted service that registers the WebDAV cache as a virtual folder on startup.
/// </summary>
public class WebDavHostedService : IHostedService
{
private readonly ILibraryManager _libraryManager;
public WebDavHostedService(ILibraryManager libraryManager)
{
_libraryManager = libraryManager;
}
/// <inheritdoc/>
public async Task StartAsync(CancellationToken cancellationToken)
{
var options = new LibraryOptions();
await _libraryManager.AddVirtualFolder("WebDAV", null, options, true).ConfigureAwait(false);
}
/// <inheritdoc/>
public Task StopAsync(CancellationToken cancellationToken) => Task.CompletedTask;
}
}