GridPresenterBase. GridPresenterBase

new GridPresenterBase() → {GridPresenterBase}

Constructor - view is set later via onInit()

Properties
NameTypeDescription
viewdynamic

Reference to the BaseGridView component

logdynamic

Reference to the log instance

apiFiltersdynamic

Cached filter options from API (invalid = not loaded, {} = load failed)

Returns:
Type: 
GridPresenterBase

Methods

clearPresentationInfo() → {void}

Clears/hides the presentation info display

Returns:
Type: 
void

configureLoadTask(task, parentItem, viewMode, _task, _parentItem, _viewMode) → {void}

Configures the LoadItemsTask2 for data loading

Parameters:
NameTypeDescription
taskobject

The LoadItemsTask2 node

parentItemobject

The library item being displayed

viewModestring

Current view mode (e.g., "Movies", "MoviesGrid")

_taskobject
_parentItemobject
_viewModestring
Returns:
Type: 
void

createInfoNodes(infoGroup, _infoGroup) → {void}

Creates presenter-specific info nodes in the presentationInfo group Called during onInit() if presenter needs custom info display

Parameters:
NameTypeDescription
infoGroupobject

The presentationInfo Group node

_infoGroupobject
Returns:
Type: 
void

getBackdropMode() → {string}

Returns the backdrop mode for this presenter

Returns:

"presentation" | "fullscreen" | "none"

Type: 
string

getGridConfig(viewMode, _viewMode) → {object}

Returns grid layout configuration for the specified view mode

Parameters:
NameTypeDescription
viewModestring

Current view mode

  • translation: [x, y] grid position
  • itemSize: [width, height] size of each grid cell
  • rowHeights: [height] array of row heights
  • numRows: string number of visible rows
  • numColumns: string number of columns
  • imageDisplayMode: "scaleToZoom" | "scaleToFit"
_viewModestring
Returns:

Grid config with properties:

Type: 
object

getItemType() → {string}

Returns the item type(s) to load

Returns:

Item type(s) for API query (e.g., "Movie", "Series,Movie")

Type: 
string

getOptions(parentItem, _parentItem) → {object}

Returns the options configuration for ItemGridOptions

Parameters:
NameTypeDescription
parentItemobject

The library item being displayed

_parentItemobject
Returns:

Options object with views, sort, filter arrays

Type: 
object

loadFilters(parentItem, itemType) → {void}

Load dynamic filter options (Genres, Years, Ratings) from the Jellyfin API. Call from configureLoadTask() in subclasses that need dynamic filters. Delegates the fetch to the host component (BaseGridView.loadFilters) via callFunc so it runs in component-m context, where fetchAsync + auto-abandon work — a presenter is a class, not a component, so the auto-abandon plugin can't inject into it (Phase-4 collapse of GetFiltersTask; see docs/dev/promises.md). Results arrive via onFiltersLoaded().

Parameters:
NameTypeDescription
parentItemobject

The library item to load filters for

itemTypestring

The item type to filter (e.g., "Movie", "Series")

Returns:
Type: 
void

onDestroy() → {void}

Called when presenter is being destroyed Override to clean up resources, stop tasks, unobserve fields Always call super.onDestroy() at the end of overrides

Returns:
Type: 
void

onFiltersLoaded(filters, errorMsg) → {void}

Called when filters are delivered by the host component's promise (BaseGridView.loadFilters). Caches the result in m.apiFilters and shows a toast on failure.

Parameters:
NameTypeDescription
filtersobject

The filter options AA (empty {} on failure)

errorMsgstring

Non-empty on failure; triggers a toast

Returns:
Type: 
void

onInit(view) → {void}

Called after presenter is attached to BaseGridView Stores view reference and creates shared task nodes Override in subclass but call super.onInit(view) first

Parameters:
NameTypeDescription
viewobject

Reference to BaseGridView component

Returns:
Type: 
void

onItemFocused(item, currentView, _item, _currentView) → {void}

Called when an item receives focus Override to update presentation info display

Parameters:
NameTypeDescription
itemobject

The focused ContentNode item

currentViewstring

The current view mode (e.g., "Movies", "MoviesGrid")

_itemobject
_currentViewstring
Returns:
Type: 
void

onOptionsClosed(options, _options) → {void}

Called when options dialog is closed Override to handle presenter-specific option changes

Parameters:
NameTypeDescription
optionsobject

The ItemGridOptions component

_optionsobject
Returns:
Type: 
void

shouldShowPresentationInfo(viewMode, _viewMode) → {boolean}

Returns whether to show presentation info panel for the view mode

Parameters:
NameTypeDescription
viewModestring

Current view mode

_viewModestring
Returns:

True to show info panel

Type: 
boolean

showToast(message, toastTypeopt) → {void}

Show a toast notification via the scene-level Toast component. Safe to call from presenter classes (routes through view's scene reference).

Parameters:
NameTypeAttributesDefaultDescription
messagestring

The message to display

toastTypestring<optional>
"error"

"error", "success", or "info"

Returns:
Type: 
void