Skip to main content

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

string
required
The ID of the item or view. Can be a GUID or a string identifier (which will be hashed to MD5).

Query Parameters

string (UUID)
The user ID. If not provided, uses the authenticated user.
string
required
The client application name (e.g., “web”, “Android”, “iOS”)

Response

string
The display preferences identifier
string
The client application name
string
The view type (e.g., “Movies”, “TvShows”, “Music”)
string
The field to sort by (e.g., “SortName”, “DateCreated”, “PremiereDate”)
string
Sort order: “Ascending” or “Descending”
string
How to index items (e.g., “None”, “Premiere”, “ProductionYear”)
boolean
Whether to remember the indexing preference
boolean
Whether to remember the sorting preference
string
Scroll direction: “Horizontal” or “Vertical”
boolean
Whether to display backdrop images
boolean
Whether to show the sidebar
integer
Height of primary images in pixels
integer
Width of primary images in pixels
object
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

string
required
The ID of the item or view

Query Parameters

string (UUID)
The user ID. If not provided, uses the authenticated user.
string
required
The client application name

Request Body

string
The view type
string
The field to sort by (e.g., “SortName”, “DateCreated”, “CommunityRating”)
string
Sort order: “Ascending” or “Descending”
string
Indexing method: “None”, “Premiere”, “ProductionYear”, “CommunityRating”
boolean
Whether to remember indexing preference
boolean
Whether to remember sorting preference
string
Scroll direction: “Horizontal” or “Vertical”
boolean
Whether to show backdrop images
boolean
Whether to show the sidebar
object
Dictionary of custom preferences (any key-value pairs)

Response

Returns 204 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
Each client can maintain its own preferences for sorting, view types, and custom 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 keys homesection0 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

  1. Always specify the client: Different clients may have different capabilities and UI layouts
  2. Use item-specific IDs: Display preferences should be set for specific libraries or views, not globally
  3. Preserve existing preferences: When updating, include all current CustomPrefs keys to avoid losing unrelated settings
  4. Validate custom values: Ensure custom preference values are valid before saving (e.g., numeric strings for skip lengths)
  5. Handle defaults gracefully: If preferences don’t exist, the server returns sensible defaults
  6. Test across clients: Verify that custom preferences work correctly on all target client applications