mirror of
https://github.com/Viren070/AIOStreams.git
synced 2025-12-01 23:14:04 +01:00
feat: extract jackett indexer in torznab implementation
This commit is contained in:
@@ -87,6 +87,17 @@ const createTorznabItemSchema = () =>
|
||||
.array(z.union([z.string(), z.object({ _: z.string() })]))
|
||||
.transform((arr) => (typeof arr[0] === 'string' ? arr[0] : arr[0]._)),
|
||||
pubDate: z.array(z.string()).transform((arr) => arr[0]),
|
||||
jackettindexer: z
|
||||
.array(
|
||||
z.object({
|
||||
_: z.string(),
|
||||
$: z.object({ id: z.string() }),
|
||||
})
|
||||
)
|
||||
.optional()
|
||||
.transform((arr) =>
|
||||
arr?.[0] ? { name: arr[0]._, id: arr[0].$.id } : undefined
|
||||
),
|
||||
size: z
|
||||
.array(z.string())
|
||||
.optional()
|
||||
@@ -114,6 +125,7 @@ const createTorznabItemSchema = () =>
|
||||
link: item.link,
|
||||
guid: item.guid,
|
||||
pubDate: item.pubDate,
|
||||
jackettindexer: item.jackettindexer,
|
||||
size: item.size,
|
||||
enclosure: item.enclosure,
|
||||
torznab: item['torznab:attr'],
|
||||
|
||||
@@ -67,6 +67,7 @@ export class TorznabAddon extends BaseNabAddon<NabAddonConfig, TorznabApi> {
|
||||
![-1, 999].includes(result.torznab.seeders)
|
||||
? result.torznab.seeders
|
||||
: undefined,
|
||||
indexer: result.jackettindexer?.name ?? undefined,
|
||||
title: result.title,
|
||||
size: result.size ?? 0,
|
||||
type: 'torrent',
|
||||
|
||||
Reference in New Issue
Block a user