mirror of
https://github.com/knightcrawler-stremio/knightcrawler.git
synced 2024-12-20 03:29:51 +00:00
Re-add filter step in the processing of the streams (#215)
This commit is contained in:
@@ -3,6 +3,7 @@ import { addonBuilder } from 'stremio-addon-sdk';
|
|||||||
import { cacheWrapStream } from './lib/cache.js';
|
import { cacheWrapStream } from './lib/cache.js';
|
||||||
import { dummyManifest } from './lib/manifest.js';
|
import { dummyManifest } from './lib/manifest.js';
|
||||||
import * as repository from './lib/repository.js';
|
import * as repository from './lib/repository.js';
|
||||||
|
import applyFilters from "./lib/filter.js";
|
||||||
import applySorting from './lib/sort.js';
|
import applySorting from './lib/sort.js';
|
||||||
import { toStreamInfo, applyStaticInfo } from './lib/streamInfo.js';
|
import { toStreamInfo, applyStaticInfo } from './lib/streamInfo.js';
|
||||||
import { Type } from './lib/types.js';
|
import { Type } from './lib/types.js';
|
||||||
@@ -32,6 +33,7 @@ builder.defineStreamHandler((args) => {
|
|||||||
.then(records => records
|
.then(records => records
|
||||||
.sort((a, b) => b.torrent.seeders - a.torrent.seeders || b.torrent.uploadDate - a.torrent.uploadDate)
|
.sort((a, b) => b.torrent.seeders - a.torrent.seeders || b.torrent.uploadDate - a.torrent.uploadDate)
|
||||||
.map(record => toStreamInfo(record)))))
|
.map(record => toStreamInfo(record)))))
|
||||||
|
.then(streams => applyFilters(streams, args.extra))
|
||||||
.then(streams => applySorting(streams, args.extra))
|
.then(streams => applySorting(streams, args.extra))
|
||||||
.then(streams => applyStaticInfo(streams))
|
.then(streams => applyStaticInfo(streams))
|
||||||
.then(streams => applyMochs(streams, args.extra))
|
.then(streams => applyMochs(streams, args.extra))
|
||||||
|
|||||||
Reference in New Issue
Block a user