mirror of
https://github.com/tcsenpai/swingmusic.git
synced 2025-06-06 03:05:35 +00:00
rename album title in track object after extract feat from album title
This commit is contained in:
parent
ac4be71e7b
commit
76604be1db
@ -47,7 +47,7 @@ class Album:
|
||||
self.albumartists.extend([Artist(a) for a in featured if a.lower() not in original_lower])
|
||||
|
||||
from ..store.tracks import TrackStore
|
||||
TrackStore.append_track_artists(self.albumhash, featured)
|
||||
TrackStore.append_track_artists(self.albumhash, featured, self.title)
|
||||
|
||||
self.albumartists_hashes = "-".join(a.artisthash for a in self.albumartists)
|
||||
|
||||
|
@ -85,9 +85,13 @@ class Track:
|
||||
def recreate_artists_hash(self):
|
||||
self.artist_hashes = "-".join(a.artisthash for a in self.artist)
|
||||
|
||||
def add_artists(self, artists: list[str]):
|
||||
def rename_album(self, new_album: str):
|
||||
self.album = new_album
|
||||
|
||||
def add_artists(self, artists: list[str], new_album_title: str):
|
||||
for artist in artists:
|
||||
if create_hash(artist) not in self.artist_hashes:
|
||||
self.artist.append(ArtistMinimal(artist))
|
||||
|
||||
self.recreate_artists_hash()
|
||||
self.rename_album(new_album_title)
|
||||
|
@ -98,11 +98,11 @@ class TrackStore:
|
||||
track.is_favorite = False
|
||||
|
||||
@classmethod
|
||||
def append_track_artists(cls, albumhash: str, artists: list[str]):
|
||||
def append_track_artists(cls, albumhash: str, artists: list[str], new_album_title:str):
|
||||
tracks = cls.get_tracks_by_albumhash(albumhash)
|
||||
|
||||
for track in tracks:
|
||||
track.add_artists(artists)
|
||||
track.add_artists(artists, new_album_title)
|
||||
|
||||
# ================================================
|
||||
# ================== GETTERS =====================
|
||||
|
Loading…
x
Reference in New Issue
Block a user