Refactor Display preference manager (#14056)

This commit is contained in:
JPVenson 2025-09-05 22:39:15 +02:00 committed by GitHub
parent 4849486fa0
commit 20f7ddbf8f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 102 additions and 91 deletions

View file

@ -96,9 +96,6 @@ public class DisplayPreferencesController : BaseJellyfinApiController
dto.CustomPrefs.TryAdd(key, value);
}
// This will essentially be a noop if no changes have been made, but new prefs must be saved at least.
_displayPreferencesManager.SaveChanges();
return dto;
}
@ -210,8 +207,8 @@ public class DisplayPreferencesController : BaseJellyfinApiController
// Set all remaining custom preferences.
_displayPreferencesManager.SetCustomItemDisplayPreferences(userId.Value, itemId, existingDisplayPreferences.Client, displayPreferences.CustomPrefs);
_displayPreferencesManager.SaveChanges();
_displayPreferencesManager.UpdateItemDisplayPreferences(itemPrefs);
_displayPreferencesManager.UpdateDisplayPreferences(existingDisplayPreferences);
return NoContent();
}
}