[PR #12597] [CLOSED] Userdatakey fix #13281

Closed
opened 2026-02-07 07:10:11 +03:00 by OVERLORD · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/jellyfin/jellyfin/pull/12597
Author: @piratefin
Created: 9/6/2024
Status: Closed

Base: release-10.9.zHead: userdataskey_fix


📝 Commits (2)

  • 97e6fb6 Added "tmdb-" prefix to tmdb userdatakeys
  • 72ac52c Added "tvdb-" prefix to tmdb userdatakeys

📊 Changes

2 files changed (+3 additions, -3 deletions)

View changed files

📝 MediaBrowser.Controller/Entities/TV/Series.cs (+1 -1)
📝 MediaBrowser.Controller/Entities/Video.cs (+2 -2)

📄 Description

[DRAFT]
[DRAFT]
[DRAFT]

Currently tmdb and tvdb userdatakeys are added as digits only. This has caused confusion especially when marking favorites.
This fixes the issue by adding a prefix for each case. IMDB userdatakeys already have a "tt" prefix that differentiates them.

I have tested this in a personal instance and it works.

Changes
The column "UserDataKey" in table "TypedBaseItems" of library.db will now have "tvdb-" appended if the userdatakey is derived from the tvdb id, and "tmdb-" appended if derived from a tmdb id.

Issues
Fixes #11840

Problems
This fixes the issue completely going forward. However, the current watch history data in the "key" column in "Userdatas" table will not match. The current data needs to be migrated. Proposed migration method is to:

  • for any UserDatas.key = TypedBaseItems.UserDataKey AND only digits, check TypedBaseItems.UnratedType.
  • if TypedBaseItems.UnratedType is "Series", add "tvdb-" prefix to both UserDatas.key and TypedBaseItems.UserDataKey
  • if TypedBaseItems.UnratedType is "Movie", add "tmdb-" prefix to both UserDatas.key and TypedBaseItems.UserDataKey

Unfortunately i dont know to put in a migration script. This would need someone else's help.
Thus, this PR is still in [DRAFT].
Please give any comments.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/jellyfin/jellyfin/pull/12597 **Author:** [@piratefin](https://github.com/piratefin) **Created:** 9/6/2024 **Status:** ❌ Closed **Base:** `release-10.9.z` ← **Head:** `userdataskey_fix` --- ### 📝 Commits (2) - [`97e6fb6`](https://github.com/jellyfin/jellyfin/commit/97e6fb6a15c07a301ad4b4d2542c5eea2c5bcd53) Added "tmdb-" prefix to tmdb userdatakeys - [`72ac52c`](https://github.com/jellyfin/jellyfin/commit/72ac52c9dc1ba29fb16918ded6b2d0df788cc263) Added "tvdb-" prefix to tmdb userdatakeys ### 📊 Changes **2 files changed** (+3 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `MediaBrowser.Controller/Entities/TV/Series.cs` (+1 -1) 📝 `MediaBrowser.Controller/Entities/Video.cs` (+2 -2) </details> ### 📄 Description **[DRAFT]** **[DRAFT]** **[DRAFT]** Currently tmdb and tvdb userdatakeys are added as digits only. This has caused confusion especially when marking favorites. This fixes the issue by adding a prefix for each case. IMDB userdatakeys already have a "tt" prefix that differentiates them. I have tested this in a personal instance and it works. **Changes** The column "UserDataKey" in table "TypedBaseItems" of library.db will now have "tvdb-" appended if the userdatakey is derived from the tvdb id, and "tmdb-" appended if derived from a tmdb id. **Issues** Fixes #11840 **Problems** This fixes the issue completely going forward. However, the current watch history data in the "key" column in "Userdatas" table will not match. The current data needs to be migrated. Proposed migration method is to: - for any UserDatas.key = TypedBaseItems.UserDataKey AND only digits, check TypedBaseItems.UnratedType. - if TypedBaseItems.UnratedType is "Series", add "tvdb-" prefix to both UserDatas.key and TypedBaseItems.UserDataKey - if TypedBaseItems.UnratedType is "Movie", add "tmdb-" prefix to both UserDatas.key and TypedBaseItems.UserDataKey Unfortunately i dont know to put in a migration script. This would need someone else's help. Thus, this PR is still in [DRAFT]. Please give any comments. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
OVERLORD added the pull-request label 2026-02-07 07:10:11 +03:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/jellyfin#13281