mirror of
https://github.com/4gray/iptvnator.git
synced 2026-10-12 12:06:16 -08:00
fix(downloads): preserve stalker provider titles
This commit is contained in:
1 parent
7357120612
commit
05a625e474
2 files changed
+20
-5
No files matched your search
@@ -87,6 +87,17 @@ describe('download metadata mapper', () => {
|
||||
expect(merged.tmdbId).toBe(603);
|
||||
});
|
||||
|
||||
it('keeps a normalized Stalker provider title through TMDB enrichment', () => {
|
||||
const merged = mergeSnapshotWithTmdb(
|
||||
providerSnapshot,
|
||||
tmdbMovie,
|
||||
'stalker'
|
||||
);
|
||||
|
||||
expect(merged.title).toBe('Provider title');
|
||||
expect(merged.originalTitle).toBe('Provider original');
|
||||
});
|
||||
|
||||
it('maps a Stalker recent payload without copying credentials or playback fields', () => {
|
||||
const mapped = mapProviderToDownloadSnapshot({
|
||||
source: 'stalker',
|
||||
|
||||
@@ -142,11 +142,15 @@ export function mapProviderToDownloadSnapshot({
|
||||
const identity = [root, info];
|
||||
const title =
|
||||
(source === 'stalker'
|
||||
? (string(info?.['name']) ??
|
||||
string(info?.['o_name']) ??
|
||||
string(root['o_name']) ??
|
||||
string(root['name']) ??
|
||||
string(root['title']))
|
||||
? info
|
||||
? (string(info['name']) ??
|
||||
string(info['o_name']) ??
|
||||
string(root['o_name']) ??
|
||||
string(root['name']) ??
|
||||
string(root['title']))
|
||||
: (string(root['name']) ??
|
||||
string(root['o_name']) ??
|
||||
string(root['title']))
|
||||
: string(first(identity, ['title', 'name']))) ?? fallback.title;
|
||||
const originalTitle =
|
||||
string(first(editorial, ['o_name', 'originalTitle'])) ??
|
||||
|
||||
Reference in new issue
Block a user