Skip to content

Commit

Permalink
get unique token url
Browse files Browse the repository at this point in the history
  • Loading branch information
Jean-Baptiste Malatrasi committed Jan 13, 2019
1 parent 7b9d5ae commit 9775b5a
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/app/shared/components/torrent-list/torrent-list.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,16 @@ export class TorrentListComponent implements OnChanges, OnDestroy {
this.torrents720p = [];
this.torrentsOther = [];

const torrentUris = [];
torrents = torrents.filter(torrent => {
if (!torrentUris.includes(torrent.url)) {
torrentUris.push(torrent.url);
return true;
}

return false;
});

torrents.forEach(torrent => {
if (torrent.quality === '1080p') {
this.torrents1080p.push(torrent);
Expand Down

0 comments on commit 9775b5a

Please sign in to comment.