Skip to content

Commit

Permalink
fix(api): Small fixes for search for better mutation
Browse files Browse the repository at this point in the history
  • Loading branch information
TriPSs committed Dec 5, 2020
1 parent 73ae95f commit 2c5aa3e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions apps/api/src/shared/search/adapters/rarbg.search-adapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ export class RarbgSearchAdapter extends SearchAdapter {

// Format all the torrents and remove the ones that returned false
return foundTorrents
.map(this.formatTorrent)
.map((torrent) => this.formatTorrent(torrent))
.filter(Boolean) as Torrent[]
}
}
Expand All @@ -112,11 +112,11 @@ export class RarbgSearchAdapter extends SearchAdapter {
const token = await this.getToken()

if (token) {
const { torrent_results } = await this.get(this.getRequestParams(movie))
const result = await this.get(this.getRequestParams(movie))

// Return the best torrents
return torrent_results
.map(this.formatTorrent)
return (result.torrent_results || [])
.map((torrent) => this.formatTorrent(torrent))
.filter(Boolean) as Torrent[]
}

Expand Down

0 comments on commit 2c5aa3e

Please sign in to comment.