diff options
| author | theguymadmax <theguymadmax@proton.me> | 2026-07-03 11:46:16 -0400 |
|---|---|---|
| committer | theguymadmax <theguymadmax@proton.me> | 2026-07-03 14:12:56 -0400 |
| commit | 43a152359ebcc6168a1d1d9d21174f14c6b9bd9b (patch) | |
| tree | d74b440b78da3bc5d05a1d292d88fb4e8aee36a5 /Emby.Server.Implementations/Library | |
| parent | ccc1712d10526d3a21e8136c702b84c46ac0a536 (diff) | |
Fix ghost entries when deleting library paths
Diffstat (limited to 'Emby.Server.Implementations/Library')
| -rw-r--r-- | Emby.Server.Implementations/Library/Resolvers/PlaylistResolver.cs | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/Emby.Server.Implementations/Library/Resolvers/PlaylistResolver.cs b/Emby.Server.Implementations/Library/Resolvers/PlaylistResolver.cs index 14798dda65..74c1f69616 100644 --- a/Emby.Server.Implementations/Library/Resolvers/PlaylistResolver.cs +++ b/Emby.Server.Implementations/Library/Resolvers/PlaylistResolver.cs @@ -1,6 +1,7 @@ #nullable disable using System; +using System.Collections.Generic; using System.IO; using System.Linq; using Jellyfin.Data.Enums; @@ -46,7 +47,16 @@ namespace Emby.Server.Implementations.Library.Resolvers } // It's a directory-based playlist if the directory contains a playlist file - var filePaths = Directory.EnumerateFiles(args.Path, "*", new EnumerationOptions { IgnoreInaccessible = true }); + IEnumerable<string> filePaths; + try + { + filePaths = Directory.EnumerateFiles(args.Path, "*", new EnumerationOptions { IgnoreInaccessible = true }); + } + catch (IOException) + { + return null; + } + if (filePaths.Any(f => f.EndsWith(PlaylistXmlSaver.DefaultPlaylistFilename, StringComparison.OrdinalIgnoreCase))) { return new Playlist |
