Skip to content

Commit

Permalink
library: add more metadata fields for models (#837)
Browse files Browse the repository at this point in the history
  • Loading branch information
cosven authored Jun 2, 2024
1 parent 7211da3 commit cb1501a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
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 = '' # publish date. 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
2 changes: 2 additions & 0 deletions feeluown/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,8 @@ def init_config(self, config: Config):
# instead of app.fuo_xxx.X=Y.
if self.name.startswith('fuo_'):
names.append(self.name[4:])
elif self.name.startswith('feeluown_'):
names.append(self.name[9:])

# Define a subconfig(namespace) for plugin so that plugin can
# define its own configuration fields.
Expand Down

0 comments on commit cb1501a

Please sign in to comment.