Commit graph

567 commits

Author SHA1 Message Date
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
EduardPrigoanaAlt
6b55fd4c7a style: auto-fix linting issues 2026-02-22 15:47:05 +00:00
GooglyBlox
747f50f564 feat: add all artists to metadata 2026-02-21 18:31:43 -08:00
Julien Maille
c1973e81ff Shuffle full artist discography instead of artist radio 2026-02-22 00:57:42 +01:00
JulienMaille
651f4282e5 style: auto-fix linting issues 2026-02-21 23:33:29 +00:00
Julien Maille
bf346f756e Add multi-disc ZIP folders and fix playlist extension paths 2026-02-22 00:32:45 +01:00
Julien Maille
400197aabc Write disc number metadata for FLAC and M4A downloads 2026-02-21 23:52:33 +01:00
Julien Maille
888703f18b fix: resolve persistent labels 2026-02-21 23:42:45 +01:00
Julien Maille
73b9867d4b FIX: tooltip and css issues 2026-02-21 23:33:30 +01:00
SamidyFR
87a8368fc3 style: auto-fix linting issues 2026-02-21 19:58:57 +00:00
Sietse
1f13e34249
fix(player): Uniform shuffle
Replaces the current naive solution with Fisher-Yates
2026-02-21 20:53:42 +01: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
Julien Maille
acf64cbc17 fix: prevent home page double refresh and improve artist name extraction in album cards 2026-02-21 14:17:46 +01:00
JulienMaille
384dd867cd style: auto-fix linting issues 2026-02-21 10:35:52 +00:00
Julien Maille
43a6e17df9 FIX: search history 2026-02-21 11:35:27 +01:00
Julien Maille
baec739b01 IMP: viz performances 2026-02-21 11:33:08 +01:00
Julien Maille
2bd42fc202 feat: add ISRC and copyright metadata support for M4A downloads 2026-02-21 10:30:17 +01:00
Julien Maille
3cab0926e4 Avoid skipping tracks when autoplay is blocked
# Conflicts:
#	js/player.js
2026-02-21 10:30:17 +01:00
Julien Maille
0d16ea28a8 Avoid skipping tracks when autoplay is blocked 2026-02-21 01:12:54 +01:00
Samidy
1108a44df9 Merge branch 'main' of github.com:monochrome-music/monochrome 2026-02-21 02:32:04 +03:00
Samidy
07376b7d55 fix(track pages): fix these idiots not loading 2026-02-21 02:30:41 +03:00
Samidy
8c79e69382 feat(search): search recs in queue 2026-02-21 02:30:03 +03:00
JulienMaille
8731ddb502 style: auto-fix linting issues 2026-02-20 23:07:15 +00:00
Julien Maille
ae853636ce IMP: 192kHz playback, adapted visualizers 2026-02-21 00:07:00 +01:00
SamidyFR
9b269d14fd style: auto-fix linting issues 2026-02-20 19:09:51 +00:00
Samidy
61da5c47b0 cover images on local files ⁉️ 2026-02-20 21:57:17 +03:00
Samidy
790a3b7f94 lol 2026-02-20 20:42:12 +03:00
BlackSigkill
bddf5a0d73 fix linting errors/warnings 2026-02-20 15:48:23 +01:00
SamidyFR
de8064410d style: auto-fix linting issues 2026-02-20 13:22:40 +00:00
Samidy
04e4de0fb8 fix(APIs): remove now broken free tier API, oh and other stuff but idc 2026-02-20 16:22:13 +03:00
EduardPrigoanaAlt
82700ae42e style: auto-fix linting issues 2026-02-20 10:50:13 +00:00
BlackSigkill
be7ca88221 keep track's artists order the same in subcontext menu 2026-02-20 10:57:58 +01:00
BlackSigkill
8be0fa944b add sub context menu for artists + add links to artists 2026-02-20 10:49:56 +01:00
BlackSigkill
eddb202b1b allow multi artist selection (go to artist context menu) 2026-02-20 10:16:08 +01:00
BlackSigkill
cefc49777c lint & prettier 2026-02-19 23:48:44 +01:00
BlackSigkill
242541a7bb remove qobuz bio as i can't test it 2026-02-19 23:45:43 +01:00
BlackSigkill
acc9d8b5cd add tidal biography to artists pages 2026-02-19 23:37:18 +01:00
SamidyFR
48937ed573 style: auto-fix linting issues 2026-02-19 13:55:31 +00:00
Samidy
5eba6aa224 Merge branch 'main' of github.com:monochrome-music/monochrome 2026-02-19 16:55:02 +03:00
Samidy
250ebb9f99 feat(social): profiles feature 2026-02-19 16:54:58 +03:00
Julien Maille
d05a0ea9c0 FIX: local files in desktop app 2026-02-18 21:33:34 +01:00
Eduard Prigoana
a9f3acb289 fix4dwayne 2026-02-18 04:19:12 +00:00
Eduard Prigoana
64ff09910b close modals on navigation 2026-02-18 03:50:00 +00:00
Eduard Prigoana
03a7dcda52 fix codeql suggestions 2026-02-18 03:30:20 +00:00
Eduard Prigoana
62fe4fca8e whoops 2026-02-18 03:22:20 +00:00
Eduard Prigoana
58b77e904b fix codeql stuff 2026-02-18 03:17:37 +00:00
Eduard Prigoana
120c725233 guess who goin to jail tonight 2026-02-17 23:49:51 +00:00
Eduard Prigoana
f20f3dbb9d EQ changes 2026-02-17 20:22:47 +00:00