Investigate purpose of displaypreferences.db #213

Closed
opened 2026-02-06 19:26:42 +03:00 by OVERLORD · 1 comment
Owner

Originally created by @sparky8251 on GitHub (Jan 6, 2019).

This is part of #42 and #422.

This one is as screwed as users.db. It has an index joining 3 of the 4 fields in the sole table. And one of the 4 fields is another JSON blob.

The 4 table fields are (note the lack of a master key):

id which is GUID
userId which is GUID
client which is TEXT
data which is BLOB

The prettyfied JSON blob looks like:

{
  "Id":"3ce5b65de116d73165d1efc4a30ec35c",
  "RememberIndexing":false,
  "PrimaryImageHeight":250,
  "PrimaryImageWidth":250,
  "CustomPrefs":{
    "dashboardTheme":"",
    "http://192.168.1.41:8096/web/index.htmlseries":"{
      \"SortBy\":\"SortName\",
      \"SortOrder\":\"Ascending\"
    }
  "},
  "ScrollDirection":"Horizontal",
  "ShowBackdrop":true,
  "RememberSorting":false,
  "SortOrder":"Ascending",
  "ShowSidebar":false,
  "Client":"emby"
}

Of these fields the following questions come to mind:

  • id Why does this value not equal any other id values in any other DB? Why is it later repeated in the blob where it then matches some id strings in other DBs? At the very least, this should be turned into the master key since this DB lacks one.
  • userId Why does this value not equal any other id value in any other DB? Can it be removed?
  • client This just stores "emby" as a string. Why is this needed? Can it be removed?
  • RememberIndexing What is this and why is it false by default? Can it be removed?
  • PrimaryImageHeight Is this what the image type in the users.db was for? Can it be removed?
  • PrimaryImageWith Is this what the image type in the users.db was for? Can it be removed?
  • CustomPrefs Why does this contain its own nested JSON structures? Can it be removed?
  • dashboardTheme Why is this a blank string? Can it be removed?
  • <server-ip-address>/web/index.htmlseries Why does this even exist? Can it be removed?
  • SortBy is set to SortName for me. Is this even user configurable? Can it be removed?
  • SortOrder is set to Ascending for me. Is this even user configurable? Can it be removed?
  • ScrollDirection is set to Horizontal for me. Is this even user configurable? Can it be removed?
  • ShowBackdrop is set to true for me. What does this do? Can it be removed?
  • RememberSorting is set to false for me. Is this even user configurable? Can it be removed?
  • SortOrder is set to Ascending for me. Why is this duplicated from the above nested JSON? Can it be removed?
  • ShowSidebar is set to false. Is this even user configurable? Can it be removed?
  • Client is set to "emby" just like the table. Why does this exist? Can it be removed?

As we track down where and why these things exist, we should look at creating a userdisplaypreferencesv2 table format that doesn't rely on a single large blob. Will make future migrations to new formats much easier. When this eventually leads to a new table format, we should make a jellyfin.db file to store the new table and eventually roll the other dbs into it.

Originally created by @sparky8251 on GitHub (Jan 6, 2019). This is part of #42 and #422. This one is as screwed as `users.db`. It has an index joining 3 of the 4 fields in the sole table. And one of the 4 fields is another JSON blob. The 4 table fields are (note the lack of a master key): `id` which is `GUID` `userId` which is `GUID` `client` which is `TEXT` `data` which is `BLOB` The prettyfied JSON blob looks like: ``` { "Id":"3ce5b65de116d73165d1efc4a30ec35c", "RememberIndexing":false, "PrimaryImageHeight":250, "PrimaryImageWidth":250, "CustomPrefs":{ "dashboardTheme":"", "http://192.168.1.41:8096/web/index.htmlseries":"{ \"SortBy\":\"SortName\", \"SortOrder\":\"Ascending\" } "}, "ScrollDirection":"Horizontal", "ShowBackdrop":true, "RememberSorting":false, "SortOrder":"Ascending", "ShowSidebar":false, "Client":"emby" } ``` Of these fields the following questions come to mind: * [ ] `id` Why does this value not equal any other id values in any other DB? Why is it later repeated in the blob where it then matches some id strings in other DBs? At the very least, this should be turned into the master key since this DB lacks one. * [ ] `userId` Why does this value not equal any other id value in any other DB? Can it be removed? * [ ] `client` This just stores "emby" as a string. Why is this needed? Can it be removed? * [ ] `RememberIndexing` What is this and why is it false by default? Can it be removed? * [ ] `PrimaryImageHeight` Is this what the image type in the `users.db` was for? Can it be removed? * [ ] `PrimaryImageWith` Is this what the image type in the `users.db` was for? Can it be removed? * [ ] `CustomPrefs` Why does this contain its own nested JSON structures? Can it be removed? * [ ] `dashboardTheme` Why is this a blank string? Can it be removed? * [ ] `<server-ip-address>/web/index.htmlseries` Why does this even exist? Can it be removed? * [ ] `SortBy` is set to `SortName` for me. Is this even user configurable? Can it be removed? * [ ] `SortOrder` is set to `Ascending` for me. Is this even user configurable? Can it be removed? * [ ] `ScrollDirection` is set to `Horizontal` for me. Is this even user configurable? Can it be removed? * [ ] `ShowBackdrop` is set to true for me. What does this do? Can it be removed? * [ ] `RememberSorting` is set to false for me. Is this even user configurable? Can it be removed? * [ ] `SortOrder` is set to `Ascending` for me. Why is this duplicated from the above nested JSON? Can it be removed? * [ ] `ShowSidebar` is set to false. Is this even user configurable? Can it be removed? * [ ] `Client` is set to "emby" just like the table. Why does this exist? Can it be removed? As we track down where and why these things exist, we should look at creating a `userdisplaypreferencesv2` table format that doesn't rely on a single large blob. Will make future migrations to new formats much easier. When this eventually leads to a new table format, we should make a `jellyfin.db` file to store the new table and eventually roll the other dbs into it.
OVERLORD added the backendstaleinvestigation labels 2026-02-06 19:26:42 +03:00
Author
Owner

@stale[bot] commented on GitHub (Jul 30, 2019):

Issues go stale after 60d of inactivity. Mark the issue as fresh by adding a comment or commit. Stale issues close after an additional 7d of inactivity. If this issue is safe to close now please do so. If you have any questions you can reach us on Matrix or Social Media.

@stale[bot] commented on GitHub (Jul 30, 2019): Issues go stale after 60d of inactivity. Mark the issue as fresh by adding a comment or commit. Stale issues close after an additional 7d of inactivity. If this issue is safe to close now please do so. If you have any questions you can reach us on [Matrix or Social Media](https://jellyfin.readthedocs.io/en/latest/getting-help/).
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/jellyfin#213