Commit graph

70 commits

Author SHA1 Message Date
Daniel
5b727a103e feat(downloads): allow writing multiple artists to metadata
This will write each artist separately to the metadata rather than as a single concatenated string.  This allows for better library searching if the player supports it.

If multiple artists are written to an m4a file, iTunes will only show the first artist.
2026-04-03 14:31:19 +03:00
David ZENG
d15a99dad8 fix(library) fixed undefined error, when importing local music folder 2026-03-27 19:55:09 +01:00
Daniel
80cd8b2f9b refactor(downloads): cleanup downloads and add mp4 stik atom 2026-03-24 14:10:28 -05:00
Daniel
111ade245f
fix(metadata): lyrics are now fetched 2026-03-22 14:05:07 -05:00
Daniel
c768f8d675 refactor(lyrics): convert to singleton 2026-03-21 17:36:23 -05:00
Daniel
f2b8cdc812 feat(downloads): add metadata to videos 2026-03-20 12:52:07 -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
61aebf7994 refactor(metadata): move METADATA_STRINGS to separate file 2026-03-19 15:11:37 -05:00
Samidy
43a5f1b714 fix(local files): metadata artist garbage 2026-03-13 05:28:49 +03:00
Daniel
b04019f282 fix(downloads): mp4 files with flac audio are now tagged
This is resolved by using ffmpeg to copy the audio data into a new mp4 container file before passing it to taglib.
2026-03-12 06:43:45 +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
3814358f0d
Merge branch 'main' into copilot/fix-m3u-generation-logic 2026-03-12 05:01:20 +03:00
Daniel
4def7b8e51
Merge branch 'combined-fixes' into copilot/fix-m3u-generation-logic 2026-03-11 15:20:30 -05:00
Daniel
e1d7744ab2 fix: correct total tracks per disc and add total discs to metadata for multi-disc albums 2026-03-11 15:17:17 -05:00
Daniel
aa728f970b
feat(downloads): add discNumber template for file name.
Also update disc number handling in download logic and metadata extraction
2026-03-11 20:10:38 +00: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
1c9c5fa242
Merge https://github.com/monochrome-music/monochrome into taglib-wasm 2026-03-10 18:48:18 +00:00
SamidyFR
dd2639b5f0 style: auto-fix linting issues 2026-03-10 07:31:34 +00:00
Samidy
ad615f52f8 fix(covers): embed album art for single track downloads 2026-03-10 10:31:04 +03:00
Daniel
65e1b4e98d
fix(metadata): remove unnecessary audio buffer type check in addMetadataToAudio 2026-03-09 15:58:53 +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
efa3521aff
feat(taglib): refactor and improve metadata handling, worker integration, and code quality
- Refactor metadata handling to use fetchTagLib and addMetadataWithTagLib for improved loading and worker-based processing
- Update prefetchMetadataObjects and addMetadataToAudio for simplified and more robust metadata extraction
- Add taglib.worker.ts for audio metadata processing in a worker
- Implement getMetadataWithTagLib function
- Auto-fix linting issues and remove unnecessary debugger statements
2026-03-09 00:35:20 +00:00
Julien Maille
c7b1d301db fix: linting errors and settings structure cleanup 2026-03-08 19:42:26 +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
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
SamidyFR
60d61f74d2 style: auto-fix linting issues 2026-03-06 21:01:28 +00:00
Timur Cravtov
4e174297ca fix: move mvhd tag to run before udta guard 2026-03-06 22:40:05 +02:00
Timur Cravtov
6545b31388 feat(library): estimate flac and mp4 duration 2026-03-06 22:19:58 +02:00
Timur Cravtov
8c7a7547c9 feat(library): estimate mp3 files duration 2026-03-06 22:19:40 +02:00
Daniel
8035dd3873
feat(downloads): add BPM tag to Vorbis comments and MP4 metadata
- Added 'TEMPO' tag to Vorbis comments if BPM is available
- Added 'tmpo' tag to MP4 metadata if BPM is available
2026-03-02 21:38:16 +00:00
Daniel
82ca593894
fix(downloads): fix malformed m4a user atoms 2026-03-02 21:14:15 +00:00
Daniel
6c09793276
feat(downloads): add XID ISRC tag to MP4 metadata
- Added 'xid ' tag for ISRC in createMp4MetadataAtoms function
2026-03-02 19:13:18 +00:00
Daniel
c430a5bd7e
fix(downloads): fix malformed m4a replaygain metadata 2026-03-02 17:59:05 +00:00
Daniel
2b2f61d1ee
feat(downloads): write replaygain to m4a tracks 2026-03-01 23:57:33 +00:00
edidealt
de3e125bac
Merge pull request #261 from ericdaddario02/feature/replay-gain-flac
feat(downloads): save replay gain tags to FLAC metadata
2026-03-01 12:15:00 +02:00
Eric D'Addario
39206f4128 feat(downloads): save replay gain tags to FLAC metadata 2026-02-28 16:03:45 -05:00
Daniel
120073aea4
fix(downloads): write full track title to metadata 2026-02-28 16:55:37 +00:00
edidealt
72eae8f411 style: auto-fix linting issues 2026-02-28 11:18:26 +00:00
Daniel
dcf8563254
feat(downloads): add explicit content rating support
- Write ITUNESADVISORY for FLAC
- Write rtng for M4A
- Read the corresponding values from local media
2026-02-28 02:49:13 +00:00
SamidyFR
4aaffd2c22 style: auto-fix linting issues 2026-02-26 23:19:38 +00: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
400197aabc Write disc number metadata for FLAC and M4A downloads 2026-02-21 23:52:33 +01:00
JulienMaille
384dd867cd style: auto-fix linting issues 2026-02-21 10:35:52 +00:00
Julien Maille
2bd42fc202 feat: add ISRC and copyright metadata support for M4A downloads 2026-02-21 10:30:17 +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
BlackSigkill
50834a48e0 fix all errors/warnings during linting 2026-02-03 15:20:50 +01:00