mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-07-16 05:43:54 +03:00
[PR #16120] Fix DeleteItem cleanup logic to remove conflicting UserData entries #14530
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/jellyfin/jellyfin/pull/16120
Author: @MarcoCoreDuo
Created: 1/26/2026
Status: 🔄 Open
Base:
release-10.11.z← Head:fix-userdata-cleanup📝 Commits (2)
e1c5118Fix DeleteItem cleanup logic to remove conflicting UserData entriesd7d81aesort by ItemId if no LastPlayedDate exists📊 Changes
1 file changed (+26 additions, -0 deletions)
View changed files
📝
Jellyfin.Server.Implementations/Item/BaseItemRepository.cs(+26 -0)📄 Description
Prior to PR #14795, the item deletion logic handled single items correctly. When deleting an item, Jellyfin checked if a placeholder entry existed in the UserData table with matching UserId, CustomDataKey, and PlaceholderId as ItemId. If found, it was deleted to prevent constraint violations when updating the item's UserData itemId to the placeholderId.
However, PR #14795 changed the method to accept multiple item IDs for batch deletion, which introduced a new edge case.
When multiple items share the same (UserId, CustomDataKey) combination (e.g., duplicate episodes), the current code does not check for conflicts among the items being deleted.
Example scenario:
Changes
Issues
Fixes #15343
Fixes #15397
Fixes #15658
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.