diff --git a/ServiceRegistrator.cs b/ServiceRegistrator.cs
index 6c5a896..024400d 100644
--- a/ServiceRegistrator.cs
+++ b/ServiceRegistrator.cs
@@ -19,6 +19,8 @@ namespace Jellyfin.Plugin.Webdav
///
public void RegisterServices(IServiceCollection serviceCollection, IServerApplicationHost applicationHost)
{
+ // Register plugin configuration instance
+ serviceCollection.AddSingleton(_ => WebdavPlugin.Instance.Configuration);
serviceCollection.AddSingleton();
serviceCollection.AddHostedService();
}
diff --git a/WebDavClientService.cs b/WebDavClientService.cs
index 2b0276b..9633e4d 100644
--- a/WebDavClientService.cs
+++ b/WebDavClientService.cs
@@ -42,7 +42,7 @@ namespace Jellyfin.Plugin.Webdav
///
/// Remote path.
/// A collection of WebDAV resources.
- public async Task> ListAsync(string path)
+ public async Task> ListAsync(string path)
{
var response = await _client.Propfind(path).ConfigureAwait(false);
return response.Resources;
diff --git a/WebDavSyncService.cs b/WebDavSyncService.cs
index e1f5a6b..2ba7d3a 100644
--- a/WebDavSyncService.cs
+++ b/WebDavSyncService.cs
@@ -1,16 +1,13 @@
-/*
- * Jellyfin.Plugin.Webdav
- * Copyright (C) 2025 Jellyfin contributors
- * Licensed under GPLv3
- */
namespace Jellyfin.Plugin.Webdav
{
using System.IO;
+ using MediaBrowser.Controller;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using Jellyfin.Plugin.Webdav.Configuration;
using MediaBrowser.Controller.Library;
+ using System.Collections.Generic;
using Microsoft.Extensions.Hosting;
///
@@ -46,7 +43,11 @@ namespace Jellyfin.Plugin.Webdav
///
public async Task StartAsync(CancellationToken cancellationToken)
{
- var localRoot = config.CacheDirectory;
+ // Determine cache root: either configured directory or default user views path
+ var baseCache = string.IsNullOrWhiteSpace(config.CacheDirectory)
+ ? appPaths.DefaultUserViewsPath
+ : config.CacheDirectory;
+ var localRoot = Path.Combine(baseCache, "WebDAV");
if (!Directory.Exists(localRoot))
{
Directory.CreateDirectory(localRoot);
@@ -57,7 +58,7 @@ namespace Jellyfin.Plugin.Webdav
var options = new LibraryOptions();
await libraryManager
- .AddVirtualFolder("WebDAV", null, options, true)
+ .AddVirtualFolder("WebDAV", new[] { localRoot }, options, true)
.ConfigureAwait(false);
}