diff --git a/.github/images/artist.webp b/.github/images/artist.webp index d597d9a7..c67a1a47 100644 Binary files a/.github/images/artist.webp and b/.github/images/artist.webp differ diff --git a/README.md b/README.md index a1b0a83d..a1ea123b 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@
Swing Music
-
v1.4.8
+
v2.0.2
**
[Download](https://swingmusic.vercel.app/downloads) • Support Development • [Docs](https://swingmusic.vercel.app/guide/introduction.html) • [Screenshots](https://swingmusic.vercel.app) • [r/SwingMusicApp](https://www.reddit.com/r/SwingMusicApp)
** @@ -13,7 +13,27 @@ ## -Swing Music is a beautiful, self-hosted music player for your local audio files. Like a cooler Spotify ... but bring your own music. Just run the app and enjoy your music library in a web browser. +Swing Music is a fast and beautiful, self-hosted music player for your local audio files. Like a cooler Spotify ... but bring your own music. Just run the app and enjoy your music library in a web browser. + +## Features + +- **Daily Mixes** - generated daily based on your listening activity +- **Metadata normalization** - a clean and consistent library +- **Album versioning** - normalized albums and association with version labels (eg. Deluxe, Remaster, etc) +- **Related artist and albums** +- **Folder view** - Browse your music library by folders +- **Playlist management** +- **Beautiful browser based UI** +- **Silence detection** - Combine cross-fade with silence detection to create a seamless listening experience +- **Collections** - Group albums and artists based on your preferences +- **Statistics** - Get insights into your listening activity +- **Lyrics view** +- **Android client** +- **Last.fm scrobbling** +- **Multi-user support** +- **Cross-platform** - Windows, Linux, MacOS (coming soon), arm64, x86 +- **Blazingly fast** +- **Pure awesomeness** ### Installation @@ -35,15 +55,15 @@ chmod a+x ./swingmusic ./swingmusic ``` -The app should start at by default. Open it in your browser to use Swing Music. You can change the default port by using the `--port` flags. +The app should start at by default. Open it in your browser to configure and use Swing Music. You can change the default port by using the `--port` flag. ```sh -swingmusic --port 1980 +./swingmusic --port 1980 ``` ### Options -Options are flags that can be passed when starting the app in the terminal to tweak runtime settings or perform tasks. You can use the `-h` flag to see all supported options. +Options flags can be passed when starting the app in the terminal to tweak runtime settings or perform tasks. You can use the `-h` flag to see all supported options. > [!TIP] > You can read more about options in [the docs](https://swingmusic.vercel.app/guide/getting-started.html#options). diff --git a/app/api/apischemas.py b/app/api/apischemas.py index 02c8f0c0..575ede54 100644 --- a/app/api/apischemas.py +++ b/app/api/apischemas.py @@ -14,7 +14,9 @@ class AlbumHashSchema(BaseModel): albumhash: str = Field( description="The album hash", - example=Defaults.API_ALBUMHASH, + json_schema_extra={ + "example": Defaults.API_ALBUMHASH, + }, min_length=Defaults.HASH_LENGTH, max_length=Defaults.HASH_LENGTH, ) @@ -26,7 +28,9 @@ class ArtistHashSchema(BaseModel): """ artisthash: str = Field( description="The artist hash", - example=Defaults.API_ARTISTHASH, + json_schema_extra={ + "example": Defaults.API_ARTISTHASH, + }, min_length=Defaults.HASH_LENGTH, max_length=Defaults.HASH_LENGTH, ) @@ -39,7 +43,9 @@ class TrackHashSchema(BaseModel): trackhash: str = Field( description="The track hash", - example=Defaults.API_TRACKHASH, + json_schema_extra={ + "example": Defaults.API_TRACKHASH, + }, min_length=Defaults.HASH_LENGTH, max_length=Defaults.HASH_LENGTH, ) @@ -52,7 +58,9 @@ class GenericLimitSchema(BaseModel): limit: int = Field( description="The number of items to return", - example=Defaults.API_CARD_LIMIT, + json_schema_extra={ + "example": Defaults.API_CARD_LIMIT, + }, default=Defaults.API_CARD_LIMIT, ) @@ -65,8 +73,10 @@ class TrackLimitSchema(BaseModel): limit: int = Field( description="The number of tracks to return", - example=Defaults.API_CARD_LIMIT, - default=Defaults.API_CARD_LIMIT, + json_schema_extra={ + "example": Defaults.API_CARD_LIMIT, + }, + default=5, alias="tracklimit", ) @@ -78,7 +88,9 @@ class AlbumLimitSchema(BaseModel): limit: int = Field( description="The number of albums to return", - example=Defaults.API_CARD_LIMIT, + json_schema_extra={ + "example": Defaults.API_CARD_LIMIT, + }, default=Defaults.API_CARD_LIMIT, alias="albumlimit", ) @@ -91,7 +103,9 @@ class ArtistLimitSchema(BaseModel): limit: int = Field( description="The number of artists to return", - example=Defaults.API_CARD_LIMIT, + json_schema_extra={ + "example": Defaults.API_CARD_LIMIT, + }, default=Defaults.API_CARD_LIMIT, alias="artistlimit", ) diff --git a/app/api/artist.py b/app/api/artist.py index 79c4c432..a90f5799 100644 --- a/app/api/artist.py +++ b/app/api/artist.py @@ -52,6 +52,7 @@ def get_artist(path: ArtistHashSchema, query: GetArtistQuery): Returns artist data, tracks and genres for the given artisthash. """ + print(query) artisthash = path.artisthash limit = query.limit @@ -68,6 +69,8 @@ def get_artist(path: ArtistHashSchema, query: GetArtistQuery): if artist.albumcount == 0 and tcount < 10: limit = tcount + print(limit) + try: year = datetime.fromtimestamp(artist.date).year except ValueError: