feat(torrents): series parsing, S:E/Year columns, magnet cache
- parse Toloka Ukrainian season/episode naming (Сезони 1-10, серій 7 з 8, homoglyphs) into a clean title + episodes field - add series-only sortable S:E column, desktop-only Year column; strip year/source meta from the title cell - filter out torrents with fewer than 5 seeders in the API route - cache Toloka magnets in Redis so each .torrent is downloaded once across serverless instances; append public trackers to magnets (never the passkey-bearing announce URLs from the .torrent) - fix play button hover state while magnet is pending Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
131beeb07f
commit
2e81908b22
9 files changed
+163
-34
No files matched your search
@@ -5,6 +5,8 @@ import tlk from '@/data/parsers/tlk';
|
||||
import tpb from '@/data/parsers/tpb';
|
||||
import yts from '@/data/parsers/yts';
|
||||
|
||||
const MIN_SEEDERS = 5;
|
||||
|
||||
export async function GET({ nextUrl: { searchParams } }: NextRequest) {
|
||||
const key = searchParams.get('key') as keyof typeof providers;
|
||||
|
||||
@@ -15,7 +17,9 @@ export async function GET({ nextUrl: { searchParams } }: NextRequest) {
|
||||
const providers = { yts, tpb, tlk };
|
||||
|
||||
try {
|
||||
return NextResponse.json(await providers[key].search({ imdbID, query, sort }));
|
||||
const torrents = await providers[key].search({ imdbID, query, sort });
|
||||
|
||||
return NextResponse.json(torrents.filter((torrent) => torrent.seeders >= MIN_SEEDERS));
|
||||
} catch (_) {
|
||||
return NextResponse.json([]);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user