Skip to content

Commit 2c5aa3e

Browse files
committed
fix(api): Small fixes for search for better mutation
1 parent 73ae95f commit 2c5aa3e

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

apps/api/src/shared/search/adapters/rarbg.search-adapter.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ export class RarbgSearchAdapter extends SearchAdapter {
8989

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

114114
if (token) {
115-
const { torrent_results } = await this.get(this.getRequestParams(movie))
115+
const result = await this.get(this.getRequestParams(movie))
116116

117117
// Return the best torrents
118-
return torrent_results
119-
.map(this.formatTorrent)
118+
return (result.torrent_results || [])
119+
.map((torrent) => this.formatTorrent(torrent))
120120
.filter(Boolean) as Torrent[]
121121
}
122122

0 commit comments

Comments
 (0)