mirror of
https://github.com/TheBeastLT/torrentio-scraper.git
synced 2026-01-11 22:40:22 +00:00
sort retrieved TB items in descending creation order
This commit is contained in:
parent
6b693e4321
commit
dac72da784
1 changed files with 3 additions and 0 deletions
|
|
@ -214,6 +214,9 @@ async function getItemList(apiKey, type, id = undefined, offset = 0) {
|
|||
return axios.get(url, { params, headers, timeout })
|
||||
.then(response => {
|
||||
if (response.data?.success) {
|
||||
if (Array.isArray(response.data.data)) {
|
||||
response.data.data.sort((a, b) => b.id - a.id);
|
||||
}
|
||||
return Promise.resolve(response.data.data);
|
||||
}
|
||||
return Promise.reject(response.data);
|
||||
|
|
|
|||
Loading…
Reference in a new issue