This commit is contained in:
@@ -3,7 +3,7 @@ import type { NextRequest } from "next/server";
|
|||||||
import { guard, jsonError } from "@/server/auth";
|
import { guard, jsonError } from "@/server/auth";
|
||||||
import { createLogger } from "@/server/logger";
|
import { createLogger } from "@/server/logger";
|
||||||
import { getLibrary } from "@/server/torbox";
|
import { getLibrary } from "@/server/torbox";
|
||||||
import { buildStreamUrl } from "@/utils/media";
|
import { buildStreamUrl, getBaseName, getMediaKind } from "@/utils/media";
|
||||||
|
|
||||||
const log = createLogger("playlist");
|
const log = createLogger("playlist");
|
||||||
|
|
||||||
@@ -22,6 +22,9 @@ export async function GET(req: NextRequest) {
|
|||||||
for (const item of items) {
|
for (const item of items) {
|
||||||
if (item.status !== "ready") continue;
|
if (item.status !== "ready") continue;
|
||||||
for (const file of item.files) {
|
for (const file of item.files) {
|
||||||
|
// 只收录视频,字幕、压缩包、文本等传给播放器没有意义
|
||||||
|
const name = getBaseName(file.short_name ?? file.name);
|
||||||
|
if (getMediaKind(name, file.mimetype) !== "video") continue;
|
||||||
const title = `${item.name} / ${file.short_name ?? file.name}`.replace(
|
const title = `${item.name} / ${file.short_name ?? file.name}`.replace(
|
||||||
/[\r\n,]/g,
|
/[\r\n,]/g,
|
||||||
" "
|
" "
|
||||||
|
|||||||
Reference in New Issue
Block a user