Skip to content

feat: add local library import#30

Open
kanya-approve wants to merge 6 commits into
anandprtp:mainfrom
kanya-approve:local-import-library
Open

feat: add local library import#30
kanya-approve wants to merge 6 commits into
anandprtp:mainfrom
kanya-approve:local-import-library

Conversation

@kanya-approve

@kanya-approve kanya-approve commented May 15, 2026

Copy link
Copy Markdown

Summary

Add local library import — bring existing audio files into Antra's library using the same structure, tagging, and deduplication as URL downloads.

  • New Import Files / Import Folder buttons below the URL bar pick local audio
  • Python LocalMusicImporter reads tags (FLAC / MP3 / MP4 + generic via mutagen), falls back to file-path inference for missing fields, and copies each file into the configured library layout
  • Runs through the existing ISRC + canonical-title dedup index, so re-importing a folder skips duplicates already in your library
  • Quality-aware replacement: importing a higher-quality version of a track you already own (FLAC vs MP3, 24-bit vs 16-bit, higher bitrate) replaces the existing file in place
  • Copies sidecar .lrc / .txt lyrics next to each audio file
  • Supports FLAC, ALAC, MP3, M4A/MP4, AAC, WAV/WAVE, AIFF/AIF, OGG, Opus (also expanded for the analyzer's file picker)

Other changes

  • Normalize ISRC identity keys: strip separators, validate against ^[A-Z]{2}[A-Z0-9]{3}\d{7}$, lowercase for dedup. Guards against malformed tags from local files.
  • Frontend: factor playlist-progress reset into resetLibraryProgress() and reuse from both URL download and local import flows
  • IPC: emit a "mode": "local" discriminator on the local-import playlist_summary so the "Failed imports" vs "Could not source" label keys off that instead of string-matching summary.url
  • Backend Go: shared pickAudioFiles(title) helper backs both PickAnalyzerFiles and PickImportFiles
  • .gitignore covers the transient antra-wails/_pyinstaller_work/
  • CI: Linux AppImage now uses the square Antra_newlogo.png (the in-app logo) instead of the older logo-universal.png banner

Docs

  • New Local Library Import section in FEATURES.md
  • One-line callout in README.md

Validation

  • go build ./... clean
  • python -c "import antra.utils.local_importer; import antra.json_cli" and smoke tests for clean_tag_list
  • npm run check — 0 errors (existing warnings/hints remain)
  • Built Linux AppImage end-to-end (pyinstaller → wails build -clean -tags webkit2_41appimagetool) and ran it

AI GENERATED

@kanya-approve kanya-approve force-pushed the local-import-library branch from e2f56e7 to f254f64 Compare May 15, 2026 03:34
@kanya-approve kanya-approve marked this pull request as draft May 15, 2026 03:48
- Remove unused `import_paths` method on `LocalMusicImporter`
- Drop redundant `LOCAL_IMPORT_AUDIO_EXTENSIONS` union (the same
  extensions were already added to `SUPPORTED_AUDIO_EXTENSIONS`)
- Simplify the tautological `len(parts) == 1` guard in `clean_tag_list`
- Factor `PickAnalyzerFiles` / `PickImportFiles` onto a shared
  `pickAudioFiles(title)` helper
- Parse local-file metadata once in `run_local_import` and pass the
  pre-parsed tracks (and parse errors) into `import_files`, removing
  the duplicate parse pass inside `import_file`
- Emit a `mode: "local"` discriminator on the local-import
  `playlist_summary` payload and switch the frontend to key the
  "Failed imports" / "Could not source" label off that instead of
  comparing `summary.url === 'local import'`.
- Document local library import in FEATURES.md (new section after
  Smart Deduplication) and add a one-line callout in README.
- Ignore `antra-wails/_pyinstaller_work/`, the transient pyinstaller
  scratch directory.
The CI AppImage was using `frontend/src/assets/images/logo-universal.png`
(the 1024x811 universal banner), while the in-app logo is the square
1254x1254 `frontend/public/Antra_newlogo.png`. Use the same icon for
the AppImage so it matches the desktop app's identity.
@kanya-approve kanya-approve marked this pull request as ready for review May 15, 2026 15:58
@kanya-approve

Copy link
Copy Markdown
Author

@anandprtp

@kanya-approve

Copy link
Copy Markdown
Author

@anandprtp

@th3-pr0gr4mm3r

Copy link
Copy Markdown

When you say "AI GENERATED", do you mean vibe-coded?

@kanya-approve

kanya-approve commented Jul 5, 2026

Copy link
Copy Markdown
Author

Yes but I've tested this and it actually works

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants