mirror of
https://github.com/4gray/iptvnator.git
synced 2026-10-10 18:36:15 -08:00
fix(dashboard): address PR review feedback
This commit is contained in:
1 parent
7083bd2af4
commit
2ecb5c28f4
30 files changed
+340
-104
No files matched your search
@@ -17,6 +17,10 @@ interface PlaylistRecentLabels {
|
||||
m3u: string;
|
||||
}
|
||||
|
||||
function firstNonEmpty(...values: Array<string | undefined>): string | undefined {
|
||||
return values.map((value) => value?.trim()).find(Boolean);
|
||||
}
|
||||
|
||||
function getPlaylistRecentItems(
|
||||
playlist: PlaylistMeta
|
||||
): PlaylistRecentlyViewedItem[] {
|
||||
@@ -76,9 +80,11 @@ function mapM3uPlaylistRecentItems(
|
||||
acc.push({
|
||||
id: rawItem.id || channelUrl,
|
||||
title:
|
||||
rawItem.title?.trim() ||
|
||||
rawItem.tvg_name?.trim() ||
|
||||
rawItem.channel_id ||
|
||||
firstNonEmpty(
|
||||
rawItem.title,
|
||||
rawItem.tvg_name,
|
||||
rawItem.channel_id
|
||||
) ||
|
||||
channelUrl,
|
||||
type: 'live',
|
||||
playlist_id: playlist._id,
|
||||
@@ -87,6 +93,12 @@ function mapM3uPlaylistRecentItems(
|
||||
category_id: rawItem.category_id || 'live',
|
||||
xtream_id: channelUrl,
|
||||
poster_url: rawItem.poster_url || undefined,
|
||||
epg_lookup_key: firstNonEmpty(
|
||||
rawItem.tvg_id,
|
||||
rawItem.tvg_name,
|
||||
rawItem.title,
|
||||
rawItem.channel_id
|
||||
),
|
||||
source: 'm3u',
|
||||
});
|
||||
|
||||
|
||||
@@ -16,6 +16,11 @@ export interface PortalActivityItem {
|
||||
category_id: string | number;
|
||||
xtream_id: string | number;
|
||||
poster_url?: string;
|
||||
/**
|
||||
* Preferred XMLTV lookup key for live EPG enrichment. For M3U channels this
|
||||
* follows the app-wide tvg.id -> tvg.name -> display name fallback chain.
|
||||
*/
|
||||
epg_lookup_key?: string;
|
||||
/**
|
||||
* Wide backdrop URL (typically 16:9), persisted when the user first views
|
||||
* the detail page. Absent for stalker and for items that have never had
|
||||
|
||||
Reference in new issue
Block a user