diff --git a/CHANGELOG.md b/CHANGELOG.md index 2680c6a..273da37 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,14 @@ - Desktop/mobile lyrics view following playback, individual track previews, availability icons, and local version editing in the admin track editor. +## v0.16.5 — 2026-11-24 + +- Downloads opens with transfer activity across torrents, YouTube and local + files. Filter by status or open a job to see its details. +- On phones, torrent file selection has a dedicated scrollable view with the + download action in reach. Uploads awaiting review remain accessible from + the same manager. + ## v0.16.4 — 2026-11-24 - Artist, playlist and release pages immediately show the outline of the artwork diff --git a/Cargo.lock b/Cargo.lock index 822d756..468429c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2062,7 +2062,7 @@ checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" [[package]] name = "furumusic" -version = "0.16.4" +version = "0.16.5" dependencies = [ "anyhow", "async-stream", diff --git a/Cargo.toml b/Cargo.toml index aa28015..ac7fbe1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "furumusic" -version = "0.16.4" +version = "0.16.5" edition = "2024" description = "Reusable web-app boilerplate: auth, OIDC/SSO, admin panel, user management, i18n, PostgreSQL" diff --git a/src/i18n/phrases.rs b/src/i18n/phrases.rs index 545fee4..6aa9e51 100644 --- a/src/i18n/phrases.rs +++ b/src/i18n/phrases.rs @@ -515,6 +515,18 @@ translations! { // Player download/history UI player_torrent_manager: "Download Manager" , "Менеджер загрузок"; + player_download_title: "Downloads", "Загрузки"; + player_download_overview: "Overview", "Обзор"; + player_download_add: "Add", "Добавить"; + player_download_imports: "Imports", "Импорт"; + player_download_activity: "Recent activity", "Последние загрузки"; + player_download_filter_all: "All statuses", "Все статусы"; + player_download_filter_active: "In progress", "В работе"; + player_download_filter_attention: "Needs attention", "Требуют внимания"; + player_download_filter_history: "Finished", "Завершённые"; + player_download_empty: "No downloads yet", "Загрузок пока нет"; + player_download_empty_filter: "No downloads with this status", "Нет загрузок с таким статусом"; + player_download_more: "Show more", "Показать ещё"; player_import_torrent: "Open Download Manager" , "Открыть менеджер загрузок"; player_youtube: "YouTube" , "YouTube"; player_torrents: "Torrents" , "Торренты"; @@ -531,6 +543,7 @@ translations! { player_youtube_clear_selection: "Clear selection" , "Снять все"; player_youtube_selected_count: "selected" , "выбрано"; player_import_destination: "Add downloads to a playlist" , "Добавить загруженное в плейлист"; + player_download_playlist_label: "Playlist" , "Плейлист"; player_import_destination_hint: "Selected audio tracks will be added automatically after processing, including tracks already in the library." , "Выбранные аудиотреки будут добавлены автоматически после обработки, включая уже имеющиеся в библиотеке."; player_youtube_destination: "Add imported tracks to playlist" , "Добавить импортированные треки в плейлист"; player_youtube_no_destination: "Do not add to a playlist" , "Не добавлять в плейлист"; @@ -680,6 +693,7 @@ translations! { player_failed: "Failed" , "Ошибка"; player_paused: "Paused" , "Пауза"; player_no_torrent_selected: "No torrent selected" , "Торрент не выбран"; + player_no_torrent_files: "No files available" , "Нет доступных файлов"; player_downloaded: "Downloaded" , "Загружено"; player_speed: "Speed" , "Скорость"; player_down: "down" , "вниз"; diff --git a/templates/player.html b/templates/player.html index 2baf732..4f9dab4 100644 --- a/templates/player.html +++ b/templates/player.html @@ -23,6 +23,13 @@ if ('serviceWorker' in navigator) { {% include "player/sidebar_styles.html" %} {% include "player/collection_styles.html" %} {% include "player/listening_styles.html" %} +{% if downloads_enabled %} + +{% endif %} {% endblock head_extra %} {% block body %} @@ -41,5 +48,6 @@ if ('serviceWorker' in navigator) { {% include "player/playlist_header_scripts.html" %} {% include "player/playlist_filter_scripts.html" %} {% include "player/scripts.html" %} +{% if downloads_enabled %}{% include "player/download_manager_scripts.html" %}{% endif %} {% endblock body %} diff --git a/templates/player/download_destination.html b/templates/player/download_destination.html new file mode 100644 index 0000000..c64484a --- /dev/null +++ b/templates/player/download_destination.html @@ -0,0 +1,39 @@ +
+
+ + + + + {% if kind == "youtube" %}{{ t.player_youtube_destination_hint }}{% else %}{{ t.player_import_destination_hint }}{% endif %} + + +
+
+ + +
+
diff --git a/templates/player/download_files.html b/templates/player/download_files.html new file mode 100644 index 0000000..901d656 --- /dev/null +++ b/templates/player/download_files.html @@ -0,0 +1,73 @@ + + diff --git a/templates/player/download_imports.html b/templates/player/download_imports.html new file mode 100644 index 0000000..4f3a00f --- /dev/null +++ b/templates/player/download_imports.html @@ -0,0 +1,204 @@ + diff --git a/templates/player/download_manager.css b/templates/player/download_manager.css new file mode 100644 index 0000000..21a9847 --- /dev/null +++ b/templates/player/download_manager.css @@ -0,0 +1,129 @@ +.downloads-dialog { + --download-gutter: clamp(14px, 2vw, 24px); + position: fixed; inset: 0; margin: 0; width: 100%; height: 100%; + max-width: none; max-height: none; padding: 16px; border: 0; + background: transparent; color: var(--text-primary); color-scheme: dark; +} +.downloads-dialog[open] { display: grid; place-items: center; } +.downloads-dialog::backdrop { background: rgb(0 0 0 / .68); } +.downloads-shell { + display: flex; flex-direction: column; width: min(960px, 100%); height: min(670px, 88dvh); + min-height: 0; overflow: hidden; border: 1px solid var(--bg-active); border-radius: 14px; + background: var(--bg-secondary); box-shadow: 0 16px 64px #0006; +} +.downloads-shell :is(button,input,select,summary,[tabindex]):focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; } +.downloads-head { + display: flex; align-items: center; flex: none; gap: 12px; padding: 12px var(--download-gutter); + border-bottom: 1px solid var(--border-color); +} +.downloads-head h2 { flex: 1; min-width: 0; margin: 0; font-size: 21px; line-height: 1.2; } +.downloads-head h2:focus { outline: none; } +.downloads-head svg, .downloads-nav svg, .download-activity-row svg, .downloads-empty svg, +.download-icon-button svg, .download-button svg { + width: 17px; height: 17px; flex: none; fill: none; stroke: currentColor; + stroke-width: 1.7; stroke-linejoin: round; stroke-linecap: round; +} +.downloads-head .downloads-mark { color: var(--accent); width: 22px; height: 22px; } +.download-button, .download-icon-button { + display: inline-flex; align-items: center; justify-content: center; gap: 6px; + min-height: 34px; padding: 5px 11px; border: 1px solid var(--bg-active); border-radius: 7px; + background: var(--bg-elevated); color: var(--text-primary); cursor: pointer; font: inherit; font-size: 13px; font-weight: 600; +} +.download-icon-button { width: 34px; flex: none; padding: 0; border-color: transparent; background: transparent; color: var(--text-secondary); } +.download-button:hover, .download-icon-button:hover { background: var(--bg-hover); color: var(--text-primary); } +.download-button.primary { border-color: transparent; background: var(--accent); color: #081a0e; } +.download-button.primary:hover { background: var(--accent-hover); } +.downloads-shell button:disabled { opacity: .45; cursor: default; } +.downloads-shell :is(.download-field,.upload-field input:not([type=checkbox]),.upload-field select,.upload-field textarea,.upload-bulk-bar input,.upload-bulk-bar select), +.download-list-heading select { + min-height: 35px; padding: 6px 9px; border: 1px solid var(--bg-active); border-radius: 6px; + background: var(--bg-primary); color: var(--text-primary); font: inherit; font-size: 13px; +} +.downloads-add { position: relative; } +.downloads-add-menu { + position: absolute; z-index: 8; inset: calc(100% + 5px) 0 auto auto; min-width: 154px; padding: 4px; + border: 1px solid var(--bg-active); border-radius: 8px; background: var(--bg-elevated); box-shadow: 0 8px 22px #0006; +} +.downloads-add-menu button, .downloads-nav button { + display: flex; align-items: center; gap: 9px; width: 100%; padding: 8px 10px; border: 0; border-radius: 6px; + color: var(--text-secondary); background: transparent; cursor: pointer; font: inherit; font-size: 13px; text-align: start; +} +.downloads-add-menu button { color: var(--text-primary); } +.downloads-add-menu button:hover, .downloads-nav button:hover { background: var(--bg-hover); color: var(--text-primary); } +.downloads-layout { display: grid; flex: 1; min-height: 0; grid-template-columns: 148px minmax(0,1fr); } +.downloads-rail { display: flex; flex-direction: column; padding: 12px 8px; border-inline-end: 1px solid var(--border-color); background: var(--bg-primary); min-width: 0; } +.downloads-nav { display: grid; gap: 3px; } +.downloads-nav button { min-height: 38px; } +.downloads-nav button[aria-selected="true"] { color: #a1e6b6; background: #1d3827; } +.downloads-nav button small { margin-inline-start: auto; border-radius: 5px; padding: 1px 4px; background: var(--bg-active); color: var(--text-primary); } +.downloads-worker { display: flex; align-items: center; gap: 7px; margin: auto 5px 0; padding: 10px 5px 0; color: var(--text-secondary); font-size: 11px; } +.downloads-worker i { flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--text-subdued); } +.downloads-worker i.busy { background: var(--accent); } +.downloads-main, .downloads-content { display: flex; flex: 1; min-height: 0; min-width: 0; flex-direction: column; } +.downloads-content > [role=tabpanel] { flex: 1; min-width: 0; min-height: 0; } +.downloads-content > .download-source-pane { padding-top: 15px; } +.downloads-notice { display: flex; align-items: center; gap: 8px; flex: none; border-bottom: 1px solid var(--border-color); padding: 2px var(--download-gutter); font-size: 12px; color: #b5dbbf; } +.downloads-notice span { flex: 1; min-width: 0; overflow-wrap: anywhere; } +.downloads-notice.error { color: #f1abab; } +.download-overview, .downloads-content > .upload-manager-panel { padding: 14px var(--download-gutter); } +.download-overview { overflow: auto; overscroll-behavior: contain; scrollbar-width: thin; } +.download-list-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; } +.download-list-heading h3 { margin: 0; font-size: 16px; } +.download-list-heading select { max-width: 55%; } +.download-activity { list-style: none; padding: 0; margin: 0; } +.download-activity li { border-bottom: 1px solid var(--border-color); } +.download-activity-row { + width: 100%; display: grid; grid-template-columns: auto minmax(0,1fr) auto auto; align-items: center; + gap: 12px; padding: 9px 4px; border: 0; border-radius: 5px; background: transparent; + color: var(--text-primary); font: inherit; text-align: start; cursor: pointer; +} +.download-activity-row:hover { background: var(--bg-hover); } +.download-source-icon { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 7px; color: var(--text-secondary); background: var(--bg-elevated); } +.download-job-title, .download-job-status { display: grid; gap: 3px; min-width: 0; } +.download-job-title strong,.download-job-title small { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; } +.download-job-title strong { font-size: 14px; font-weight: 600; } +.download-job-title small,.download-job-status { font-size: 12px; color: var(--text-secondary); } +.download-job-status { justify-items: end; text-align: end; max-width: 18ch; } +.download-job-status[data-group=active] { color: #9adeb0; } +.download-job-status[data-group=attention] { color: #e3c694; } +.download-job-status progress { width: 52px; height: 4px; accent-color: var(--accent); } +.download-more { margin-top: 12px; } +.downloads-empty { display: grid; justify-items: center; gap: 12px; padding: clamp(32px,9vh,84px) 10px; color: var(--text-secondary); text-align: center; } +.downloads-empty svg { width: 30px; height: 30px; } +.downloads-empty p { margin: 0; font-size: 14px; } +.downloads-shell .upload-manager-grid { grid-template-columns: minmax(0,1fr); } +.downloads-shell .upload-manager-grid.has-reviews { grid-template-columns: minmax(185px, .6fr) minmax(0,1.4fr); } +.downloads-shell .upload-library-column { min-width: 0; } +.downloads-shell .upload-manager-head p { color: var(--text-secondary); } +@media (prefers-reduced-motion: no-preference) { + .downloads-shell, .downloads-content > [role=tabpanel] { animation: download-pane-in 140ms ease-out; } + @keyframes download-pane-in { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: none; } } +} +@media(max-width: 650px) { + .downloads-dialog { padding: 0; --download-gutter: 12px; } + .downloads-shell { width: 100%; height: 100dvh; border: 0; border-radius: 0; padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); } + .downloads-head { gap: 6px; padding: 7px var(--download-gutter); } + .downloads-head h2 { font-size: 18px; } + .download-button,.download-icon-button { min-height: 40px; } + .downloads-head .download-icon-button { width: 40px; } + .downloads-add-menu button { min-height: 40px; } + .downloads-layout { display: flex; flex-direction: column; } + .downloads-rail { flex: none; padding: 0 4px; border: 0; border-bottom: 1px solid var(--border-color); } + .downloads-nav { grid-auto-flow: column; grid-auto-columns: minmax(0,1fr); gap: 0; } + .downloads-nav button { position: relative; flex-direction: column; justify-content: center; gap: 2px; padding: 4px 1px; min-height: 44px; font-size: 11px; text-align: center; } + .downloads-nav button[aria-selected="true"] { border-radius: 0; box-shadow: inset 0 -2px var(--accent); background: transparent; } + .downloads-nav button small { position: absolute; inset: 1px 1px auto auto; } + .downloads-worker { display: none; } + .download-overview, .downloads-content > .upload-manager-panel { padding-top: 10px; } + .download-activity-row { gap: 7px; } + .download-job-status { max-width: 11ch; } + .download-job-title strong { font-size: 13px; } + .downloads-content > .upload-manager-panel { display: block; overflow: auto; overscroll-behavior: contain; } + .downloads-shell .upload-manager-grid { display: flex; flex-direction: column; overflow: visible; } + .downloads-shell :is(.upload-library-column,.upload-review-column) { overflow: visible; max-height: none; padding: 0; } + .downloads-shell input.download-field { font-size: 16px; } +} +@media (max-height: 480px) { + .downloads-dialog { padding: 0; } + .downloads-shell { height: 100dvh; } +} diff --git a/templates/player/download_manager.html b/templates/player/download_manager.html new file mode 100644 index 0000000..9091c44 --- /dev/null +++ b/templates/player/download_manager.html @@ -0,0 +1,62 @@ + diff --git a/templates/player/download_manager_scripts.html b/templates/player/download_manager_scripts.html new file mode 100644 index 0000000..d8df604 --- /dev/null +++ b/templates/player/download_manager_scripts.html @@ -0,0 +1,91 @@ + diff --git a/templates/player/download_overview.html b/templates/player/download_overview.html new file mode 100644 index 0000000..46a38a0 --- /dev/null +++ b/templates/player/download_overview.html @@ -0,0 +1,39 @@ + diff --git a/templates/player/download_sources.css b/templates/player/download_sources.css new file mode 100644 index 0000000..3c260b3 --- /dev/null +++ b/templates/player/download_sources.css @@ -0,0 +1,146 @@ +.download-source-pane { + display: flex; + flex-direction: column; + gap: 16px; + min-width: 0; + min-height: 0; + height: 100%; + padding: 0 var(--download-gutter, 16px) 16px; + overflow-y: auto; + overscroll-behavior: contain; + scrollbar-width: thin; +} +.download-source-pane > * { flex: none; min-width: 0; } +.download-link-form { display: grid; gap: 6px; } +.download-link-form label, .download-destination-label label { font-size: 13px; font-weight: 600; color: var(--text-secondary); } +.download-link-controls { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px; } +.download-link-controls input, .download-destination-fields :is(select,input) { min-width: 0; width: 100%; } +.download-destination { + display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; + column-gap: 10px; min-width: 0; +} +.download-destination-label { display: flex; align-items: center; gap: 1px; } +.download-destination-fields { display: flex; min-width: 0; gap: 6px; } +.download-destination-fields > :is(select, input) { flex: 1 1 0; } +.download-playlist-help { position: relative; display: inline-flex; } +.download-help-button { + display: grid; place-items: center; width: 28px; height: 30px; + border: 0; background: none; border-radius: 5px; color: var(--text-secondary); cursor: help; +} +.download-help-button:hover { color: var(--text-primary); background: var(--bg-hover); } +.download-playlist-help [role=tooltip] { + position: absolute; inset-block-end: calc(100% + 3px); inset-inline-start: -42px; + width: min(240px, 65vw); z-index: 4; padding: 8px 10px; + background: var(--bg-active); color: var(--text-primary); border: 1px solid var(--border-color); + box-shadow: 0 4px 15px #0006; border-radius: 6px; font-size: 12px; line-height: 1.45; +} +.download-source-history { min-width: 0; } +.download-history-heading, .download-preview-title, .download-selection-actions, .download-job-actions, .download-pick-actions { + display: flex; align-items: center; gap: 8px; +} +.download-history-heading, .download-preview-title { justify-content: space-between; } +.download-history-heading { padding-bottom: 5px; border-bottom: 1px solid var(--border-color); } +.download-history-heading h4, .download-preview-title h4 { margin: 0; color: var(--text-primary); font-size: 14px; font-weight: 650; line-height: 1.35; } +.download-source-empty { margin: 0; padding: 15px 0; color: var(--text-secondary); font-size: 13px; } +.download-preview-title { min-width: 0; } +.download-preview-title h4 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } +.download-preview-title > span { flex: none; color: var(--text-secondary); font-size: 12px; font-variant-numeric: tabular-nums; } +.download-video-preview, .download-local-selection { display: grid; gap: 10px; min-width: 0; } +.download-video-picker { min-width: 0; border-block: 1px solid var(--border-color); } +.download-video-all, .download-video-row { + display: flex; align-items: center; gap: 9px; min-width: 0; min-height: 35px; + padding: 5px 8px; cursor: pointer; font-size: 13px; +} +.download-video-all { background: var(--bg-secondary); font-weight: 600; } +.download-video-row:hover, .download-job-summary:hover { background: var(--bg-hover); } +.download-video-all input, .download-video-row input { flex: none; width: 16px; height: 16px; margin: 0; accent-color: var(--accent); } +.download-video-list { max-height: min(42dvh, 410px); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; } +.download-video-row > :last-child { overflow-wrap: anywhere; } +.download-video-index, .download-job-progress-number { color: var(--text-secondary); font-size: 12px; font-variant-numeric: tabular-nums; } +.download-selection-actions { justify-content: end; flex-wrap: wrap; } +.download-local-drop { + display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 16px; + padding: 12px; border: 1px dashed var(--bg-active); border-radius: 8px; background: var(--bg-primary); + transition: border-color 140ms, background 140ms; +} +.download-local-drop.dragging { border-color: var(--accent); background: #1db95410; } +.download-local-lead { display: flex; align-items: center; gap: 10px; min-width: 0; } +.download-local-lead > svg { width: 21px; height: 21px; color: var(--text-secondary); } +.download-source-pane svg { fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; flex: none; } +.download-local-lead strong, .download-local-lead small, .download-job-name strong, .download-job-name small, .download-item-main > :is(strong,small) { display: block; } +.download-local-lead strong { font-size: 13px; } +.download-local-lead small, .download-job-name small, .download-item-main > small { color: var(--text-secondary); font-size: 12px; line-height: 1.4; } +.download-local-lead .download-local-mobile { display: none; } +.download-job, .download-file-job { border-bottom: 1px solid var(--border-color); } +.download-job-summary, .download-file-job, .download-track-details summary { + display: grid; grid-template-columns: 18px minmax(0, 1fr) auto auto; + align-items: center; gap: 10px; min-width: 0; padding: 8px 4px; +} +.download-job-summary { + width: 100%; text-align: start; border: 0; border-radius: 4px; + background: transparent; color: var(--text-primary); cursor: pointer; font: inherit; +} +.download-job-chevron, .download-file-symbol { width: 16px; height: 16px; color: var(--text-secondary); } +.download-job-chevron { transition: transform 140ms; } +.download-job-summary[aria-expanded=true] .download-job-chevron { transform: rotate(90deg); } +.download-job-summary :is(strong, small), .download-file-job :is(strong, small) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } +.download-job-name { min-width: 0; } +.download-job-name strong, .download-item-main > strong { font-size: 13px; font-weight: 600; } +.download-job-detail { display: grid; gap: 8px; padding: 3px 5px 12px 32px; } +.download-job-disclosure { display: grid; grid-template-rows: 0fr; opacity: 0; } +.download-job-disclosure.opened { grid-template-rows: 1fr; opacity: 1; } +.download-job-disclosure > div { min-height: 0; overflow: hidden; } +@media (prefers-reduced-motion: no-preference) { + .download-job-disclosure { transition: grid-template-rows 140ms ease, opacity 140ms; } +} +.download-source-progress { display: grid; gap: 4px; color: var(--text-secondary); font-size: 12px; } +.download-source-progress div { display: flex; justify-content: space-between; gap: 8px; } +.download-source-progress progress { display: block; width: 100%; height: 4px; border: 0; border-radius: 3px; background: var(--bg-active); color: var(--accent); accent-color: var(--accent); } +.download-source-progress progress::-webkit-progress-bar { background: var(--bg-active); border-radius: 3px; } +.download-source-progress progress::-webkit-progress-value { background: var(--accent); border-radius: 3px; } +.download-source-progress progress::-moz-progress-bar { background: var(--accent); border-radius: 3px; } +.download-job-items { display: grid; margin: 0; padding: 0; list-style: none; } +.download-track-details summary { grid-template-columns: auto minmax(0, 1fr) auto; align-items: start; padding-inline: 0; cursor: pointer; list-style: none; } +.download-track-details summary::-webkit-details-marker { display: none; } +.download-track-details summary:hover { color: var(--accent-hover); } +.download-track-details summary .torrent-status-badge::after { + content: ""; display: inline-block; width: 5px; height: 5px; margin: 0 1px 2px 6px; + border: solid currentColor; border-width: 0 1px 1px 0; transform: rotate(45deg); +} +.download-track-details[open] summary .torrent-status-badge::after { transform: rotate(225deg); } +@media (prefers-reduced-motion: no-preference) { + .download-track-details summary .torrent-status-badge::after { transition: transform 140ms; } +} +.download-steps { display: flex; flex-wrap: wrap; gap: 5px 14px; padding: 3px 0 8px; list-style: none; } +.download-steps li { color: var(--text-secondary); font-size: 11px; } +.download-steps li::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-inline-end: 4px; border: 1px solid var(--text-secondary); border-radius: 50%; } +.download-steps li.done::before, .download-steps li.active::before { border-color: var(--accent); } +.download-steps li.done::before { background: var(--accent); } +.download-steps li:is(.failed,.cancelled)::before { border-color: #eba8a8; background: #eba8a8; } +.download-item-main { min-width: 0; overflow-wrap: anywhere; } +.download-job-actions { flex-wrap: wrap; } +.download-source-error { margin: 4px 0 0; overflow-wrap: anywhere; color: #eba8a8; font-size: 12px; } +.download-file-job > .download-source-error { grid-column: 2 / -1; } +.download-file-remove:hover { color: #eba8a8; } +.download-source-pane .torrent-status-badge { max-width: 30ch; font-weight: 600; text-transform: none; white-space: normal; line-height: 1.25; } +@media (max-width: 600px) { + .download-source-pane { gap: 12px; } + .download-link-controls { gap: 5px; } + .download-destination { align-items: start; gap: 6px; } + .download-destination-label { min-height: 38px; } + .download-destination-fields { flex-direction: column; } + .download-destination-fields > :is(select,input) { flex: auto; } + .download-video-list { max-height: 42dvh; } + .download-video-all, .download-video-row { min-height: 40px; } + .download-local-lead .download-local-desktop { display: none; } + .download-local-lead .download-local-mobile { display: block; } + .download-job-summary { grid-template-columns: 14px minmax(0, 1fr) auto; } + .download-job-progress-number { display: none; } + .download-job-detail { padding-inline: 2px; } + .download-job-summary, .download-file-job, .download-track-details summary { gap: 6px; } + .download-source-pane .torrent-status-badge { max-width: 13ch; } +} +@media (prefers-reduced-motion: reduce) { + .download-local-drop, .download-job-chevron { transition: none; } + .download-playlist-help [role=tooltip] { transition-duration: 0s !important; } +} diff --git a/templates/player/download_torrent.css b/templates/player/download_torrent.css new file mode 100644 index 0000000..e7e98de --- /dev/null +++ b/templates/player/download_torrent.css @@ -0,0 +1,106 @@ +.download-torrent-panel { + display: flex; flex: 1 1 auto; flex-direction: column; min-height: 0; height: 100%; min-width: 0; + padding: 0 var(--download-gutter) 12px; overflow: hidden; +} +.torrent-sessions, .torrent-task, .torrent-session-detail { + display: flex; flex: 1 1 auto; flex-direction: column; min-width: 0; min-height: 0; +} +.torrent-task, .torrent-session-detail { overflow-y: auto; overscroll-behavior: contain; } +.torrent-pane-head { + display: flex; align-items: center; gap: 8px; flex: none; min-height: 52px; + padding: 6px 0; border-bottom: 1px solid var(--border-color); +} +.torrent-pane-head h4 { min-width: 0; flex: 1; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 16px; line-height: 1.3; } +.torrent-pane-head h4 small { font-size: 12px; font-weight: 500; color: var(--text-secondary); } +.download-torrent-panel svg { width: 17px; height: 17px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; } +.download-torrent-panel :is(button, input, select, summary, [tabindex="0"]):focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; } +.torrent-sessions-list { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; } +.torrent-pane-empty { margin: 0; padding: 24px 0; color: var(--text-secondary); font-size: 13px; } +.torrent-session-open { + display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 12px; align-items: center; + width: 100%; min-height: 58px; padding: 9px 8px; border: 0; border-bottom: 1px solid var(--border-color); + border-radius: 0; background: transparent; color: var(--text-secondary); text-align: start; font: inherit; cursor: pointer; +} +.torrent-session-open:hover { background: var(--bg-hover); } +.torrent-session-open .torrent-session-icon { width: 20px; height: 20px; } +.torrent-session-copy { display: grid; gap: 4px; min-width: 0; } +.torrent-session-copy :is(strong, small) { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; } +.torrent-session-copy strong { color: var(--text-primary); font-size: 14px; font-weight: 600; } +.torrent-session-copy small, .torrent-transfer-summary small, .torrent-node small { color: var(--text-secondary); font-size: 12px; font-variant-numeric: tabular-nums; } +.download-torrent-panel progress { display: block; width: min(140px, 100%); height: 3px; appearance: none; overflow: hidden; border: 0; border-radius: 4px; background: var(--bg-active); color: var(--accent); } +.download-torrent-panel progress::-webkit-progress-bar { background: var(--bg-active); } +.download-torrent-panel progress::-webkit-progress-value { background: var(--accent); } +.download-torrent-panel progress::-moz-progress-bar { background: var(--accent); } +.torrent-source-form { + flex: none; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; + width: min(100%, 648px); padding: 18px 0; +} +.torrent-source-form .torrent-input-label, .torrent-source-form > input { grid-column: 1 / -1; } +.torrent-source-form .torrent-input-label { margin: 0; color: var(--text-secondary); font-size: 13px; } +.torrent-source-form input[type="text"] { min-width: 0; width: 100%; margin: 0; } +.torrent-source-form .torrent-file-source { + position: relative; display: flex; align-items: center; gap: 8px; justify-self: start; min-width: 0; max-width: 100%; min-height: 36px; + margin: 0; padding: 4px 10px; border: 1px dashed var(--border-color); border-radius: 6px; + color: var(--text-secondary); cursor: pointer; font-size: 13px; +} +.torrent-file-source:hover, .torrent-source-form .torrent-file-source.picked { background: var(--bg-hover); color: var(--text-primary); } +.torrent-file-source:focus-within { outline: 2px solid var(--accent); outline-offset: 1px; } +.torrent-file-source input[type="file"] { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; } +.torrent-file-source span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } +.torrent-file-source small { font-weight: 400; font-size: 12px; color: var(--text-secondary); } +.torrent-transfer-summary { display: flex; align-items: center; gap: 8px; flex: none; min-height: 42px; } +.torrent-live-progress { display: flex; align-items: center; gap: 7px; margin-inline-start: auto; } +.torrent-live-progress progress { width: clamp(22px, 8vw, 100px); } +.torrent-transfer-info { position: relative; margin-inline-start: auto; } +.torrent-transfer-info summary { list-style: none; cursor: pointer; } +.torrent-transfer-info summary::-webkit-details-marker { display: none; } +.torrent-transfer-info dl { position: absolute; z-index: 4; inset: 100% 0 auto auto; width: min(260px, 65vw); margin: 0; padding: 8px 12px; border: 1px solid var(--bg-active); border-radius: 8px; background: var(--bg-elevated); box-shadow: 0 6px 22px #0007; } +.torrent-transfer-info dl > div { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding-block: 4px; font-size: 12px; } +.torrent-transfer-info dt { color: var(--text-secondary); } +.torrent-transfer-info dd { margin: 0; text-align: end; overflow-wrap: anywhere; } +.torrent-selection-tools { + display: flex; align-items: center; justify-content: space-between; gap: 8px; flex: none; min-height: 36px; padding: 0 6px; + background: var(--bg-elevated); border: 1px solid var(--border-color); border-bottom: 0; border-radius: 7px 7px 0 0; +} +.torrent-selection-tools .torrent-master-check { display: flex; align-items: center; gap: 8px; min-height: 36px; margin: 0; cursor: pointer; color: var(--text-secondary); font-size: 12px; font-weight: 500; font-variant-numeric: tabular-nums; } +.torrent-tree-controls { display: flex; } +.download-torrent-panel input[type="checkbox"] { flex: none; width: 16px; height: 16px; margin: 0; accent-color: var(--accent); cursor: pointer; } +.torrent-session-detail .torrent-file-tree { + flex: 1 1 auto; min-height: 100px; margin: 0; overflow: auto; overscroll-behavior: contain; + border: 1px solid var(--border-color); border-radius: 0 0 7px 7px; background: var(--bg-primary); +} +.torrent-file-tree .torrent-tree-row { + display: flex; align-items: stretch; gap: 0; min-height: 35px; padding: 0 9px 0 calc(4px + var(--depth, 0) * 12px); + border-bottom: 1px solid var(--border-color); +} +.torrent-file-tree .torrent-tree-row:last-child { border-bottom: 0; } +.torrent-file-tree .torrent-tree-row:hover { background: var(--bg-hover); } +.torrent-folder-toggle { display: grid; place-items: center; flex: none; width: 28px; padding: 0; border: 0; border-radius: 4px; color: var(--text-secondary); background: transparent; cursor: pointer; } +.torrent-folder-toggle:hover { background: var(--bg-hover); color: var(--text-primary); } +.torrent-folder-toggle svg { width: 14px; height: 14px; transition: transform 120ms ease; } +.torrent-folder-toggle[aria-expanded="true"] svg { transform: rotate(90deg); } +.torrent-file-tree .torrent-node { display: flex; align-items: center; flex: 1; gap: 8px; min-width: 0; margin: 0; color: var(--text-primary); cursor: pointer; font-size: 13px; font-weight: 400; } +.torrent-node span { min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } +.torrent-node svg { color: var(--text-secondary); width: 15px; } +.torrent-node small { white-space: nowrap; } +.torrent-start-bar { display: flex; gap: 12px; align-items: end; justify-content: space-between; flex: none; padding: 10px 0 0; } +.torrent-start-bar .download-destination { flex: 1; min-width: 0; max-width: 510px; } +.torrent-start { flex: none; } +.torrent-loading { overflow: hidden; } +@media(max-width: 600px) { + .torrent-pane-head { min-height: 47px; gap: 4px; } + .torrent-pane-head h4 { font-size: 15px; } + .torrent-session-open { gap: 6px; padding-inline: 3px; } + .torrent-pane-head :is(.download-button,.download-icon-button), .torrent-start, .torrent-file-source { min-height: 40px; } + .torrent-file-source small { display: none; } + .torrent-file-tree .torrent-tree-row { min-height: 40px; padding-inline-start: calc(2px + var(--depth, 0) * 6px); } + .torrent-folder-toggle { width: 32px; } + .torrent-selection-tools .torrent-master-check { min-height: 40px; } + .torrent-start-bar { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; padding-top: 8px; } + .torrent-start-bar .download-destination { max-width: none; } +} +@media (prefers-reduced-motion: no-preference) { + .torrent-task, .torrent-sessions, .torrent-transfer-info[open] dl { animation: torrent-pane-in 130ms ease-out; } + @keyframes torrent-pane-in { from { opacity: 0; transform: translateY(2px); } to { opacity: 1; transform: none; } } +} +@media (prefers-reduced-motion: reduce) { .torrent-folder-toggle svg { transition: none; } } diff --git a/templates/player/download_torrent.html b/templates/player/download_torrent.html new file mode 100644 index 0000000..84186d1 --- /dev/null +++ b/templates/player/download_torrent.html @@ -0,0 +1,156 @@ + diff --git a/templates/player/download_youtube.html b/templates/player/download_youtube.html new file mode 100644 index 0000000..a08feae --- /dev/null +++ b/templates/player/download_youtube.html @@ -0,0 +1,131 @@ + diff --git a/templates/player/modals.html b/templates/player/modals.html index f7733ea..3475b44 100644 --- a/templates/player/modals.html +++ b/templates/player/modals.html @@ -89,885 +89,7 @@ - - + {% if downloads_enabled %}{% include "player/download_manager.html" %}{% endif %}