mirror of
https://github.com/4gray/iptvnator.git
synced 2026-10-08 17:06:15 -08:00
chore(xtream-mock-server): add support for empty metadata fallback in VOD details
This commit is contained in:
1 parent
0b1e0b0d58
commit
3e30778f51
3 files changed
+52
-31
No files matched your search
@@ -84,6 +84,10 @@ export function getVodDetails(username: string, password: string, vodId: number)
|
||||
const data = getPortalData(username, password);
|
||||
const stream = data.vodStreams.find(v => v.stream_id === vodId);
|
||||
if (!stream) return null;
|
||||
if (data.scenario.vodDetailsFixture === 'empty-metadata') {
|
||||
vodDetailsCache.set(vodId, { info: [] });
|
||||
return vodDetailsCache.get(vodId) ?? null;
|
||||
}
|
||||
vodDetailsCache.set(vodId, generateVodDetails(stream));
|
||||
}
|
||||
return vodDetailsCache.get(vodId) ?? null;
|
||||
|
||||
@@ -19,37 +19,39 @@ export interface RawVodStream {
|
||||
}
|
||||
|
||||
export interface RawVodDetails {
|
||||
info: {
|
||||
kinopoisk_url: string;
|
||||
tmdb_id: number;
|
||||
name: string;
|
||||
o_name: string;
|
||||
cover_big: string;
|
||||
movie_image: string;
|
||||
releasedate: string;
|
||||
episode_run_time: number;
|
||||
youtube_trailer: string;
|
||||
director: string;
|
||||
actors: string;
|
||||
cast: string;
|
||||
description: string;
|
||||
plot: string;
|
||||
age: string;
|
||||
mpaa_rating: string;
|
||||
rating_count_kinopoisk: number;
|
||||
country: string;
|
||||
genre: string;
|
||||
backdrop_path: string[];
|
||||
duration_secs: number;
|
||||
duration: string;
|
||||
video: string[];
|
||||
audio: string[];
|
||||
bitrate: number;
|
||||
rating: number;
|
||||
rating_kinopoisk: string;
|
||||
rating_imdb: string;
|
||||
};
|
||||
movie_data: {
|
||||
info:
|
||||
| {
|
||||
kinopoisk_url: string;
|
||||
tmdb_id: number;
|
||||
name: string;
|
||||
o_name: string;
|
||||
cover_big: string;
|
||||
movie_image: string;
|
||||
releasedate: string;
|
||||
episode_run_time: number;
|
||||
youtube_trailer: string;
|
||||
director: string;
|
||||
actors: string;
|
||||
cast: string;
|
||||
description: string;
|
||||
plot: string;
|
||||
age: string;
|
||||
mpaa_rating: string;
|
||||
rating_count_kinopoisk: number;
|
||||
country: string;
|
||||
genre: string;
|
||||
backdrop_path: string[];
|
||||
duration_secs: number;
|
||||
duration: string;
|
||||
video: string[];
|
||||
audio: string[];
|
||||
bitrate: number;
|
||||
rating: number;
|
||||
rating_kinopoisk: string;
|
||||
rating_imdb: string;
|
||||
}
|
||||
| [];
|
||||
movie_data?: {
|
||||
stream_id: number;
|
||||
name: string;
|
||||
added: string;
|
||||
|
||||
@@ -13,6 +13,8 @@ export interface ScenarioConfig {
|
||||
expiryDate: string;
|
||||
/** Optional deterministic EPG fixture profile for scenario-specific tests. */
|
||||
epgFixture?: 'timezone-focus';
|
||||
/** Optional deterministic VOD detail profile for metadata fallback tests. */
|
||||
vodDetailsFixture?: 'empty-metadata';
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -90,6 +92,19 @@ export const SCENARIOS: Record<string, ScenarioConfig> = {
|
||||
expiryDate: '2099-12-31',
|
||||
epgFixture: 'timezone-focus',
|
||||
},
|
||||
'emptyvod:emptyvod': {
|
||||
name: 'empty-vod-metadata',
|
||||
description:
|
||||
'Xtream VOD fixture with list data intact but empty get_vod_info metadata responses',
|
||||
seed: 7007,
|
||||
categoryCount: { live: 2, vod: 2, series: 2 },
|
||||
itemsPerCategory: 5,
|
||||
seasonsPerSeries: 2,
|
||||
episodesPerSeason: 4,
|
||||
accountStatus: 'Active',
|
||||
expiryDate: '2099-12-31',
|
||||
vodDetailsFixture: 'empty-metadata',
|
||||
},
|
||||
'expired:expired': {
|
||||
name: 'expired',
|
||||
description: 'Expired account — tests subscription expiry UI flow',
|
||||
|
||||
Reference in new issue
Block a user