new GridPresenterBase() → {GridPresenterBase}
Constructor - view is set later via onInit()
| Name | Type | Description |
|---|---|---|
view | dynamic | Reference to the BaseGridView component |
log | dynamic | Reference to the log instance |
apiFilters | dynamic | Cached filter options from API (invalid = not loaded, {} = load failed) |
- Type:
- GridPresenterBase
Methods
clearPresentationInfo() → {void}
Clears/hides the presentation info display
- Type:
- void
configureLoadTask(task, parentItem, viewMode, _task, _parentItem, _viewMode) → {void}
Configures the LoadItemsTask2 for data loading
| Name | Type | Description |
|---|---|---|
task | object | The LoadItemsTask2 node |
parentItem | object | The library item being displayed |
viewMode | string | Current view mode (e.g., "Movies", "MoviesGrid") |
_task | object | |
_parentItem | object | |
_viewMode | string |
- Type:
- void
createInfoNodes(infoGroup, _infoGroup) → {void}
Creates presenter-specific info nodes in the presentationInfo group Called during onInit() if presenter needs custom info display
| Name | Type | Description |
|---|---|---|
infoGroup | object | The presentationInfo Group node |
_infoGroup | object |
- Type:
- void
getBackdropMode() → {string}
Returns the backdrop mode for this presenter
"presentation" | "fullscreen" | "none"
- Type:
- string
getGridConfig(viewMode, _viewMode) → {object}
Returns grid layout configuration for the specified view mode
| Name | Type | Description |
|---|---|---|
viewMode | string | Current view mode
|
_viewMode | string |
Grid config with properties:
- Type:
- object
getItemType() → {string}
Returns the item type(s) to load
Item type(s) for API query (e.g., "Movie", "Series,Movie")
- Type:
- string
getOptions(parentItem, _parentItem) → {object}
Returns the options configuration for ItemGridOptions
| Name | Type | Description |
|---|---|---|
parentItem | object | The library item being displayed |
_parentItem | object |
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. Results arrive via onFiltersLoaded() and are cached in m.apiFilters.
| Name | Type | Description |
|---|---|---|
parentItem | object | The library item to load filters for |
itemType | string | The item type to filter (e.g., "Movie", "Series") |
- 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
- Type:
- void
onFiltersLoaded(event) → {void}
Called when filters are loaded from API (via onPresenterFiltersLoaded bridge in BaseGridView). Caches the result in m.apiFilters and shows a toast on failure.
| Name | Type | Description |
|---|---|---|
event | object | roSGNodeEvent for the "filters" field change |
- 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
| Name | Type | Description |
|---|---|---|
view | object | Reference to BaseGridView component |
- Type:
- void
onItemFocused(item, currentView, _item, _currentView) → {void}
Called when an item receives focus Override to update presentation info display
| Name | Type | Description |
|---|---|---|
item | object | The focused ContentNode item |
currentView | string | The current view mode (e.g., "Movies", "MoviesGrid") |
_item | object | |
_currentView | string |
- Type:
- void
onOptionsClosed(options, _options) → {void}
Called when options dialog is closed Override to handle presenter-specific option changes
| Name | Type | Description |
|---|---|---|
options | object | The ItemGridOptions component |
_options | object |
- Type:
- void
shouldShowPresentationInfo(viewMode, _viewMode) → {boolean}
Returns whether to show presentation info panel for the view mode
| Name | Type | Description |
|---|---|---|
viewMode | string | Current view mode |
_viewMode | string |
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).
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
message | string | The message to display | ||
toastType | string | <optional> | "error" | "error", "success", or "info" |
- Type:
- void