@@ -372,37 +372,37 @@ def _get_album_info(
372372 track_info .index = i
373373 track_infos .append (track_info )
374374
375- artist_names , artist_ids = self ._extract_artists (
375+ artist_names , artist_ids = self ._parse_artists (
376376 album ["relationships" ]["artists" ]["data" ],
377377 artist_lookup ,
378378 )
379- release = self ._extract_release_date (album ["attributes" ])
379+ date_parts = self ._parse_release_date (album ["attributes" ])
380380 return AlbumInfo (
381381 # Identifier
382382 data_source = self .data_source ,
383383 album_id = album ["id" ],
384384 artists_ids = artist_ids ,
385- data_url = self ._extract_data_url (album ["attributes" ]),
385+ data_url = self ._parse_data_url (album ["attributes" ]),
386386 barcode = album ["attributes" ]["barcodeId" ],
387387 # Meta
388- album = self ._extract_title (album ["attributes" ]),
388+ album = self ._parse_title (album ["attributes" ]),
389389 tracks = track_infos ,
390390 artist = ", " .join (artist_names ),
391391 artists = artist_names ,
392392 duration = self ._duration_to_seconds (album ["attributes" ]["duration" ]),
393393 albumtype = album ["attributes" ]["albumType" ],
394- label = self ._extract_label (album ["attributes" ]),
395- year = release [0 ] if release else None ,
396- month = release [1 ] if release else None ,
397- day = release [2 ] if release else None ,
394+ label = self ._parse_label (album ["attributes" ]),
395+ year = date_parts [0 ] if date_parts else None ,
396+ month = date_parts [1 ] if date_parts else None ,
397+ day = date_parts [2 ] if date_parts else None ,
398398 )
399399
400400 def _get_track_info (
401401 self ,
402402 track : TidalTrack ,
403403 artist_lookup : dict [str , TidalArtist ],
404404 ) -> TrackInfo :
405- artist_names , artist_ids = self ._extract_artists (
405+ artist_names , artist_ids = self ._parse_artists (
406406 track ["relationships" ]["artists" ]["data" ],
407407 artist_lookup ,
408408 )
@@ -412,18 +412,18 @@ def _get_track_info(
412412 data_source = self .data_source ,
413413 track_id = track ["id" ],
414414 artists_ids = artist_ids ,
415- data_url = self ._extract_data_url (track ["attributes" ]),
415+ data_url = self ._parse_data_url (track ["attributes" ]),
416416 # Meta
417- title = self ._extract_title (track ["attributes" ]),
417+ title = self ._parse_title (track ["attributes" ]),
418418 isrc = track ["attributes" ]["isrc" ],
419419 artist = ", " .join (artist_names ),
420420 artists = artist_names ,
421421 duration = self ._duration_to_seconds (track ["attributes" ]["duration" ]),
422- label = self ._extract_label (track ["attributes" ]),
422+ label = self ._parse_label (track ["attributes" ]),
423423 )
424424
425425 @staticmethod
426- def _extract_artists (
426+ def _parse_artists (
427427 artist_relationships : list [ResourceIdentifier ],
428428 artist_lookup : dict [str , TidalArtist ],
429429 ) -> tuple [list [str ], list [str ]]:
@@ -447,7 +447,7 @@ def _extract_artists(
447447 return artist_names , artist_ids
448448
449449 @staticmethod
450- def _extract_title (attributes : AlbumAttributes | TrackAttributes ):
450+ def _parse_title (attributes : AlbumAttributes | TrackAttributes ):
451451 """
452452 Tidal UIs append the version string at the end of the title. We do the same here
453453 by formatting it as ``"{title} ({version})"`` to stay consistent.
@@ -458,7 +458,7 @@ def _extract_title(attributes: AlbumAttributes | TrackAttributes):
458458 return attributes ["title" ]
459459
460460 @staticmethod
461- def _extract_data_url (
461+ def _parse_data_url (
462462 attributes : AlbumAttributes | TrackAttributes ,
463463 ) -> str | None :
464464 if external_links := attributes .get ("externalLinks" ):
@@ -483,15 +483,15 @@ def _duration_to_seconds(duration: str) -> int:
483483 )
484484
485485 @staticmethod
486- def _extract_label (
486+ def _parse_label (
487487 attributes : AlbumAttributes | TrackAttributes ,
488488 ) -> str | None :
489489 if copyright := attributes .get ("copyright" ):
490490 return copyright ["text" ]
491491 return None
492492
493493 @staticmethod
494- def _extract_release_date (
494+ def _parse_release_date (
495495 attributes : AlbumAttributes ,
496496 ) -> tuple [int , int , int ] | None :
497497 """Returns year, month, day from iso YYYY-MM-DD"""
0 commit comments