diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4fb206d9..69851165 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -6,7 +6,7 @@ on: tag: description: "Tag" required: true - default: "v1.x.x" + default: "1.x.x" is_latest: description: "Set as latest" required: true @@ -75,6 +75,7 @@ jobs: LASTFM_API_KEY: ${{ secrets.LASTFM_API_KEY }} PLUGIN_LYRICS_AUTHORITY: ${{ secrets.PLUGIN_LYRICS_AUTHORITY }} PLUGIN_LYRICS_ROOT_URL: ${{ secrets.PLUGIN_LYRICS_ROOT_URL }} + SWINGMUSIC_APP_VERSION: ${{ inputs.tag }} - name: Verify Linux build success if: matrix.os == 'ubuntu-20.04' run: | @@ -119,11 +120,11 @@ jobs: with: artifacts: "./linux/swingmusic, ./win32/swingmusic.exe" token: ${{ secrets.GITHUB_TOKEN }} - tag: ${{ inputs.tag }} + tag: ${{ format('v{0}',inputs.tag) }} commit: ${{ github.sha }} draft: ${{ inputs.is_draft }} artifactErrorsFailBuild: true - name: ${{ inputs.tag }} + name: ${{ format('v{0}',inputs.tag) }} bodyFile: .github/changelog.md makeLatest: ${{ inputs.is_latest }} docker: @@ -167,7 +168,7 @@ jobs: context: . platforms: linux/amd64,linux/arm, linux/arm64 push: true - tags: ghcr.io/${{github.repository}}:${{inputs.tag}}, ${{env.LATEST_TAG}} + tags: ghcr.io/${{github.repository}}:${{format('v{0}', inputs.tag)}}, ${{env.LATEST_TAG}} labels: org.opencontainers.image.title=Docker build-args: | --provenance=false diff --git a/app/api/getall/resources.py b/app/api/getall/resources.py index c4199677..6bbae073 100644 --- a/app/api/getall/resources.py +++ b/app/api/getall/resources.py @@ -42,9 +42,9 @@ class Albums(Resource): sort_is_count = sort == "count" sort_is_duration = sort == "duration" + sort_is_create_date = sort == "created_date" sort_is_date = is_albums and sort == "date" - sort_is_create_date = is_albums and sort == "created_date" sort_is_artist = is_albums and sort == "albumartists" sort_is_artist_trackcount = is_artists and sort == "trackcount" diff --git a/app/api/settings.py b/app/api/settings.py index c8542371..92ccdf2c 100644 --- a/app/api/settings.py +++ b/app/api/settings.py @@ -5,7 +5,7 @@ from app.db.sqlite.settings import SettingsSQLMethods as sdb from app.lib import populate from app.lib.watchdogg import Watcher as WatchDog from app.logger import log -from app.settings import Paths, SessionVarKeys, set_flag +from app.settings import Keys, Paths, SessionVarKeys, set_flag from app.store.albums import AlbumStore from app.store.artists import ArtistStore from app.store.tracks import TrackStore @@ -182,7 +182,8 @@ def get_all_settings(): root_dirs = sdb.get_root_dirs() s["root_dirs"] = root_dirs - s['plugins'] = plugins + s["plugins"] = plugins + s["version"] = Keys.SWINGMUSIC_APP_VERSION return { "settings": s, diff --git a/app/arg_handler.py b/app/arg_handler.py index 11719a71..8ef24597 100644 --- a/app/arg_handler.py +++ b/app/arg_handler.py @@ -47,6 +47,7 @@ class HandleArgs: "LASTFM_API_KEY", "PLUGIN_LYRICS_AUTHORITY", "PLUGIN_LYRICS_ROOT_URL", + "SWINGMUSIC_APP_VERSION", ] lines = [] diff --git a/app/configs.py b/app/configs.py index cbd6b848..5444d386 100644 --- a/app/configs.py +++ b/app/configs.py @@ -1,3 +1,4 @@ LASTFM_API_KEY = "" PLUGIN_LYRICS_AUTHORITY = "" PLUGIN_LYRICS_ROOT_URL = "" +SWINGMUSIC_APP_VERSION = "" diff --git a/app/lib/home/recentlyadded.py b/app/lib/home/recentlyadded.py index d49e08da..04acf204 100644 --- a/app/lib/home/recentlyadded.py +++ b/app/lib/home/recentlyadded.py @@ -176,7 +176,6 @@ def get_recent_items(cutoff_days: int, limit: int = 7): older_artists.add(t.artist_hashes) tracks = sorted(tracks, key=lambda t: t.created_date) - groups = group_track_by_folders(tracks) recent_items = [] diff --git a/app/lib/home/recentlyplayed.py b/app/lib/home/recentlyplayed.py index 0f8d871e..c67f8f5f 100644 --- a/app/lib/home/recentlyplayed.py +++ b/app/lib/home/recentlyplayed.py @@ -48,6 +48,7 @@ def get_recently_played(limit=7): "og_title", }, ) + album["help_text"] = "album" items.append({"type": "album", "item": album}) continue @@ -59,6 +60,7 @@ def get_recently_played(limit=7): continue artist = serialize_for_card(artist) + artist["help_text"] = "artist" items.append({"type": "artist", "item": artist}) @@ -71,6 +73,7 @@ def get_recently_played(limit=7): continue track = serialize_track(track) + track["help_text"] = "track" items.append({"type": "track", "item": track}) @@ -93,6 +96,7 @@ def get_recently_played(limit=7): "item": { "path": entry.type_src, "count": count, + "help_text": "folder", }, } ) @@ -104,12 +108,16 @@ def get_recently_played(limit=7): if is_recently_added: playlist, _ = get_recently_added_playlist() playlist.images = [i["image"] for i in playlist.images] + + playlist = serialize_playlist( + playlist, to_remove={"settings", "duration"} + ) + + playlist["help_text"] = "playlist" items.append( { "type": "playlist", - "item": serialize_playlist( - playlist, to_remove={"settings", "duration"} - ), + "item": playlist, } ) continue @@ -126,6 +134,11 @@ def get_recently_played(limit=7): images = [i["image"] for i in images] playlist.images = images - items.append({"type": "playlist", "item": serialize_playlist(playlist)}) + items.append( + { + "type": "playlist", + "item": {"help_text": "playlist", **serialize_playlist(playlist)}, + } + ) return items diff --git a/app/settings.py b/app/settings.py index 5e8d5f3c..e4456f44 100644 --- a/app/settings.py +++ b/app/settings.py @@ -242,6 +242,7 @@ class Keys: LASTFM_API_KEY = os.environ.get("LASTFM_API_KEY") PLUGIN_LYRICS_AUTHORITY = os.environ.get("PLUGIN_LYRICS_AUTHORITY") PLUGIN_LYRICS_ROOT_URL = os.environ.get("PLUGIN_LYRICS_ROOT_URL") + SWINGMUSIC_APP_VERSION = os.environ.get("SWINGMUSIC_APP_VERSION") @classmethod def load(cls): @@ -249,6 +250,7 @@ class Keys: cls.LASTFM_API_KEY = configs.LASTFM_API_KEY cls.PLUGIN_LYRICS_AUTHORITY = configs.PLUGIN_LYRICS_AUTHORITY cls.PLUGIN_LYRICS_ROOT_URL = configs.PLUGIN_LYRICS_ROOT_URL + cls.SWINGMUSIC_APP_VERSION = Release.APP_VERSION cls.verify_keys() @@ -260,4 +262,4 @@ class Keys: @classmethod def get(cls, key: str): - return getattr(cls, key, None) \ No newline at end of file + return getattr(cls, key, None)