Overview
The Display Preferences API allows users to customize their viewing experience, including sort order, view types, home screen layout, and client-specific settings. These preferences are stored per user, per client, and per item/view.Get Display Preferences
Retrieves display preferences for a specific item or view. Endpoint:GET /DisplayPreferences/{displayPreferencesId}
Authorization: Required
Path Parameters
The ID of the item or view. Can be a GUID or a string identifier (which will be hashed to MD5).
Query Parameters
The user ID. If not provided, uses the authenticated user.
The client application name (e.g., “web”, “Android”, “iOS”)
Response
The display preferences identifier
The client application name
The view type (e.g., “Movies”, “TvShows”, “Music”)
The field to sort by (e.g., “SortName”, “DateCreated”, “PremiereDate”)
Sort order: “Ascending” or “Descending”
How to index items (e.g., “None”, “Premiere”, “ProductionYear”)
Whether to remember the indexing preference
Whether to remember the sorting preference
Scroll direction: “Horizontal” or “Vertical”
Whether to display backdrop images
Whether to show the sidebar
Height of primary images in pixels
Width of primary images in pixels
Dictionary of custom preference key-value pairs
Status Codes
200- Display preferences retrieved successfully
Example Request
Example Response
Update Display Preferences
Updates display preferences for a specific item or view. Endpoint:POST /DisplayPreferences/{displayPreferencesId}
Authorization: Required
Path Parameters
The ID of the item or view
Query Parameters
The user ID. If not provided, uses the authenticated user.
The client application name
Request Body
The view type
The field to sort by (e.g., “SortName”, “DateCreated”, “CommunityRating”)
Sort order: “Ascending” or “Descending”
Indexing method: “None”, “Premiere”, “ProductionYear”, “CommunityRating”
Whether to remember indexing preference
Whether to remember sorting preference
Scroll direction: “Horizontal” or “Vertical”
Whether to show backdrop images
Whether to show the sidebar
Dictionary of custom preferences (any key-value pairs)
Response
Returns204 No Content on success.
Status Codes
204- Display preferences updated successfully
Example Request
Display Preferences Concepts
Client-Specific Preferences
Display preferences are stored separately for each client application. This allows users to have different settings on different devices:- Web client: Desktop browser settings
- Android: Mobile app settings
- iOS: iOS app settings
- Roku, Apple TV, etc.: Device-specific settings
Item-Specific Preferences
Preferences can be set for individual items or views:- Library folders: Each library (Movies, TV Shows, Music) can have its own display settings
- Collections: Custom collections can have unique view preferences
- Special views: “Latest”, “Favorites”, etc., can each have different settings
Home Section Configuration
The home screen layout is controlled through custom preferences with keyshomesection0 through homesection7. Available section types:
- SmallLibraryTiles: Compact library view
- Resume: Continue watching/listening
- ResumeAudio: Continue listening (audio)
- ResumeBook: Continue reading (books)
- LiveTv: Live TV section
- NextUp: Next episodes to watch
- LatestMedia: Recently added media
- None: Empty section
Sorting Options
Common sorting fields:- SortName: Alphabetical by name
- DateCreated: Date added to library
- DatePlayed: Last played date
- PremiereDate: Original release date
- CommunityRating: User ratings
- CriticRating: Critic ratings
- ProductionYear: Year produced
- PlayCount: Number of plays
- Budget: Production budget (movies)
- Revenue: Box office revenue (movies)
- Runtime: Duration
Indexing Options
Indexing creates alphabetical or categorical groupings:- None: No indexing
- Premiere: Group by premiere date
- ProductionYear: Group by year
- CommunityRating: Group by rating range
Common Use Cases
Setting Skip Lengths
Customize skip forward/backward button behavior:Configuring Home Screen
Set up a custom home screen layout:Setting Library View Preferences
Configure how a library displays items:Theme Configuration
Set dashboard theme:Best Practices
- Always specify the client: Different clients may have different capabilities and UI layouts
- Use item-specific IDs: Display preferences should be set for specific libraries or views, not globally
- Preserve existing preferences: When updating, include all current CustomPrefs keys to avoid losing unrelated settings
- Validate custom values: Ensure custom preference values are valid before saving (e.g., numeric strings for skip lengths)
- Handle defaults gracefully: If preferences don’t exist, the server returns sensible defaults
- Test across clients: Verify that custom preferences work correctly on all target client applications