Trash eklendi

This commit is contained in:
2025-11-02 00:15:06 +03:00
parent 90009d9fbe
commit 3e07e2a270
8 changed files with 2670 additions and 135 deletions

View File

@@ -280,8 +280,8 @@ let filteredShows = [];
const ext = name.split(".").pop()?.toLowerCase() || "";
const inferredType = ext ? `video/${ext}` : "video/mp4";
const size =
Number(episode.fileSize) ||
Number(episode.mediaInfo?.format?.size) ||
Number(episode.mediaInfo?.format?.bit_rate) ||
null;
return {
name,
@@ -300,9 +300,19 @@ let filteredShows = [];
)
.filter(Boolean);
const encodePathSegments = (value) =>
value
? value
.split(/[\\/]/)
.map((segment) => encodeURIComponent(segment))
.join("/")
: "";
$: selectedName = selectedVideo?.name ?? "";
$: encName = selectedName ? encodeURIComponent(selectedName) : "";
$: downloadHref = encName ? `${API}/downloads/${encName}` : "#";
$: encName = encodePathSegments(selectedName);
$: downloadHref = encName
? `${API}/downloads/${encName}?token=${localStorage.getItem("token") || ""}`
: "#";
$: selectedLabel = selectedVideo?.episode
? `${selectedVideo.show.title} · ${formatEpisodeCode(
selectedVideo.episode
@@ -414,8 +424,9 @@ async function openVideoAtIndex(index) {
function getVideoURL() {
if (!selectedName) return "";
const token = localStorage.getItem("token");
// selectedName zaten encode edilmiş, tekrar encode etme
return `${API}/media/${selectedName}?token=${token}`;
const encoded = encodePathSegments(selectedName);
if (!encoded) return "";
return `${API}/media/${encoded}?token=${token}`;
}
function playEpisodeFromCard(episode) {