remove comments from album model

This commit is contained in:
cwilvx
2024-07-04 11:47:08 +03:00
parent 2e63aa4a41
commit 678eed3ab6
2 changed files with 11 additions and 85 deletions
+11 -7
View File
@@ -1,20 +1,23 @@
# What's New? # What's New?
<!-- TODO: ELABORATE --> <!-- TODO: ELABORATE -->
- Auth - Auth
- New artists/albums Sort by: last played, no. of streams, total stream duration - New artists/albums Sort by: last played, no. of streams, total stream duration
- Option to show now playing track info on tab title. Go to Settings > Appearance to enable
## Improvements ## Improvements
- The context menu now doesn't take forever to open up - The context menu now doesn't take forever to open up
- Merged "Save as Playlist" with "Add to Playlist" > "New Playlist" - Merged "Save as Playlist" with "Add to Playlist" > "New Playlist"
## Bug fixes ## Bug fixes
- Add to queue adding to last index -1 - Add to queue adding to last index -1
-
## Development ## Development
- Rewritten the whole DB layer to move stores from memory to the database.
- Rewritten the whole DB layer to move stores from memory to the database.
## THE BIG ONE API CHANGES ## THE BIG ONE API CHANGES
@@ -22,13 +25,14 @@
```ts ```ts
interface Genre { interface Genre {
name: str; name: str;
genrehash: str; genrehash: str;
} }
``` ```
- Pairing via QR Code has been split into 2 endpoint: - Pairing via QR Code has been split into 2 endpoint:
1. `/getpaircode`
2. `/pair`
- 1. `/getpaircode`
2. `/pair`
-
-78
View File
@@ -39,62 +39,9 @@ class Album:
versions: list[str] = dataclasses.field(default_factory=list) versions: list[str] = dataclasses.field(default_factory=list)
def __post_init__(self): def __post_init__(self):
# self.date = datetime.datetime.fromtimestamp(self.date).year
self.image = self.albumhash + ".webp" self.image = self.albumhash + ".webp"
self.populate_versions() self.populate_versions()
# albumhash: str
# title: str
# albumartists: list[Artist]
# albumartists_hashes: str = ""
# image: str = ""
# count: int = 0
# duration: int = 0
# colors: list[str] = dataclasses.field(default_factory=list)
# date: str = ""
# created_date: int = 0
# og_title: str = ""
# base_title: str = ""
# is_soundtrack: bool = False
# is_compilation: bool = False
# is_single: bool = False
# is_EP: bool = False
# is_favorite: bool = False
# is_live: bool = False
# genres: list[str] = dataclasses.field(default_factory=list)
# def __post_init__(self):
# self.title = self.title.strip()
# self.og_title = self.title
# self.image = self.albumhash + ".webp"
# # Fetch album artists from title
# if get_flag(SessionVarKeys.EXTRACT_FEAT):
# featured, self.title = parse_feat_from_title(self.title)
# if len(featured) > 0:
# original_lower = "-".join([a.name.lower() for a in self.albumartists])
# 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, self.title)
# # Handle album version data
# else:
# self.base_title = get_base_title_and_versions(
# self.title, get_versions=False
# )[0]
# self.albumartists_hashes = "-".join(a.artisthash for a in self.albumartists)
# # def set_colors(self, colors: list[str]):
# # self.colors = colors
def populate_versions(self): def populate_versions(self):
_, self.versions = get_base_title_and_versions(self.og_title, get_versions=True) _, self.versions = get_base_title_and_versions(self.og_title, get_versions=True)
@@ -223,28 +170,3 @@ class Album:
# TODO: Review -> Are the above commented checks necessary? # TODO: Review -> Are the above commented checks necessary?
): ):
return True return True
# def get_date_from_tracks(self, tracks: list[Track]):
# """
# Gets the date of the album its tracks.
# Args:
# tracks (list[Track]): The tracks of the album.
# """
# if self.date:
# return
# dates = (int(t.date) for t in tracks if t.date)
# try:
# self.date = datetime.datetime.fromtimestamp(min(dates)).year
# except:
# self.date = datetime.datetime.now().year
# def set_count(self, count: int):
# self.count = count
# def set_duration(self, duration: int):
# self.duration = duration
# def set_created_date(self, created_date: int):
# self.created_date = created_date