mirror of
https://github.com/tapframe/NuvioStreaming.git
synced 2026-03-24 03:27:43 +00:00
remove item dedup
This commit is contained in:
parent
7efd21d442
commit
6d34935352
1 changed files with 6 additions and 11 deletions
|
|
@ -1647,21 +1647,16 @@ class CatalogService {
|
|||
|
||||
if (controller.cancelled) return;
|
||||
|
||||
// Sort by catalogIndex (addon manifest order + position within addon), then dedup and emit
|
||||
// Sort by catalogIndex (addon manifest order + position within addon) then emit.
|
||||
// No cross-section dedup — each section is shown separately so duplicates across
|
||||
// sections are intentional (e.g. same movie in Cinemeta and People Search).
|
||||
allPendingSections.sort((a, b) => a.catalogIndex - b.catalogIndex);
|
||||
|
||||
const globalSeen = new Set<string>();
|
||||
for (const section of allPendingSections) {
|
||||
if (controller.cancelled) return;
|
||||
const unique = section.results.filter(item => {
|
||||
const key = `${item.type}:${item.id}`;
|
||||
if (globalSeen.has(key)) return false;
|
||||
globalSeen.add(key);
|
||||
return true;
|
||||
});
|
||||
if (unique.length > 0) {
|
||||
logger.log(`Emitting ${unique.length} results from ${section.sectionName}`);
|
||||
onAddonResults({ addonId: section.addonId, addonName: section.addonName, sectionName: section.sectionName, catalogIndex: section.catalogIndex, results: unique });
|
||||
if (section.results.length > 0) {
|
||||
logger.log(`Emitting ${section.results.length} results from ${section.sectionName}`);
|
||||
onAddonResults({ addonId: section.addonId, addonName: section.addonName, sectionName: section.sectionName, catalogIndex: section.catalogIndex, results: section.results });
|
||||
}
|
||||
}
|
||||
})();
|
||||
|
|
|
|||
Loading…
Reference in a new issue