Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

library: add more metadata fields for models #837

Merged
merged 2 commits into from
Jun 2, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
library: add more metadata fields for models
  • Loading branch information
cosven committed Jun 2, 2024
commit 0401eea04803ed524bccf11ee8bb5d9ac8428672
7 changes: 7 additions & 0 deletions feeluown/library/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,9 @@ class ArtistModel(BriefArtistModel, BaseNormalModel):
aliases: List[str]
hot_songs: List[BriefSongModel]
description: str
song_count: int = -1
album_count: int = -1
mv_count: int = -1


class AlbumModel(BriefAlbumModel, BaseNormalModel):
Expand Down Expand Up @@ -387,6 +390,8 @@ class VideoModel(BriefVideoModel, BaseNormalModel):
artists: List[BriefArtistModel]
duration: int
cover: str
play_count: int = -1 # -1 means unknown
released: str = '' # format: 2000-12-27.

def model_post_init(self, _):
super().model_post_init(_)
Expand All @@ -402,6 +407,8 @@ class PlaylistModel(BriefPlaylistModel, BaseNormalModel):
cover: str
description: str
play_count: int = -1 # -1 means unknown
created: str = '' # format: 2000-12-27
updated: str = '' # format: 2000-12-27

def model_post_init(self, _):
super().model_post_init(_)
Expand Down
Loading