mirror of
https://github.com/unshackle-dl/unshackle.git
synced 2026-11-27 03:15:08 +00:00
feat(music): native music core - shared helpers, album folder template, display cleanup (#125)
* Add native Music core workflow
* feat(music): add shared music core helpers, album folder template, and UX cleanup
Consolidate duplicated music-service logic into core and extend the native music workflow.
- add core/music/extract.py: shared stateless helpers (first_text, first_number, year/duration/name formatting, classify_release_kind, dedupe_track_options, build_music_from_songs) so services stop carrying their own copies
- add core/music/display.py: shared rich rendering (render_track_panel, render_album_header, render_artwork_preview) with TrackRow / MusicHeaderInfo data holders
- export the new helpers from core/music/__init__.py
- add dedicated `albums` folder template kind (output_template.folder.albums) resolving albums -> songs -> "{artist} - {album} ({year})"; whitelist music template variables (album_artist, track_total, disc_total, release_type, genre, explicit, isrc, upc, label)
- fix song filename crash: config.get_output_template(...) did not exist; use config.output_template.get("songs") with a sane default
- strip emojis from music output (renderer, dl.py music branch) to match unshackle UX; remove dead MusicSongPlan import and music_icon logic
- document the albums folder key in unshackle-example.yaml
- add tests for extract, display, and the folder template
---------
Co-authored-by: MrMovies-Dev <MrMovies-Dev@users.noreply.github.com>
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
from .display import MusicHeaderInfo, TrackRow, render_album_header, render_artwork_preview, render_track_panel
|
||||
from .extract import (build_music_from_songs, classify_release_kind, dedupe_track_options, duration_seconds,
|
||||
first_number, first_text, format_duration, format_names, year_from_value)
|
||||
from .hasher import file_md5
|
||||
from .integrity import MusicAudioIntegrityError, MusicAudioIntegrityResult, verify_music_audio
|
||||
from .manifest import write_music_manifest
|
||||
from .models import MusicDiscPlan, MusicDownloadPlan, MusicSongPlan, MusicTrackOption
|
||||
from .planner import MusicPlanner
|
||||
from .renderer import MusicRenderer
|
||||
from .tagger import MusicMetadataResult, write_music_metadata
|
||||
|
||||
__all__ = (
|
||||
"MusicAudioIntegrityError",
|
||||
"MusicAudioIntegrityResult",
|
||||
"MusicDiscPlan",
|
||||
"MusicDownloadPlan",
|
||||
"MusicHeaderInfo",
|
||||
"MusicMetadataResult",
|
||||
"MusicPlanner",
|
||||
"MusicRenderer",
|
||||
"MusicSongPlan",
|
||||
"MusicTrackOption",
|
||||
"TrackRow",
|
||||
"build_music_from_songs",
|
||||
"classify_release_kind",
|
||||
"dedupe_track_options",
|
||||
"duration_seconds",
|
||||
"file_md5",
|
||||
"first_number",
|
||||
"first_text",
|
||||
"format_duration",
|
||||
"format_names",
|
||||
"render_album_header",
|
||||
"render_artwork_preview",
|
||||
"render_track_panel",
|
||||
"verify_music_audio",
|
||||
"write_music_manifest",
|
||||
"write_music_metadata",
|
||||
"year_from_value",
|
||||
)
|
||||
Reference in New Issue
Block a user