mirror of
https://github.com/4gray/iptvnator.git
synced 2026-10-15 21:56:18 -08:00
feat(dashboard): add configurable dashboard rails
This commit is contained in:
1 parent
bc639cd36d
commit
101d9ba162
39 files changed
+1685
-248
No files matched your search
@@ -21,6 +21,51 @@ export enum StartupBehavior {
|
||||
|
||||
export type CoverSize = 'small' | 'medium' | 'large';
|
||||
|
||||
export interface DashboardRailsSettings {
|
||||
hero: boolean;
|
||||
continueWatching: boolean;
|
||||
liveFavorites: boolean;
|
||||
recentlyWatchedLive: boolean;
|
||||
favoriteMoviesAndSeries: boolean;
|
||||
recentSources: boolean;
|
||||
xtreamRecentlyAdded: boolean;
|
||||
}
|
||||
|
||||
export const DEFAULT_DASHBOARD_RAILS_SETTINGS: DashboardRailsSettings = {
|
||||
hero: true,
|
||||
continueWatching: true,
|
||||
liveFavorites: true,
|
||||
recentlyWatchedLive: true,
|
||||
favoriteMoviesAndSeries: true,
|
||||
recentSources: true,
|
||||
xtreamRecentlyAdded: true,
|
||||
};
|
||||
|
||||
export type DashboardRailsSettingsInput = Partial<
|
||||
Record<keyof DashboardRailsSettings, boolean | null | undefined>
|
||||
>;
|
||||
|
||||
export function normalizeDashboardRailsSettings(
|
||||
settings?: DashboardRailsSettingsInput | null
|
||||
): DashboardRailsSettings {
|
||||
const normalized = { ...DEFAULT_DASHBOARD_RAILS_SETTINGS };
|
||||
|
||||
if (!settings) {
|
||||
return normalized;
|
||||
}
|
||||
|
||||
const keys = Object.keys(
|
||||
DEFAULT_DASHBOARD_RAILS_SETTINGS
|
||||
) as (keyof DashboardRailsSettings)[];
|
||||
for (const key of keys) {
|
||||
if (typeof settings[key] === 'boolean') {
|
||||
normalized[key] = settings[key];
|
||||
}
|
||||
}
|
||||
|
||||
return normalized;
|
||||
}
|
||||
|
||||
/**
|
||||
* Describes all available settings options of the application
|
||||
*/
|
||||
@@ -58,6 +103,8 @@ export interface Settings {
|
||||
recordingFolder?: string;
|
||||
/** Cover/poster sizing preset applied across grids and rails */
|
||||
coverSize?: CoverSize;
|
||||
/** Per-rail dashboard visibility preferences. Missing keys default on. */
|
||||
dashboardRails?: DashboardRailsSettings;
|
||||
/**
|
||||
* When true, the locally-parsed XMLTV programs (loaded from `epgUrl`)
|
||||
* take precedence over the Xtream provider's EPG for live TV channels.
|
||||
|
||||
Reference in new issue
Block a user