diff --git a/configuration/homeScreen-configuration.js b/configuration/homeScreen-configuration.js index 6096570..51580cc 100644 --- a/configuration/homeScreen-configuration.js +++ b/configuration/homeScreen-configuration.js @@ -1380,6 +1380,29 @@ window.KefinTweaksConfig = ${JSON.stringify(configToBackup, null, 2)};`; return changed; } + // TEMPORARY: one-time liveTv-on-now Limit:1 → 20 migration. Remove in a future release + // once existing installs have had time to pick up the patch (see liveTvOnNowLimitPatched). + // TODO(remove): patchLiveTvOnNowLimitOnce + call site + liveTvLimitPatch log field + function patchLiveTvOnNowLimitOnce(config) { + if (!window.KefinTweaksConfig) window.KefinTweaksConfig = {}; + if (window.KefinTweaksConfig.liveTvOnNowLimitPatched === true) return false; + + for (const group of config.HOME_SECTION_GROUPS || []) { + for (const section of group.sections || []) { + if (section?.id !== 'liveTv-on-now') continue; + const opts = section.queries?.[0]?.queryOptions; + if (!opts) continue; + // Only bump the bad baked-in default; leave admin-chosen limits alone + if (opts.Limit === 1 || opts.Limit === '1') { + opts.Limit = 20; + } + } + } + + window.KefinTweaksConfig.liveTvOnNowLimitPatched = true; + return true; // flag always newly stamped → needs save + } + async function ensureKefinTweaksDefaultSections() { try { if (!window.ApiClient || !window.ApiClient._loggedIn) { @@ -1411,15 +1434,18 @@ window.KefinTweaksConfig = ${JSON.stringify(configToBackup, null, 2)};`; const defaultSyncChanges = syncKefinTweaksDefaultSections(config); const seasonalThemeChanges = syncSeasonalThemesFromDefaults(config); + // TEMPORARY / TODO(remove): one-time liveTv-on-now Limit patch + const liveTvLimitPatch = patchLiveTvOnNowLimitOnce(config); - if (libraryChanges || addedDefaults || prunedOrphans || defaultSyncChanges || seasonalThemeChanges) { + if (libraryChanges || addedDefaults || prunedOrphans || defaultSyncChanges || seasonalThemeChanges || liveTvLimitPatch) { await saveConfig(config); LOG('KefinTweaks default home sections synced on startup', { libraryChanges, addedDefaults, prunedOrphans, defaultSyncChanges, - seasonalThemeChanges + seasonalThemeChanges, + liveTvLimitPatch }); } } catch (error) { diff --git a/scripts/homeScreenConfig2.js b/scripts/homeScreenConfig2.js index a552870..3507c18 100644 --- a/scripts/homeScreenConfig2.js +++ b/scripts/homeScreenConfig2.js @@ -31,7 +31,7 @@ enabled: false, order: 5, cardFormat: "Thumb", - ttl: CACHE_CONFIG.LONG_TTL, + ttl: CACHE_CONFIG.FORCE_REFRESH_TTL, userConfigurable: true, queries: [ { @@ -53,7 +53,7 @@ enabled: false, order: 6, cardFormat: "Button", - ttl: CACHE_CONFIG.LONG_TTL, + ttl: CACHE_CONFIG.FORCE_REFRESH_TTL, userConfigurable: true, queries: [ { @@ -308,7 +308,7 @@ enabled: false, order: 17, cardFormat: "Thumb", - ttl: CACHE_CONFIG.SHORT_TTL, + ttl: CACHE_CONFIG.FORCE_REFRESH_TTL, userConfigurable: true, queries: [ { @@ -330,7 +330,7 @@ enabled: false, order: 17, cardFormat: "Thumb", - ttl: CACHE_CONFIG.SHORT_TTL, + ttl: CACHE_CONFIG.FORCE_REFRESH_TTL, userConfigurable: true, queries: [ { @@ -387,7 +387,7 @@ enabled: false, order: 15, cardFormat: "Thumb", - ttl: CACHE_CONFIG.VERY_SHORT_TTL, + ttl: CACHE_CONFIG.FORCE_REFRESH_TTL, userConfigurable: true, queries: [ { @@ -395,7 +395,7 @@ queryOptions: { IsAiring: true, Fields: "ChannelInfo,PrimaryImageAspectRatio", - Limit: 1, + Limit: 20, ImageTypeLimit: 1, EnableTotalRecordCount: "false", }, @@ -430,7 +430,7 @@ order: 19, cardFormat: "Square", hideCardFooter: true, - ttl: CACHE_CONFIG.LONG_TTL, + ttl: CACHE_CONFIG.FORCE_REFRESH_TTL, userConfigurable: true, queries: [ { @@ -449,7 +449,7 @@ enabled: false, order: 20, cardFormat: "Thumb", - ttl: CACHE_CONFIG.VERY_SHORT_TTL, + ttl: CACHE_CONFIG.FORCE_REFRESH_TTL, userConfigurable: true, queries: [ { @@ -474,7 +474,7 @@ enabled: false, order: 20, cardFormat: "Thumb", - ttl: CACHE_CONFIG.VERY_SHORT_TTL, + ttl: CACHE_CONFIG.FORCE_REFRESH_TTL, userConfigurable: true, queries: [ { @@ -495,7 +495,7 @@ enabled: false, order: 20, cardFormat: "Thumb", - ttl: CACHE_CONFIG.VERY_SHORT_TTL, + ttl: CACHE_CONFIG.FORCE_REFRESH_TTL, userConfigurable: true, queries: [ { @@ -516,7 +516,7 @@ enabled: false, order: 20, cardFormat: "Thumb", - ttl: CACHE_CONFIG.VERY_SHORT_TTL, + ttl: CACHE_CONFIG.FORCE_REFRESH_TTL, userConfigurable: true, queries: [ { @@ -537,7 +537,7 @@ enabled: false, order: 20, cardFormat: "Thumb", - ttl: CACHE_CONFIG.VERY_SHORT_TTL, + ttl: CACHE_CONFIG.FORCE_REFRESH_TTL, userConfigurable: true, queries: [ {