Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix playlists #12934

Merged
merged 7 commits into from
Nov 15, 2024
Merged

Fix playlists #12934

merged 7 commits into from
Nov 15, 2024

Conversation

Shadowghost
Copy link
Contributor

@Shadowghost Shadowghost commented Nov 1, 2024

There is for sure a cleaner solution than this one.

Issue: For some reason the Id of LinkedItem is different every time they are read.

Changes

  • Use LinkedItem.ItemId instead of LinkedItem.Id since the latter seems to be non-static
  • Remove LinkedItem.Id alltogether
  • Calculate new Index on moved item based on accessible items
  • Fully remove option for duplicate playlist entries and cleanup duplicates from playlists

Issues
Fixes #12892

@Shadowghost Shadowghost added the stable backport Backport into the next stable release label Nov 1, 2024
@jellyfin-bot
Copy link
Contributor

jellyfin-bot commented Nov 1, 2024

ABI Difference

MediaBrowser.Controller.dll
API compatibility errors between './abi-base/MediaBrowser.Controller.dll' (left) and './abi-head/MediaBrowser.Controller.dll' (right):
CP0002: Member 'string MediaBrowser.Controller.Entities.LinkedChild.Id.get' exists on ./abi-base/MediaBrowser.Controller.dll but not on ./abi-head/MediaBrowser.Controller.dll
CP0002: Member 'void MediaBrowser.Controller.Entities.LinkedChild.Id.set' exists on ./abi-base/MediaBrowser.Controller.dll but not on ./abi-head/MediaBrowser.Controller.dll
CP0002: Member 'string MediaBrowser.Controller.Extensions.ConfigurationExtensions.PlaylistsAllowDuplicatesKey' exists on ./abi-base/MediaBrowser.Controller.dll but not on ./abi-head/MediaBrowser.Controller.dll
CP0002: Member 'bool MediaBrowser.Controller.Extensions.ConfigurationExtensions.DoPlaylistsAllowDuplicates(this Microsoft.Extensions.Configuration.IConfiguration)' exists on ./abi-base/MediaBrowser.Controller.dll but not on ./abi-head/MediaBrowser.Controller.dll
CP0002: Member 'System.Threading.Tasks.Task MediaBrowser.Controller.Playlists.IPlaylistManager.MoveItemAsync(string, string, int)' exists on ./abi-base/MediaBrowser.Controller.dll but not on ./abi-head/MediaBrowser.Controller.dll
CP0006: Cannot add interface member 'System.Threading.Tasks.Task MediaBrowser.Controller.Playlists.IPlaylistManager.MoveItemAsync(string, string, int, System.Guid)' to ./abi-head/MediaBrowser.Controller.dll because it does not exist on ./abi-base/MediaBrowser.Controller.dll
API breaking changes found. If those are intentional, the APICompat suppression file can be updated by specifying the '--generate-suppression-file' parameter.

@pixel24
Copy link

pixel24 commented Nov 14, 2024

Is there any estimate on when this bug might be fixed? I work on my playlists daily, and I only noticed the issue after already adding quite a bit to my playlists, which I’d lose if I had to roll back.

@talkingseedling
Copy link

talkingseedling commented Nov 18, 2024

After upgrading to 10.10.2, Jellyfin wouldn't come up. I think it's related to this PR. Error below. The music folders are mounted in docker as read only, which may have caused this issue. I fixed by rolling back to 10.10.1, deleting the playlist folder I no longer use, then going back to 10.10.2.

[20:07:33] [ERR] [1] Jellyfin.Server.Migrations.MigrationRunner: Could not apply migration 'RemoveDuplicatePlaylistChildren'
System.IO.DirectoryNotFoundException: Could not find a part of the path '/data/music/music/Playlists/Triple J 1999.wpl'.
at Interop.ThrowExceptionForIoErrno(ErrorInfo errorInfo, String path, Boolean isDirError)
at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String path, OpenFlags flags, Int32 mode, Boolean failForSymlink, Boolean& wasSymlink, Func4 createOpenException) at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, UnixFileMode openPermissions, Int64& fileLength, UnixFileMode& filePermissions, Boolean failForSymlink, Boolean& wasSymlink, Func4 createOpenException)
at System.IO.File.OpenHandle(String path, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize)
at System.IO.File.WriteToFile(String path, FileMode mode, String contents, Encoding encoding)
at Emby.Server.Implementations.Playlists.PlaylistManager.SavePlaylistFile(Playlist item)
at Jellyfin.Server.Migrations.Routines.RemoveDuplicatePlaylistChildren.Perform()
at Jellyfin.Server.Migrations.MigrationRunner.PerformMigrations(IMigrationRoutine[] migrations, MigrationOptions migrationOptions, Action1 saveConfiguration, ILogger logger) [20:07:33] [FTL] [1] Main: Error while starting server System.IO.DirectoryNotFoundException: Could not find a part of the path '/data/music/music/Playlists/Triple J 1999.wpl'. at Interop.ThrowExceptionForIoErrno(ErrorInfo errorInfo, String path, Boolean isDirError) at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String path, OpenFlags flags, Int32 mode, Boolean failForSymlink, Boolean& wasSymlink, Func4 createOpenException)
at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, UnixFileMode openPermissions, Int64& fileLength, UnixFileMode& filePermissions, Boolean failForSymlink, Boolean& wasSymlink, Func4 createOpenException) at System.IO.File.OpenHandle(String path, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize) at System.IO.File.WriteToFile(String path, FileMode mode, String contents, Encoding encoding) at Emby.Server.Implementations.Playlists.PlaylistManager.SavePlaylistFile(Playlist item) at Jellyfin.Server.Migrations.Routines.RemoveDuplicatePlaylistChildren.Perform() at Jellyfin.Server.Migrations.MigrationRunner.PerformMigrations(IMigrationRoutine[] migrations, MigrationOptions migrationOptions, Action1 saveConfiguration, ILogger logger)
at Jellyfin.Server.Migrations.MigrationRunner.Run(CoreAppHost host, ILoggerFactory loggerFactory)
at Jellyfin.Server.Program.StartServer(IServerApplicationPaths appPaths, StartupOptions options, IConfiguration startupConfig)

joshuaboniface pushed a commit that referenced this pull request Nov 19, 2024
Fix playlists

Original-merge: 8bee67f

Merged-by: crobibero <cody@robibe.ro>

Backported-by: Joshua M. Boniface <joshua@boniface.me>
@jellyfin-bot jellyfin-bot removed the stable backport Backport into the next stable release label Nov 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants