Skip to content

Commit

Permalink
Improve search
Browse files Browse the repository at this point in the history
  • Loading branch information
arvida42 committed Sep 4, 2024
1 parent 9304b09 commit 1abb90c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/lib/jackett.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export async function searchMovieTorrents({indexer, name, year}){
if(!items){
const res = await jackettApi(
`/api/v2.0/indexers/${indexer}/results/torznab/api`,
{t: 'movie',q: name, year: year}
{t: 'search', cat: CATEGORY.MOVIE, q: name, year: year}
);
items = res?.rss?.channel?.item || [];
cache.set(cacheKey, items, {ttl: items.length > 0 ? 3600*36 : 60});
Expand All @@ -37,7 +37,7 @@ export async function searchSerieTorrents({indexer, name, year}){
if(!items){
const res = await jackettApi(
`/api/v2.0/indexers/${indexer}/results/torznab/api`,
{t: 'tvsearch',q: `${name}`}
{t: 'search', cat: CATEGORY.SERIES, q: `${name}`}
);
items = res?.rss?.channel?.item || [];
cache.set(cacheKey, items, {ttl: items.length > 0 ? 3600*36 : 60});
Expand All @@ -56,7 +56,7 @@ export async function searchSeasonTorrents({indexer, name, year, season}){
if(!items){
const res = await jackettApi(
`/api/v2.0/indexers/${indexer}/results/torznab/api`,
{t: 'tvsearch',q: `${name} S${numberPad(season)}`}
{t: 'search', cat: CATEGORY.SERIES, q: `${name} S${numberPad(season)}`}
);
items = res?.rss?.channel?.item || [];
cache.set(cacheKey, items, {ttl: items.length > 0 ? 3600*36 : 60});
Expand All @@ -75,7 +75,7 @@ export async function searchEpisodeTorrents({indexer, name, year, season, episod
if(!items){
const res = await jackettApi(
`/api/v2.0/indexers/${indexer}/results/torznab/api`,
{t: 'tvsearch',q: `${name} S${numberPad(season)}E${numberPad(episode)}`}
{t: 'search', cat: CATEGORY.SERIES, q: `${name} S${numberPad(season)}E${numberPad(episode)}`}
);
items = res?.rss?.channel?.item || [];
cache.set(cacheKey, items, {ttl: items.length > 0 ? 3600*36 : 60});
Expand Down

0 comments on commit 1abb90c

Please sign in to comment.