year_repair
¶
Generic repair and revert utilities.
Provides helpers to revert year changes using either a changes report or a backup CSV of the track list. Designed to be artist/album agnostic.
YearRevertProcessorProtocol
¶
Bases: Protocol
Protocol for track processor operations needed by year revert logic.
fetch_tracks_async
async
¶
fetch_tracks_async(
artist=None,
force_refresh=False,
dry_run_test_tracks=None,
ignore_test_filter=False,
)
Fetch tracks from the music library.
Source code in src/core/models/year_repair.py
update_track_async
async
¶
update_track_async(
track_id,
new_track_name=None,
new_album_name=None,
new_genre=None,
new_year=None,
track_status=None,
original_artist=None,
original_album=None,
original_track=None,
)
Update a track's metadata in the music library.
Source code in src/core/models/year_repair.py
RevertTarget
dataclass
¶
Describes a track that should have its year reverted.
build_revert_targets
¶
Build revert targets from either a backup CSV or the changes report.
If backup_csv_path is provided and readable, it is used; otherwise the changes_report.csv is used.
Source code in src/core/models/year_repair.py
apply_year_reverts
async
¶
Apply year reverts to Music.app given revert targets.
Returns (updated_count, missing_count, change_log_entries).