Commit graph

106 commits

Author SHA1 Message Date
Daniel
47b8c36594 fix(api): use direct queries when possible 2026-03-20 11:38:31 -05:00
edidealt
affb6dd5de
Merge pull request #350 from DanTheMan827/replace-taglib-wasm
Replace taglib-wasm with taglib-ts
2026-03-19 22:22:38 +02:00
Daniel
895d5dd20f feat(metadata): replace taglib-wasm with @dantheman827/taglib-ts
- feat(taglib): updated audio buffer handling in metadata.js to use Uint8Array.
- feat(taglib): refactored addMetadataToAudio to support return type as Blob or Uint8Array

- feat(taglib): add timeout functionality to metadata functions
  - Introduced `withTimeout` utility function to handle operation timeouts.
  - Updated `addMetadataWithTagLib` to use `withTimeout` for promise resolution.
  - Updated `getMetadataWithTagLib` to use `withTimeout` for promise resolution.
  - Added default timeout parameter to both metadata functions.

- feat(taglib): improve metadata handling with ChunkedByteVectorStream
  - Enhanced metadata handling in taglib.ts and taglib.worker.ts to utilize ChunkedByteVectorStream.

- fix(taglib): handle metadata addition failure gracefully
  - Updated `addMetadataWithTagLib` to catch errors and return original audio data if metadata addition fails.

fix(downloads): return original blob if metadata addition fails
 - Wrap addMetadataToAudio call in try-catch to handle errors.

feat(taglib): add direct calling of taglib methods
  - Introduced `direct` parameter to `addMetadataWithTagLib` and `getMetadataWithTagLib` functions for direct processing in the current thread.
  - Exported taglib worker functions.
2026-03-19 15:14:52 -05:00
Daniel
cd64239ba1 refactor(downloads): add readableStreamIterator for easier stream handling
- Introduced `readableStreamIterator` to convert ReadableStream into async iterable.
- Updated `LosslessAPI` to utilize `readableStreamIterator` for handling response body.
- Modified `ZipNeutralinoWriter` to use `readableStreamIterator` for reading chunks.
2026-03-19 15:12:24 -05:00
Srihari NT
677f515e4d fix(ui): fullscreen volume above taskbar, settings overflow, download progress
- #322: Fullscreen overlay padding and main-view scrollable so volume stays above taskbar when Up next is shown

- #313: Settings tab content constrained on small displays with max-width, min-width, overflow-x

- #278: HEAD request before GET for download to get Content-Length for progress bar; resolveDownloadTotalBytes in downloadProgressUtils.js
2026-03-15 15:41:32 +05:30
Daniel
25c338fac3
refactor: improve progress updates 2026-03-12 20:47:47 +00:00
Daniel
574e42ba1e
feat(downloads): dash progress / remove nearly duplicate downloadTrackBlob logic from downloads.js 2026-03-12 20:47:46 +00:00
edideaur
a776e24aee
Merge pull request #303 from DanTheMan827/copilot/extract-duplicated-code-to-ts
Extract shared download utilities and abstract bulk download handlers + new folder picker support
2026-03-12 21:18:47 +02:00
copilot-swe-agent[bot]
c9a1f49f23 feat: extract duplicated download utilities from api.js and downloads.js into download-utils.ts
Co-authored-by: DanTheMan827 <790119+DanTheMan827@users.noreply.github.com>
2026-03-12 06:04:59 +00:00
Samidy
86df459dc1 chore(logs): remove accidental debug log for fetching tracks from artists (HOW DID I FORGET TO DO THIS FOR MONTHS LMFAOOO) 2026-03-12 07:53:51 +03:00
SamidyFR
7e6375919d style: auto-fix linting issues 2026-03-12 04:12:28 +00:00
Samidy
30b2e7d445 fix(downloading): hi-res M4A's having no embedded covers (FUCK YOU TAGLIB) 2026-03-12 07:12:02 +03:00
Samidy
5b4bff97e0
Merge branch 'main' into copilot/add-custom-download-formats 2026-03-12 04:56:28 +03:00
Daniel
33668ae118
fix: correct total tracks per disc and add total discs to metadata for multi-disc albums 2026-03-11 19:26:30 +00:00
Daniel
3e24470401
feat(downloads): add FLAC - Max Compression option and refactor transcoding logic 2026-03-11 19:26:05 +00:00
Daniel
3f2651633b
feat(downloads): add custom download formats 2026-03-11 19:26:05 +00:00
SamidyFR
12baaaa55f style: auto-fix linting issues 2026-03-11 05:23:57 +00:00
Samidy
71a2c5be93 make le diddy infinite radio better kinda 2026-03-11 08:23:27 +03:00
Samidy
f20935d2d2
Merge pull request #274 from DanTheMan827/taglib-wasm
Use taglib-wasm for writing and improve ffmpeg caching
2026-03-11 01:23:40 +03:00
edideaur
2e1367e5c2 video covers 2026-03-10 21:58:02 +00:00
Daniel
1c9c5fa242
Merge https://github.com/monochrome-music/monochrome into taglib-wasm 2026-03-10 18:48:18 +00:00
Samidy
ad615f52f8 fix(covers): embed album art for single track downloads 2026-03-10 10:31:04 +03:00
Samidy
f67123a9d1 fix(inf-radio): IM A DUMBASS 2026-03-10 05:37:51 +03:00
Daniel
37f70f5390
Temporarily force FLAC files to go through ffmpeg
Something is wrong with the structure of the downloaded files and taglib is NOT happy with them
2026-03-09 15:56:42 +00:00
Daniel
42101353ab
feat(metadata): re-add flac and m4a metadata code as separate files 2026-03-09 15:54:28 +00:00
Daniel
de472c5891
Merge remote-tracking branch 'upstream' into taglib-wasm 2026-03-09 02:43:12 +00:00
Daniel
497d42b9fd
feat(ffmpeg): enhance progress tracking and logging
- Improved progress tracking in FFmpeg worker by extracting total duration and current time from logs.
- Updated downloadTrackBlob function to use console logging for progress updates.
- Enhanced error handling and progress reporting during audio encoding.
2026-03-09 00:35:09 +00:00
SamidyFR
c8b919a4c7 style: auto-fix linting issues 2026-03-09 00:04:26 +00:00
Samidy
83c705a60a Merge branch 'main' of github.com:monochrome-music/monochrome 2026-03-09 03:03:59 +03:00
Samidy
75d16e6ce4 feat: music videos 2026-03-09 03:03:29 +03:00
Julien Maille
4d938b5478 UI: show FFmpeg encoding progress in toaster 2026-03-08 20:59:35 +01:00
Daniel
0f20106076 feat(downloads): prefetch data while downloading to improve performance and update taglib-wasm 2026-03-08 01:55:42 +00:00
Daniel
44a7c3b61c fix(downloads): cache ffmpeg core js and wasm
This creates a blob url outside of the worker for for the core .js and .wasm files so they aren't downloaded on each run.
2026-03-08 01:54:29 +00:00
Daniel
50a5b79d70 feat(downloads): use taglib-wasm to set tags
taglib supports multiple media formats beyond what was previously supported, this would enable transcoding to other formats without needing to write additional metadata libraries.
2026-03-08 01:54:29 +00:00
Eric D'Addario
39206f4128 feat(downloads): save replay gain tags to FLAC metadata 2026-02-28 16:03:45 -05:00
binimum
fb5fe05414
Remux instead of transcode 2026-02-28 11:59:27 +00:00
Samidy
fc28f9faeb
Apply suggestion from @Copilot
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-02-28 02:00:58 +03:00
Daniel
07422debb9
feat(downloads): add lossless container option
This uses ffmpeg to ensure that the downloaded lossless audio is in the desired container format.
2026-02-27 21:23:33 +00:00
SamidyFR
4aaffd2c22 style: auto-fix linting issues 2026-02-26 23:19:38 +00:00
Samidy
1c1d202e91
Merge pull request #235 from gpulch/feat/mp3-download-ffmpeg-wasm
feat: add ffmpeg.wasm + MP3 320kbps download option
2026-02-27 02:19:13 +03:00
Eduard Prigoana
424ee12d04 feat: animated covers 2026-02-24 12:43:36 +00:00
SamidyFR
700645919c style: auto-fix linting issues 2026-02-23 22:58:08 +00:00
Samidy
38434f5419 Merge branch 'main' of github.com:monochrome-music/monochrome 2026-02-24 01:57:43 +03:00
Eduard Prigoana
895cc20d26 whoops 2026-02-23 17:50:35 +00:00
gpulch
cde7080052 fix: address code review feedback
Inline fixes:
- Remove TDRC frame from ID3 writer (ID3v2.3 uses TYER only, not TDRC)
- Add try/finally cleanup in worker to prevent VFS leaks on errors
- Fix Blob creation to use Uint8Array directly (avoid extra bytes)
- Replace loadFFmpeg race guard with promise singleton pattern
- Add -map_metadata -1 to strip source metadata (prevent duplicate ID3)

Error handling improvements:
- Create MP3EncodingError class with code property for reliable detection
- Update api.js to use instanceof check instead of string matching
- Pass AbortSignal to encodeToMp3 for proper cancellation support
- Remove error re-wrapping in mp3-encoder.js (preserve original errors)

Technical details:
- Promise singleton ensures FFmpeg loads once even with concurrent calls
- AbortSignal listener properly cleaned up on success/error/abort
- Virtual FS cleanup in finally block prevents file leaks
- MP3EncodingError.code = 'MP3_ENCODING_FAILED' for robust detection
2026-02-23 10:49:05 +01:00
gpulch
8a17bddbc3 feat: add MP3 320kbps download option with ffmpeg.wasm
Implements MP3 320kbps download functionality using ffmpeg.wasm for
industry-standard encoding with libmp3lame.

Features:
- New MP3_320 quality option in download settings UI
- ID3v2.3 metadata writing (title, artist, album, cover art, ISRC, etc.)
- Non-blocking encoding via Web Worker to keep UI responsive
- Proper UTF-16 with BOM text encoding for international characters
- Album artist fallback to track artist (mirrors FLAC/M4A behavior)
- Automatic format detection for downloaded audio
- Year validation to prevent writing NaN to ID3 tags

Implementation:
- mp3-encoder.js: Main encoder module with worker orchestration
- mp3-encoder.worker.js: FFmpeg Web Worker for async encoding
- id3-writer.js: ID3v2.3 tag writer with synchsafe size encoding
- Updates to api.js, metadata.js, utils.js for MP3 support
- Vite config excludes @ffmpeg packages from dep optimization

Technical details:
- Uses @ffmpeg/ffmpeg (libmp3lame 320kbps CBR, 44.1kHz)
- FFmpeg binary lazy-loaded from CDN (~25MB, cached)
- Encoding runs in separate thread (non-blocking UI)
- Proper error handling with distinct encoding vs network errors
- Memory-efficient: transfers ArrayBuffer with zero-copy

Dependencies:
- @ffmpeg/ffmpeg ^0.12.10
- @ffmpeg/util ^0.12.1
- Removed: package-lock.json (project uses bun.lock)

Closes maintainer request to use ffmpeg.wasm instead of lamejs.
2026-02-22 19:13:03 +01:00
Samidy
77d99245c8 feat(artists): artists socials 2026-02-22 01:04:02 +03:00
binimum
1188a2dcce style: auto-fix linting issues 2026-02-21 14:57:44 +00:00
binimum
01309a9a15
Change instances.json in favour of Workers which have live API uptime 2026-02-21 14:56:55 +00:00
Samidy
8c79e69382 feat(search): search recs in queue 2026-02-21 02:30:03 +03:00