From 0255a44120642eb3a71b8fc33884b6ad7890db4f Mon Sep 17 00:00:00 2001 From: wisecolt Date: Wed, 4 Feb 2026 00:36:46 +0300 Subject: [PATCH] =?UTF-8?q?fix(client-server):=20rclone=20ve=20miniplayer?= =?UTF-8?q?=20d=C3=BCzeltmeleri?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/src/components/MiniPlayer.svelte | 167 ++++++++++++++++++++++-- client/src/routes/Files.svelte | 131 +++++++++++++------ client/src/routes/Settings.svelte | 2 + client/src/stores/toastStore.js | 4 +- server/server.js | 97 +++++++++++++- 5 files changed, 340 insertions(+), 61 deletions(-) diff --git a/client/src/components/MiniPlayer.svelte b/client/src/components/MiniPlayer.svelte index 3539aac..80de950 100644 --- a/client/src/components/MiniPlayer.svelte +++ b/client/src/components/MiniPlayer.svelte @@ -1,10 +1,23 @@ {#if $musicPlayer.currentTrack && !isMusicRoute} -
+
@@ -78,8 +165,16 @@ {/if}
-
- {cleanFileName($musicPlayer.currentTrack.title)} +
+ {#key $musicPlayer.currentTrack?.id} + + {cleanFileName($musicPlayer.currentTrack.title)} + + {/key}
{sourceLabel($musicPlayer.currentTrack)}
@@ -98,20 +193,20 @@
- - - -
@@ -132,6 +227,12 @@ color: #f6f6f6; backdrop-filter: blur(14px); z-index: 50; + cursor: grab; + touch-action: none; + } + + .mini-player.dragging { + cursor: grabbing; } .mini-top { @@ -140,7 +241,7 @@ .mini-meta { text-align: left; - margin: 0 4px 8px; + margin: 0 4px 8px -4px; } .mini-user-name { @@ -149,6 +250,19 @@ white-space: nowrap; overflow: hidden; text-overflow: ellipsis; + display: block; + position: relative; + max-width: 100%; + min-width: 0; + } + + .mini-user-name .marquee { + display: inline-block; + will-change: transform; + } + + .mini-user-name .marquee.active { + animation: mini-marquee var(--marquee-duration) linear infinite; } .mini-user-handle { @@ -156,6 +270,37 @@ color: rgba(255, 255, 255, 0.6); } + @keyframes mini-marquee { + 0% { + transform: translateX(0); + opacity: 1; + } + 10% { + transform: translateX(0); + opacity: 1; + } + 60% { + transform: translateX(calc(-1 * var(--marquee-shift))); + opacity: 1; + } + 80% { + transform: translateX(calc(-1 * var(--marquee-shift))); + opacity: 1; + } + 84% { + transform: translateX(calc(-1 * var(--marquee-shift))); + opacity: 0; + } + 86% { + transform: translateX(0); + opacity: 0; + } + 100% { + transform: translateX(0); + opacity: 1; + } + } + .mini-cover { margin: -16px -16px 12px; width: calc(100% + 32px); @@ -164,7 +309,7 @@ overflow: hidden; background: rgba(255, 255, 255, 0.06); box-shadow: 0 18px 30px rgba(0, 0, 0, 0.35); - border: 1px solid rgba(255, 255, 255, 0.12); + border: none; display: block; } diff --git a/client/src/routes/Files.svelte b/client/src/routes/Files.svelte index 7ad7bda..071dc93 100644 --- a/client/src/routes/Files.svelte +++ b/client/src/routes/Files.svelte @@ -626,6 +626,25 @@ alert(err?.message || "GDrive taşıma başarısız oldu."); } } + + async function setCategory(entry, category) { + if (!entry?.name) return; + try { + const resp = await apiFetch("/api/file/category", { + method: "POST", + headers: { "Content-Type": "application/json" }, + body: JSON.stringify({ path: entry.name, category }) + }); + const data = await resp.json().catch(() => ({})); + if (!resp.ok || !data?.ok) { + alert(data?.error || "Kategori güncellenemedi."); + return; + } + await loadFiles(); + } catch (err) { + alert(err?.message || "Kategori güncellenemedi."); + } + } function formatSize(bytes) { if (!bytes) return "0 MB"; if (bytes < 1e6) return (bytes / 1e3).toFixed(1) + " KB"; @@ -1301,45 +1320,55 @@ } function matchFile(file) { - if (!file || file.isDirectory) { - closeMenu(); - return; - } - // Dosya adını al (path'in son kısmı) - const fileName = file.name.split('/').pop(); - - // Önce dizi kontrolü yap (SxxExx formatı) - const seriesMatch = fileName.match(/S(\d{1,2})E(\d{1,2})/i); - - if (seriesMatch) { - matchType = "series"; - const { title, year } = extractTitleAndYear(fileName); - matchTitle = title || fileName; - matchYear = year ? String(year) : ""; - } else { - // Film kontrolü (yıl bilgisi) - const { title, year } = extractTitleAndYear(fileName); - - if (year && year >= 1900 && year <= 2099) { - matchType = "movie"; - matchTitle = title || fileName; - matchYear = String(year); - } else { - // Varsayılan olarak film kabul et - matchType = "movie"; - matchTitle = title || fileName; - matchYear = ""; + try { + if (!file || file.isDirectory) { + closeMenu(); + return; } + const rawName = file?.name || file?.displayName || ""; + const fileName = rawName.split("/").pop(); + if (!fileName) { + showToast("Eşleştirilecek dosya adı bulunamadı.", "error"); + closeMenu(); + return; + } + + // Önce dizi kontrolü yap (SxxExx formatı) + const seriesMatch = fileName.match(/S(\d{1,2})E(\d{1,2})/i); + + if (seriesMatch) { + matchType = "series"; + const { title, year } = extractTitleAndYear(fileName); + matchTitle = title || fileName; + matchYear = year ? String(year) : ""; + } else { + // Film kontrolü (yıl bilgisi) + const { title, year } = extractTitleAndYear(fileName); + + if (year && year >= 1900 && year <= 2099) { + matchType = "movie"; + matchTitle = title || fileName; + matchYear = String(year); + } else { + // Varsayılan olarak film kabul et + matchType = "movie"; + matchTitle = title || fileName; + matchYear = ""; + } + } + + matchingFile = file; + showMatchModal = true; + closeMenu(); + + // Modal açıldıktan sonra otomatik arama yap + tick().then(() => { + searchMetadata(); + }); + } catch (err) { + showToast("Eşleştirme penceresi açılamadı.", "error"); + closeMenu(); } - - matchingFile = file; - showMatchModal = true; - closeMenu(); - - // Modal açıldıktan sonra otomatik arama yap - tick().then(() => { - searchMetadata(); - }); } function closeMatchModal() { @@ -1370,6 +1399,10 @@ params.set("year", matchYear); } + const token = localStorage.getItem("token"); + if (token) { + params.set("token", token); + } const response = await apiFetch(`/api/search/metadata?${params}`); if (response.ok) { @@ -1486,8 +1519,6 @@ function closeMenu() { activeMenu = null; deleteConfirmPending = false; - showMatchModal = false; - matchingFile = null; } // Klasör oluşturma fonksiyonları @@ -2395,6 +2426,20 @@ Eşleştir + +