add help text to recently played

+ read app version from the env
This commit is contained in:
mungai-njoroge
2023-12-09 22:18:20 +03:00
parent 336360d509
commit 312df06fc3
8 changed files with 31 additions and 13 deletions
+5 -4
View File
@@ -6,7 +6,7 @@ on:
tag: tag:
description: "Tag" description: "Tag"
required: true required: true
default: "v1.x.x" default: "1.x.x"
is_latest: is_latest:
description: "Set as latest" description: "Set as latest"
required: true required: true
@@ -75,6 +75,7 @@ jobs:
LASTFM_API_KEY: ${{ secrets.LASTFM_API_KEY }} LASTFM_API_KEY: ${{ secrets.LASTFM_API_KEY }}
PLUGIN_LYRICS_AUTHORITY: ${{ secrets.PLUGIN_LYRICS_AUTHORITY }} PLUGIN_LYRICS_AUTHORITY: ${{ secrets.PLUGIN_LYRICS_AUTHORITY }}
PLUGIN_LYRICS_ROOT_URL: ${{ secrets.PLUGIN_LYRICS_ROOT_URL }} PLUGIN_LYRICS_ROOT_URL: ${{ secrets.PLUGIN_LYRICS_ROOT_URL }}
SWINGMUSIC_APP_VERSION: ${{ inputs.tag }}
- name: Verify Linux build success - name: Verify Linux build success
if: matrix.os == 'ubuntu-20.04' if: matrix.os == 'ubuntu-20.04'
run: | run: |
@@ -119,11 +120,11 @@ jobs:
with: with:
artifacts: "./linux/swingmusic, ./win32/swingmusic.exe" artifacts: "./linux/swingmusic, ./win32/swingmusic.exe"
token: ${{ secrets.GITHUB_TOKEN }} token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ inputs.tag }} tag: ${{ format('v{0}',inputs.tag) }}
commit: ${{ github.sha }} commit: ${{ github.sha }}
draft: ${{ inputs.is_draft }} draft: ${{ inputs.is_draft }}
artifactErrorsFailBuild: true artifactErrorsFailBuild: true
name: ${{ inputs.tag }} name: ${{ format('v{0}',inputs.tag) }}
bodyFile: .github/changelog.md bodyFile: .github/changelog.md
makeLatest: ${{ inputs.is_latest }} makeLatest: ${{ inputs.is_latest }}
docker: docker:
@@ -167,7 +168,7 @@ jobs:
context: . context: .
platforms: linux/amd64,linux/arm, linux/arm64 platforms: linux/amd64,linux/arm, linux/arm64
push: true 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 labels: org.opencontainers.image.title=Docker
build-args: | build-args: |
--provenance=false --provenance=false
+1 -1
View File
@@ -42,9 +42,9 @@ class Albums(Resource):
sort_is_count = sort == "count" sort_is_count = sort == "count"
sort_is_duration = sort == "duration" sort_is_duration = sort == "duration"
sort_is_create_date = sort == "created_date"
sort_is_date = is_albums and sort == "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 = is_albums and sort == "albumartists"
sort_is_artist_trackcount = is_artists and sort == "trackcount" sort_is_artist_trackcount = is_artists and sort == "trackcount"
+3 -2
View File
@@ -5,7 +5,7 @@ from app.db.sqlite.settings import SettingsSQLMethods as sdb
from app.lib import populate from app.lib import populate
from app.lib.watchdogg import Watcher as WatchDog from app.lib.watchdogg import Watcher as WatchDog
from app.logger import log 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.albums import AlbumStore
from app.store.artists import ArtistStore from app.store.artists import ArtistStore
from app.store.tracks import TrackStore from app.store.tracks import TrackStore
@@ -182,7 +182,8 @@ def get_all_settings():
root_dirs = sdb.get_root_dirs() root_dirs = sdb.get_root_dirs()
s["root_dirs"] = root_dirs s["root_dirs"] = root_dirs
s['plugins'] = plugins s["plugins"] = plugins
s["version"] = Keys.SWINGMUSIC_APP_VERSION
return { return {
"settings": s, "settings": s,
+1
View File
@@ -47,6 +47,7 @@ class HandleArgs:
"LASTFM_API_KEY", "LASTFM_API_KEY",
"PLUGIN_LYRICS_AUTHORITY", "PLUGIN_LYRICS_AUTHORITY",
"PLUGIN_LYRICS_ROOT_URL", "PLUGIN_LYRICS_ROOT_URL",
"SWINGMUSIC_APP_VERSION",
] ]
lines = [] lines = []
+1
View File
@@ -1,3 +1,4 @@
LASTFM_API_KEY = "" LASTFM_API_KEY = ""
PLUGIN_LYRICS_AUTHORITY = "" PLUGIN_LYRICS_AUTHORITY = ""
PLUGIN_LYRICS_ROOT_URL = "" PLUGIN_LYRICS_ROOT_URL = ""
SWINGMUSIC_APP_VERSION = ""
-1
View File
@@ -176,7 +176,6 @@ def get_recent_items(cutoff_days: int, limit: int = 7):
older_artists.add(t.artist_hashes) older_artists.add(t.artist_hashes)
tracks = sorted(tracks, key=lambda t: t.created_date) tracks = sorted(tracks, key=lambda t: t.created_date)
groups = group_track_by_folders(tracks) groups = group_track_by_folders(tracks)
recent_items = [] recent_items = []
+17 -4
View File
@@ -48,6 +48,7 @@ def get_recently_played(limit=7):
"og_title", "og_title",
}, },
) )
album["help_text"] = "album"
items.append({"type": "album", "item": album}) items.append({"type": "album", "item": album})
continue continue
@@ -59,6 +60,7 @@ def get_recently_played(limit=7):
continue continue
artist = serialize_for_card(artist) artist = serialize_for_card(artist)
artist["help_text"] = "artist"
items.append({"type": "artist", "item": artist}) items.append({"type": "artist", "item": artist})
@@ -71,6 +73,7 @@ def get_recently_played(limit=7):
continue continue
track = serialize_track(track) track = serialize_track(track)
track["help_text"] = "track"
items.append({"type": "track", "item": track}) items.append({"type": "track", "item": track})
@@ -93,6 +96,7 @@ def get_recently_played(limit=7):
"item": { "item": {
"path": entry.type_src, "path": entry.type_src,
"count": count, "count": count,
"help_text": "folder",
}, },
} }
) )
@@ -104,12 +108,16 @@ def get_recently_played(limit=7):
if is_recently_added: if is_recently_added:
playlist, _ = get_recently_added_playlist() playlist, _ = get_recently_added_playlist()
playlist.images = [i["image"] for i in playlist.images] playlist.images = [i["image"] for i in playlist.images]
playlist = serialize_playlist(
playlist, to_remove={"settings", "duration"}
)
playlist["help_text"] = "playlist"
items.append( items.append(
{ {
"type": "playlist", "type": "playlist",
"item": serialize_playlist( "item": playlist,
playlist, to_remove={"settings", "duration"}
),
} }
) )
continue continue
@@ -126,6 +134,11 @@ def get_recently_played(limit=7):
images = [i["image"] for i in images] images = [i["image"] for i in images]
playlist.images = 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 return items
+3 -1
View File
@@ -242,6 +242,7 @@ class Keys:
LASTFM_API_KEY = os.environ.get("LASTFM_API_KEY") LASTFM_API_KEY = os.environ.get("LASTFM_API_KEY")
PLUGIN_LYRICS_AUTHORITY = os.environ.get("PLUGIN_LYRICS_AUTHORITY") PLUGIN_LYRICS_AUTHORITY = os.environ.get("PLUGIN_LYRICS_AUTHORITY")
PLUGIN_LYRICS_ROOT_URL = os.environ.get("PLUGIN_LYRICS_ROOT_URL") PLUGIN_LYRICS_ROOT_URL = os.environ.get("PLUGIN_LYRICS_ROOT_URL")
SWINGMUSIC_APP_VERSION = os.environ.get("SWINGMUSIC_APP_VERSION")
@classmethod @classmethod
def load(cls): def load(cls):
@@ -249,6 +250,7 @@ class Keys:
cls.LASTFM_API_KEY = configs.LASTFM_API_KEY cls.LASTFM_API_KEY = configs.LASTFM_API_KEY
cls.PLUGIN_LYRICS_AUTHORITY = configs.PLUGIN_LYRICS_AUTHORITY cls.PLUGIN_LYRICS_AUTHORITY = configs.PLUGIN_LYRICS_AUTHORITY
cls.PLUGIN_LYRICS_ROOT_URL = configs.PLUGIN_LYRICS_ROOT_URL cls.PLUGIN_LYRICS_ROOT_URL = configs.PLUGIN_LYRICS_ROOT_URL
cls.SWINGMUSIC_APP_VERSION = Release.APP_VERSION
cls.verify_keys() cls.verify_keys()
@@ -260,4 +262,4 @@ class Keys:
@classmethod @classmethod
def get(cls, key: str): def get(cls, key: str):
return getattr(cls, key, None) return getattr(cls, key, None)