mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-04-21 17:44:43 +01:00
Fix access to playlists not created by a user (#9746)
This commit is contained in:
@@ -30,7 +30,7 @@ namespace Emby.Server.Implementations.Library.Resolvers
|
||||
{
|
||||
if (args.IsDirectory)
|
||||
{
|
||||
// It's a boxset if the path is a directory with [playlist] in it's the name
|
||||
// It's a boxset if the path is a directory with [playlist] in its name
|
||||
var filename = Path.GetFileName(Path.TrimEndingDirectorySeparator(args.Path));
|
||||
if (string.IsNullOrEmpty(filename))
|
||||
{
|
||||
@@ -42,7 +42,8 @@ namespace Emby.Server.Implementations.Library.Resolvers
|
||||
return new Playlist
|
||||
{
|
||||
Path = args.Path,
|
||||
Name = filename.Replace("[playlist]", string.Empty, StringComparison.OrdinalIgnoreCase).Trim()
|
||||
Name = filename.Replace("[playlist]", string.Empty, StringComparison.OrdinalIgnoreCase).Trim(),
|
||||
OpenAccess = true
|
||||
};
|
||||
}
|
||||
|
||||
@@ -53,7 +54,8 @@ namespace Emby.Server.Implementations.Library.Resolvers
|
||||
return new Playlist
|
||||
{
|
||||
Path = args.Path,
|
||||
Name = filename
|
||||
Name = filename,
|
||||
OpenAccess = true
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -70,7 +72,8 @@ namespace Emby.Server.Implementations.Library.Resolvers
|
||||
Path = args.Path,
|
||||
Name = Path.GetFileNameWithoutExtension(args.Path),
|
||||
IsInMixedFolder = true,
|
||||
PlaylistMediaType = MediaType.Audio
|
||||
PlaylistMediaType = MediaType.Audio,
|
||||
OpenAccess = true
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -549,7 +549,7 @@ namespace Emby.Server.Implementations.Playlists
|
||||
SavePlaylistFile(playlist);
|
||||
}
|
||||
}
|
||||
else
|
||||
else if (!playlist.OpenAccess)
|
||||
{
|
||||
// Remove playlist if not shared
|
||||
_libraryManager.DeleteItem(
|
||||
|
||||
Reference in New Issue
Block a user