Commit graph

781 commits

Author SHA1 Message Date
TonyBlur
d03e4eccfb fix: hide Download Folder input when CUSTOM_DIRS is disabled 2026-06-04 21:23:28 +08:00
TonyBlur
9eb38ca52c fix: remove orphan div tags from merge conflict resolution 2026-06-04 16:42:41 +08:00
TonyBlur
28345800bd Merge upstream/master: integrate upstream UI improvements 2026-06-04 16:20:52 +08:00
Alex Shnitman
897d52cd0d styling improvements 2026-05-30 15:35:52 +03:00
Alex Shnitman
baa72c0e94 fix pnpm upgrade to the correct package age limit 2026-05-29 14:36:05 +03:00
Alex Shnitman
66d8fa570b Merge branch 'pr-977' 2026-05-29 14:14:05 +03:00
Alex Shnitman
cf2d2dd465 review fixes 2026-05-29 14:13:47 +03:00
Alex Shnitman
0b5617e96c Merge branch 'pr-990' (iOS Web Share for completed downloads) 2026-05-29 13:25:22 +03:00
Alex Shnitman
56c0ad3b5f fix catch 2026-05-29 13:23:25 +03:00
Alex Shnitman
4478d1394e upgrade dependencies 2026-05-29 13:20:04 +03:00
Helmut
ad92607a21 fix(ui): drop redundant tooltip on share button
iOS doesn't have hover, so the tooltip only ever showed on desktop —
where the share-arrow glyph is universally recognised anyway. Aria-
label stays for screen readers.
2026-05-29 05:24:49 +02:00
Helmut
6ff364aacf feat(ui): warn before share + surface failures for large files
Web Share fails silently when iOS' share sheet refuses the payload,
typically because the file exceeds the platform's soft size limit
(~50–100 MB depending on iOS version). The previous patch logged to
the console but the user saw nothing — staring at a button that
'does nothing' is poor UX.

Adds two layers of feedback:

1. Pre-flight size check (SHARE_SIZE_WARN_BYTES = 80 MB, conservative
   relative to iOS' actual limit) with a confirm() dialog before the
   fetch. Avoids spending bandwidth pulling a 150 MB blob into the
   browser only for navigator.canShare to reject it.

2. Surfaces canShare-rejection AND share()-failure as a visible
   alert() suggesting the user fall back to the download link next
   to the share button.

Tested locally with files from 0.7 MB up to 150.7 MB: small files
share unchanged, the 150 MB file now produces a pre-flight warning
the user can dismiss, and any subsequent rejection produces a clear
alert instead of silently no-op'ing.
2026-05-29 04:56:52 +02:00
Helmut
39a8948976 feat(ui): add iOS Web Share button next to download link
Adds a share button to the completed-list action row that hands the
downloaded file off to the platform share sheet via navigator.share().
On iOS Safari/Chrome this surfaces the native Save-to-Photos / Save-to-
Files / AirDrop options for videos and images, and Files / 3rd-party
app targets for audio. On platforms without Web Share support (Desktop
Firefox/Chrome/Safari) the button hides itself; the existing download
link remains the universal fallback.

Implementation notes:
- canShareDownloads() requires both navigator.share AND navigator.canShare
  (Desktop Safari has the former without the latter; we always intend
  to share a file, not a URL)
- shareDownload() fetches the file via the existing buildDownloadLink()
  helper, wraps it in a File, then runs canShare() before share() so we
  can bail out cleanly on platforms that reject the MIME type
- AbortError (user dismisses sheet) is silenced; other errors logged
- Tooltip on the button explains the iOS behaviour briefly

Refs alexta69/metube#582 — addresses the 'add to Photos.app' request
without depending on the iOS Shortcut, which has had reliability issues
(cf #763).
2026-05-28 07:34:13 +02:00
TonyBlur
736de16265 fix(ci): streamline upstream sync workflow by removing unnecessary steps and updating checkout action 2026-05-26 09:06:21 +08:00
TonyBlur
33bd1e3b08 fix(ci): replace UPSTREAM_TOKEN with GITHUB_TOKEN for checkout authentication 2026-05-26 08:45:13 +08:00
TonyBlur
6f2e31a764 fix(ci): use GITHUB_TOKEN instead of UPSTREAM_TOKEN for target repo authentication 2026-05-26 08:41:05 +08:00
github-actions[bot]
c76fd73abe fix(ci): Update actions/checkout and Fork-Sync-With-Upstream-action versions in sync-upstream workflow 2026-05-26 07:58:17 +08:00
TonyBlu
5d3170e8c9 Merge branch 'auto-download-pause-resume' 2026-05-25 22:58:02 +08:00
TonyBlu
736e773362 ci: reduce sync frequency from every 6h to weekly (Sunday 00:00) 2026-05-25 22:57:41 +08:00
TonyBlu
764114f5da Merge branch 'auto-download-pause-resume' 2026-05-25 22:50:33 +08:00
TonyBlu
0b66872d6b fix(ci): use UPSTREAM_TOKEN for both checkout and sync push
GITHUB_TOKEN cannot push commits that contain changes to
.github/workflows/ files (GitHub security restriction).
Use a Classic PAT with 'repo' + 'workflow' scopes instead.

Also add explicit checkout with fetch-depth:0 and ref:master
so the Fork-Sync action has full history for merging.
2026-05-25 22:50:00 +08:00
TonyBlu
d81d6654e5 fix(ci): resolve merge conflict in sync-upstream workflow 2026-05-25 22:39:29 +08:00
TonyBlu
e7f816a5bd fix(ci): align sync workflow with lobehub reference, use GITHUB_TOKEN
Revert to actions-cool/issues-helper and aormsby/Fork-Sync-With-Upstream-action
(matching lobehub/lobehub upstream sync pattern) with pinned SHA for v3.7.6.
Uses GITHUB_TOKEN which works when repo Settings > Actions > Workflow permissions
is set to 'Read and write permissions'.
2026-05-25 22:38:25 +08:00
TonyBlu
11c6f53468 fix(ci): resolve merge conflict, use PAT-only token for fork sync 2026-05-25 22:31:07 +08:00
TonyBlu
c0e7232a64 fix(ci): require UPSTREAM_TOKEN PAT for fork sync push
GITHUB_TOKEN cannot push to fork repos in scheduled workflows.
Remove the GITHUB_TOKEN fallback so the workflow fails explicitly
when UPSTREAM_TOKEN is missing, instead of silently 403-ing.
Also add issues:write permission and git user config for merges.
2026-05-25 22:29:58 +08:00
TonyBlu
ad12521ea4 fix(ci): rewrite sync-upstream workflow to avoid third-party actions
Replace actions-cool/issues-helper and aormsby/Fork-Sync-With-Upstream-action
with native git commands and actions/github-script. This fixes the
'Repository access blocked' error caused by GitHub restricting access
to third-party actions in fork repositories.
2026-05-25 22:27:32 +08:00
TonyBlu
a85a564ed5 fix(ci): rewrite sync-upstream workflow to avoid third-party actions
Replace actions-cool/issues-helper and aormsby/Fork-Sync-With-Upstream-action
with native git commands and actions/github-script. This fixes the
'Repository access blocked' error caused by GitHub restricting access
to third-party actions in fork repositories.
2026-05-25 22:26:01 +08:00
TonyBlu
6e65441eba
Merge pull request #4 from TonyBlur/auto-download-pause-resume
feat: support auto download, pause and resume and download phase label
2026-05-25 22:10:59 +08:00
TonyBlu
33e6ae3388 fix: clear() deletes chapter/subtitle files + persist subtitle_files
Bug fixes from full codebase review:
- clear() with DELETE_FILE_ON_TRASHCAN now also deletes chapter_files
  and subtitle_files, not just the primary filename
- _PERSISTED_DOWNLOAD_FIELDS now includes 'subtitle_files' so subtitle
  file info survives app restart

Tests:
- Added test_subtitle_lang_list_with_region_variant_input (zh-Hans)
- Added test_subtitle_lang_list_dedup_region_variant (pt-BR)
2026-05-25 21:51:37 +08:00
TonyBlu
6d890021a6 feat(captions): P1/P2 improvements - region variant fallback, DownloadInfo init, subtitle_files UI
P1 fixes:
- _subtitle_lang_list now extracts base language from qualified tags
  (e.g. zh-Hans → zh base) so regional variants are still added as
  fallbacks. Original input is preserved as first priority.
- DownloadInfo.__init__ now explicitly initializes filename=None and
  chapter_files=[] to avoid AttributeError on dynamic attribute access.
- __setstate__ adds filename=None migration for old persistent data.
- Frontend Download interface gains subtitle_files field; completed
  downloads show each subtitle file with download link and CC icon.

P2 improvements:
- _LANGUAGE_REGION_VARIANTS expanded from 10 to 30 languages covering
  it/ja/ko/hi/th/vi/id/pl/uk/ru/cs/sv/da/no/fi/tr/el/he/hu/bn/ta.
- Languages with no regional variants use empty tuple (they still get
  -orig suffix when include_orig=True).
2026-05-25 21:48:27 +08:00
TonyBlu
b31f4e2fea fix(tests): update subtitle language list assertions for variant fallback
Update test expectations to match the new _subtitle_lang_list() output
which includes regional variants (e.g. fr-FR, en-GB) for better
subtitle matching.
2026-05-25 21:27:10 +08:00
TonyBlu
b25a2ad80a fix(captions): use getattr for filename check in _post_download_cleanup
DownloadInfo doesn't have a 'filename' attribute by default — it's only
set dynamically in update_status when a 'downloaded' status is received.
When captions are silently skipped by yt-dlp (no matching language), the
'downloaded' status is never emitted, so 'filename' doesn't exist on the
object at all. Using getattr(download.info, 'filename', None) instead of
direct attribute access prevents AttributeError.
2026-05-25 21:23:06 +08:00
TonyBlu
36b397ae93 fix(captions): add language variant fallback + error on no files
Two fixes for captions downloads:

1. Language variant fallback: When user requests 'en' but the video only
   has 'en-GB' (or other regional variants), yt-dlp silently skips
   subtitle extraction because it uses exact language matching. Now the
   subtitleslangs list includes common regional variants (e.g. en-US,
   en-GB, en-AU, etc.) so yt-dlp can match the first available variant.

2. Error on no files: When yt-dlp completes successfully (ret=0) but
   produces no subtitle files (e.g. no matching language at all), the
   download was incorrectly shown as 'completed'. Now it's marked as
   'error' with a descriptive message like 'No subtitles found for
   language "en"'. Same treatment for thumbnail downloads.
2026-05-25 21:16:10 +08:00
TonyBlu
e639caa21d fix: Codex review P2 issues + frontend test failure
- Reset download_phase when transitioning to paused (pause(), update_status(),
  _post_download_cleanup()) so UI shows 'Paused' instead of stale phase label
- Reset download_phase when starting/resuming download (start() preparing state)
- Count 'postprocessing' as active download in updateMetrics() so dashboard
  shows accurate counts during ffmpeg post-processing
- Add missing completedDownload Subject to DownloadsServiceStub in app.spec.ts
- Add Download type import to app.spec.ts

Fixes: TypeError Cannot read properties of undefined (reading 'pipe')
       at app.ts:300 (completedDownload not in test stub)
2026-05-25 20:09:17 +08:00
TonyBlu
03cee14948 fix: download phase label not working during downloads
- _download_phase_from_status now falls back to checking requested_formats
  when top-level vcodec/acodec are both 'none' (common when yt-dlp uses
  separate downloaders for video+audio streams)
- Clear download_phase on download completion/error (was persisting stale
  phase value in finished state)
- Add debug logging in put_status for phase detection
- Update docker-compose.local.yml to match docker-compose.yml structure
  with local image build (adds TARGETARCH build arg)
2026-05-25 19:45:43 +08:00
TonyBlur
0791d08e7b Add local compose debug setup 2026-05-25 17:16:28 +08:00
TonyBlur
6e161f4b4b Add auto download and pause resume controls 2026-05-25 16:28:15 +08:00
Sean McCollum
f0348581c2 remove circle and make labels with help text have an underline 2026-05-25 00:13:12 -07:00
github-actions[bot]
e9243f65de
fix: Fixed audio file suffix when quality is 'best' and minor UI fixes 2026-05-18 19:56:08 +00:00
TonyBlur
0311df0b06 fix: Fixed audio file suffix when quality is 'best' and minor UI fixes 2026-05-07 07:25:54 +08:00
TonyBlur
8723ab0afe fix: Fixed suffix when quality is 'best' 2026-05-06 14:03:05 +08:00
TonyBlur
de11f5c638 fix: Clear buttons now effective immediately
- Updated navbar to fit theme
- Updated workflow
- Fixed clear buttons not effective immediately
2026-05-06 10:41:49 +08:00
Sean McCollum
e2773db65a make ui more mobile mobile-friendly
Remove popovers and replace with question icons you have to click
Replace combobox in output > Download Folder with an autocomplete
2026-05-04 10:42:17 -07:00
TonyBlur
5639b5432c fix: configure QEMU for multi-platform builds 2026-05-04 14:49:48 +08:00
TonyBlur
c755f394d1 feat: update icons, add suffix and fix bugs
- Removed shadow from URL entry wrap in app.html for a cleaner look.
- Updated various icon files to improve visual consistency across the application.
- Add suffix to identify different files of same video
- Fixed invisible download for short link

Co-authored-by: Copilot <copilot@github.com>
2026-05-04 14:14:26 +08:00
TonyBlur
eb43d4655d Update DockerHub password secret to use DOCKERHUB_TOKEN 2026-05-01 15:05:22 +08:00
TonyBlur
44e3b7d0cb Specify dynamic platform for Node.js builder in Dockerfile 2026-05-01 14:47:54 +08:00
TonyBlur
87f8d50544 Specify platform for Node.js builder in Dockerfile 2026-05-01 14:37:10 +08:00
TonyBlur
e0a10eea52 Add step to prepare lowercase GHCR repository name in CI workflow 2026-05-01 14:30:32 +08:00
TonyBlur
85fd7e0328 Fix browser path in test environment setup to reflect project name change 2026-05-01 13:31:59 +08:00