diff --git a/.env.example b/.env.example index b3f06bf..1d844f8 100644 --- a/.env.example +++ b/.env.example @@ -43,3 +43,27 @@ WEBDAV_PATH=/webdav WEBDAV_READONLY=1 # WebDAV index yeniden oluşturma süresi (ms). WEBDAV_INDEX_TTL=60000 + +# --- Rclone / Google Drive --- +# Rclone entegrasyonunu aç/kapat +RCLONE_ENABLED=0 +# Rclone config dosyası konumu (container içinde) +RCLONE_CONFIG_PATH=/config/rclone/rclone.conf +# Google Drive mount edilecek dizin (container içinde) +RCLONE_MOUNT_DIR=/app/server/gdrive +# Rclone remote adı +RCLONE_REMOTE_NAME=dupe +# Google Drive içinde kullanılacak klasör adı +RCLONE_REMOTE_PATH=Dupe +# Rclone mount tazeleme/poll süresi +RCLONE_POLL_INTERVAL=1m +# Rclone dizin cache süresi +RCLONE_DIR_CACHE_TIME=1m +# Rclone VFS cache modu (off, minimal, writes, full) +RCLONE_VFS_CACHE_MODE=full +# Rclone VFS cache dizini +RCLONE_VFS_CACHE_DIR=/app/server/cache/rclone-vfs +# Rclone debug log (taşıma hatalarını detaylı loglamak için) +RCLONE_DEBUG_MODE_LOG=0 +# Media stream debug log (akış kaynağını loglamak için) +MEDIA_DEBUG_LOG=0 diff --git a/Dockerfile b/Dockerfile index 8cc139e..aa72cb9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,7 +8,7 @@ RUN npm run build # Build server FROM node:22-slim -RUN apt-get update && apt-get install -y ffmpeg curl aria2 && rm -rf /var/lib/apt/lists/* +RUN apt-get update && apt-get install -y ffmpeg curl aria2 rclone fuse3 && rm -rf /var/lib/apt/lists/* RUN curl -L https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp -o /usr/local/bin/yt-dlp \ && chmod a+rx /usr/local/bin/yt-dlp WORKDIR /app/server diff --git a/client/src/routes/Files.svelte b/client/src/routes/Files.svelte index a71a3d2..2332ee7 100644 --- a/client/src/routes/Files.svelte +++ b/client/src/routes/Files.svelte @@ -604,6 +604,27 @@ refreshMovieCount(); refreshTvShowCount(); } + + async function moveToGdrive(entry) { + if (!entry?.name) return; + const ok = confirm("Bu öğe GDrive'a taşınsın mı?"); + if (!ok) return; + try { + const resp = await apiFetch("/api/rclone/move", { + method: "POST", + headers: { "Content-Type": "application/json" }, + body: JSON.stringify({ path: entry.name }) + }); + const data = await resp.json().catch(() => ({})); + if (!resp.ok || !data?.ok) { + alert(data?.error || "GDrive taşıma başarısız oldu."); + return; + } + await loadFiles(); + } catch (err) { + alert(err?.message || "GDrive taşıma başarısız oldu."); + } + } function formatSize(bytes) { if (!bytes) return "0 MB"; if (bytes < 1e6) return (bytes / 1e3).toFixed(1) + " KB"; @@ -1237,7 +1258,7 @@ const button = event.currentTarget; const rect = button.getBoundingClientRect(); const menuWidth = 160; - const menuHeight = 140; // Yaklaşık menü yüksekliği + const menuHeight = 180; // Yaklaşık menü yüksekliği // Üç noktanın son noktası ile menünün sol kenarını hizala // Düğme genişliği 34px, son nokta sağ kenara yakın @@ -2389,6 +2410,14 @@
{/if} + +