ensure deduplication of results
This commit is contained in:
parent
513b1de86e
commit
79aa8f619a
@ -125,7 +125,15 @@
|
|||||||
<td class="year" style="vertical-align:top;">${film.year || 'N/A'}</td>
|
<td class="year" style="vertical-align:top;">${film.year || 'N/A'}</td>
|
||||||
<td>`;
|
<td>`;
|
||||||
|
|
||||||
film.results.forEach(r => {
|
const uniqueResults = [];
|
||||||
|
const seenSources = new Set();
|
||||||
|
film.results.forEach(r => {
|
||||||
|
if (!seenSources.has(r.source)) {
|
||||||
|
uniqueResults.push(r);
|
||||||
|
seenSources.add(r.source);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
uniqueResults.forEach(r => {
|
||||||
html += `<div class="source-block">`;
|
html += `<div class="source-block">`;
|
||||||
html += `<p class="source-name">${r.source.charAt(0).toUpperCase() + r.source.slice(1)}</p>`;
|
html += `<p class="source-name">${r.source.charAt(0).toUpperCase() + r.source.slice(1)}</p>`;
|
||||||
// (No image here anymore)
|
// (No image here anymore)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user