track_updater
¶
Track-level year update operations.
Handles applying year values to tracks with validation, deduplication, retry logic, and bulk update batching.
TrackUpdater
¶
Applies year values to tracks with validation and retry.
Responsibilities: - Collect and validate tracks that need year updates - Execute bulk updates with batching and retry - Record successful updates in change log
Source code in src/core/tracks/track_updater.py
update_tracks_for_album
async
¶
Update tracks for a specific album and record changes.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
artist
|
str
|
Artist name |
required |
album
|
str
|
Album name |
required |
album_tracks
|
list[TrackDict]
|
List of tracks in the album |
required |
year
|
str
|
Year to set |
required |
updated_tracks
|
list[TrackDict]
|
List to append updated tracks to |
required |
changes_log
|
list[ChangeLogEntry]
|
List to append change entries to |
required |
Source code in src/core/tracks/track_updater.py
record_successful_updates
staticmethod
¶
Record successful track updates.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
tracks
|
list[TrackDict]
|
Tracks that were updated |
required |
year
|
str
|
New year value |
required |
artist
|
str
|
Artist name |
required |
album
|
str
|
Album name |
required |
updated_tracks
|
list[TrackDict]
|
List to append updated tracks to |
required |
changes_log
|
list[ChangeLogEntry]
|
List to append change entries to |
required |
Source code in src/core/tracks/track_updater.py
update_album_tracks_bulk_async
async
¶
Update year for multiple tracks in bulk.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
tracks
|
list[TrackDict]
|
List of tracks to update |
required |
year
|
str
|
Year to set |
required |
artist
|
str
|
Artist name for contextual logging |
required |
album
|
str
|
Album name for contextual logging |
required |
Returns:
| Type | Description |
|---|---|
tuple[int, int]
|
Tuple of (successful_count, failed_count) |
Source code in src/core/tracks/track_updater.py
239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 | |