diff --git a/go.mod b/go.mod index ab5a685..bbe92f3 100644 --- a/go.mod +++ b/go.mod @@ -18,17 +18,17 @@ require ( github.com/quarckster/go-mpris-server v1.0.3 github.com/supersonic-app/go-mpv v0.1.0 github.com/supersonic-app/go-subsonic v0.0.0-20241224013245-9b2841f3711d - github.com/zalando/go-keyring v0.2.1 + github.com/zalando/go-keyring v0.2.6 golang.org/x/net v0.25.0 - golang.org/x/sys v0.20.0 + golang.org/x/sys v0.26.0 golang.org/x/text v0.16.0 ) require ( + al.essio.dev/pkg/shellescape v1.5.1 // indirect fyne.io/systray v1.11.0 // indirect github.com/BurntSushi/toml v1.4.0 // indirect - github.com/alessio/shellescape v1.4.1 // indirect - github.com/danieljoos/wincred v1.1.0 // indirect + github.com/danieljoos/wincred v1.2.2 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/fredbi/uri v1.1.0 // indirect github.com/fsnotify/fsnotify v1.7.0 // indirect @@ -47,7 +47,7 @@ require ( github.com/rymdport/portal v0.3.0 // indirect github.com/srwiley/oksvg v0.0.0-20221011165216-be6e8873101c // indirect github.com/srwiley/rasterx v0.0.0-20220730225603-2ab79fcdd4ef // indirect - github.com/stretchr/testify v1.8.4 // indirect + github.com/stretchr/testify v1.9.0 // indirect github.com/yuin/goldmark v1.7.1 // indirect golang.org/x/image v0.18.0 // indirect golang.org/x/mobile v0.0.0-20231127183840-76ac6878050a // indirect diff --git a/go.sum b/go.sum index 76a574a..bc6d188 100644 --- a/go.sum +++ b/go.sum @@ -1,3 +1,5 @@ +al.essio.dev/pkg/shellescape v1.5.1 h1:86HrALUujYS/h+GtqoB26SBEdkWfmMI6FubjXlsXyho= +al.essio.dev/pkg/shellescape v1.5.1/go.mod h1:6sIqp7X2P6mThCQ7twERpZTuigpr6KbZWtls1U8I890= cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= @@ -47,8 +49,6 @@ github.com/BurntSushi/toml v1.4.0/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2 github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/Microsoft/go-winio v0.6.2 h1:F2VQgta7ecxGYO8k3ZZz3RS8fVIXVxONVUPlNERoyfY= github.com/Microsoft/go-winio v0.6.2/go.mod h1:yd8OoFMLzJbo9gZq8j5qaps8bJ9aShtEA8Ipt1oGCvU= -github.com/alessio/shellescape v1.4.1 h1:V7yhSDDn8LP4lc4jS8pFkt0zCnzVJlG5JXy9BVKJUX0= -github.com/alessio/shellescape v1.4.1/go.mod h1:PZAiSCk0LJaZkiCSkPv8qIobYglO3FPpyFjDCtHLS30= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= @@ -68,8 +68,8 @@ github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnht github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= github.com/coreos/go-systemd/v22 v22.3.2/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= -github.com/danieljoos/wincred v1.1.0 h1:3RNcEpBg4IhIChZdFRSdlQt1QjCp1sMAPIrOnm7Yf8g= -github.com/danieljoos/wincred v1.1.0/go.mod h1:XYlo+eRTsVA9aHGp7NGjFkPla4m+DCL7hqDjlFjiygg= +github.com/danieljoos/wincred v1.2.2 h1:774zMFJrqaeYCK2W57BgAem/MLi6mtSE47MB6BOJ0i0= +github.com/danieljoos/wincred v1.2.2/go.mod h1:w7w4Utbrz8lqeMbDAK0lkNJUv5sAOkFi7nd/ogr0Uh8= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -121,7 +121,6 @@ github.com/go-text/typesetting v0.2.0/go.mod h1:2+owI/sxa73XA581LAzVuEBZ3WEEV2pX github.com/go-text/typesetting-utils v0.0.0-20240317173224-1986cbe96c66 h1:GUrm65PQPlhFSKjLPGOZNPNxLCybjzjYBzjfoBGaDUY= github.com/go-text/typesetting-utils v0.0.0-20240317173224-1986cbe96c66/go.mod h1:DDxDdQEnB70R8owOx3LVpEFvpMK9eeH1o2r0yZhFI9o= github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= -github.com/godbus/dbus/v5 v5.0.6/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= github.com/godbus/dbus/v5 v5.1.0 h1:4KLkAxT3aOY8Li4FRJe/KvhoNFFxo0m6fNuFUO8QJUk= github.com/godbus/dbus/v5 v5.1.0/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= @@ -186,6 +185,8 @@ github.com/google/pprof v0.0.0-20210226084205-cbba55b83ad5/go.mod h1:kpwsk12EmLe github.com/google/pprof v0.0.0-20211214055906-6f57359322fd h1:1FjCyPC+syAzJ5/2S8fqdZK1R22vvA0J7JZKcuOIQ7Y= github.com/google/pprof v0.0.0-20211214055906-6f57359322fd/go.mod h1:KgnwoLYCZ8IQu3XUZ8Nc/bM9CCZFOyjUNOSygVozoDg= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= +github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 h1:El6M4kTTCOh6aBiKaUGG7oYTSPP8MxqL4YI3kZKwcP4= +github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510/go.mod h1:pupxD2MaaD3pAXIBCelhxNneeOaAeabZDe5s4K6zSpQ= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= @@ -295,8 +296,9 @@ github.com/srwiley/rasterx v0.0.0-20220730225603-2ab79fcdd4ef h1:Ch6Q+AZUxDBCVqd github.com/srwiley/rasterx v0.0.0-20220730225603-2ab79fcdd4ef/go.mod h1:nXTWP6+gD5+LUJ8krVhhoeHjvHTutPxMYl5SvkcnJNE= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= -github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= +github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY= +github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= @@ -306,8 +308,8 @@ github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= -github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= -github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= +github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= +github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= github.com/supersonic-app/go-mpv v0.1.0 h1:U+cCnLQxmpqx5mY6nMlC0J4uIdCCXUbAjpjS04XkFu8= github.com/supersonic-app/go-mpv v0.1.0/go.mod h1:1bQz6kBQumJopXEbkiqoLxIXLy7F7yWFBvknvpAtIC0= @@ -322,8 +324,8 @@ github.com/yuin/goldmark v1.4.0/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1 github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= github.com/yuin/goldmark v1.7.1 h1:3bajkSilaCbjdKVsKdZjZCLBNPL9pYzrCakKaf4U49U= github.com/yuin/goldmark v1.7.1/go.mod h1:uzxRWxtg69N339t3louHJ7+O03ezfj6PlliRlaOzY1E= -github.com/zalando/go-keyring v0.2.1 h1:MBRN/Z8H4U5wEKXiD67YbDAr5cj/DOStmSga70/2qKc= -github.com/zalando/go-keyring v0.2.1/go.mod h1:g63M2PPn0w5vjmEbwAX3ib5I+41zdm4esSETOn9Y6Dw= +github.com/zalando/go-keyring v0.2.6 h1:r7Yc3+H+Ux0+M72zacZoItR3UDxeWfKTcabvkI8ua9s= +github.com/zalando/go-keyring v0.2.6/go.mod h1:2TCrxYrbUNYfNS/Kgy/LSrkSQzZ5UPVH85RwfczwvcI= go.etcd.io/etcd/api/v3 v3.5.0/go.mod h1:cbVKeC6lCfl7j/8jBhAK6aIYO9XOjdptoxU/nLQcPvs= go.etcd.io/etcd/client/pkg/v3 v3.5.0/go.mod h1:IJHfcCEKxYu1Os13ZdwCwIUTUVGYTSAM3YSwc9/Ac1g= go.etcd.io/etcd/client/v2 v2.305.0/go.mod h1:h9puh54ZTgAKtEbut2oe9P4L/oqKCVB6xsXlzd7alYQ= @@ -504,8 +506,8 @@ golang.org/x/sys v0.0.0-20210809222454-d867a43fc93e/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.20.0 h1:Od9JTbYCk261bKm4M/mw7AklTlFYIa0bIp9BgSm1S8Y= -golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.26.0 h1:KHjCJyddX0LoSTb3J+vWpupP9p0oznkqVk/IfjymZbo= +golang.org/x/sys v0.26.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= diff --git a/res/translations/fr.json b/res/translations/fr.json index d886c16..eefdd6c 100644 --- a/res/translations/fr.json +++ b/res/translations/fr.json @@ -17,6 +17,7 @@ "All": "Tout", "All Tracks": "Toutes les pistes", "Alt. URL": "URL alternatif", + "An error occurred adding tracks to the playlist": "Une erreur s'est produite lors de l'ajout de pistes à la liste de lecture", "Are you sure you want to delete the server": "Êtes-vous sûr(e) de vouloir supprimer ce serveur ", "Artist": "Artiste", "Artist (A-Z)": "Artiste (A-Z)", @@ -25,8 +26,9 @@ "Audio device": "Périphérique audio", "Audio Drama": "Dramatique sonore", "Audiobook": "Livre audio", - "Auto": "Automatique", "Authentication failed": "Échec d'authentification", + "Auto": "Automatique", + "Autoplay": "Lecture auto", "Autoselect device": "Sélection automatique", "Back": "Retour", "Bit rate": "Débit binaire", @@ -69,6 +71,7 @@ "Enter": "Entrée", "EP": "EP", "Equalizer": "Égaliseur", + "Error": "Erreur", "Exclusive mode": "Mode exclusif", "Favorites": "Favoris", "Field Recording": "Enregistrement sur le terrain", @@ -104,6 +107,7 @@ "min": "min", "minutes of track have been played": "minutes d'une piste ont été lues", "Mixtape": "Mixtape", + "Mode": "Mode", "Mute": "Couper le son", "My Server": "Mon serveur", "Name": "Nom", @@ -182,10 +186,12 @@ "Size": "Taille", "Skip duplicate tracks": "Ne pas lire les doublons de pistes", "Skip this version": "Ne pas utiliser cette version", + "Sort": "Trier", "Soundtrack": "Bande originale", "Spoken Word": "Spoken Word", "Startup page": "Page de démarrage", "Stopped": "Arrêté", + "Success": "Succès", "Support the project": "Soutenir le projet", "Switch Servers": "Changer de serveur", "Testing connection": "Test de connexion", @@ -204,6 +210,8 @@ "Track peak": "Niveau maximum de la piste", "tracks": "pistes", "UI Scaling": "Taille de l'interface", + "Unable to play artist radio": "Lecture de radio impossible", + "Unable to play random tracks": "Lecture aléatoire de pistes impossible", "URL": "URL", "Use legacy authentication": "Utiliser l'authentification héritée", "Username": "Nom d'utilisateur", diff --git a/res/translations/ja.json b/res/translations/ja.json index 6d7eb54..5ed7dbc 100644 --- a/res/translations/ja.json +++ b/res/translations/ja.json @@ -17,6 +17,7 @@ "All": "すべて", "All Tracks": "すべての曲", "Alt. URL": "代替URL", + "An error occurred adding tracks to the playlist": "プレイリストにトラックを追加する際にエラーが発生しました", "Are you sure you want to delete the server": "サーバーを削除してもよろしいですか?", "Artist": "アーティスト", "Artist (A-Z)": "アーティスト (A-Z)", @@ -27,6 +28,7 @@ "Audiobook": "オーディオブック", "Authentication failed": "認証に失敗しました", "Auto": "自動", + "Autoplay": "自動再生", "Autoselect device": "デバイスを自動選択", "Back": "戻る", "Bit rate": "ビットレート", @@ -69,6 +71,7 @@ "Enter": "入力", "EP": "EP", "Equalizer": "イコライザー", + "Error": "エラー", "Exclusive mode": "排他モード", "Favorites": "お気に入り", "Field Recording": "フィールドレコーディング", @@ -104,6 +107,7 @@ "min": "分", "minutes of track have been played": "トラックの再生時間", "Mixtape": "ミックステープ", + "Mode": "モード", "Mute": "ミュート", "My Server": "自分のサーバー", "Name": "名前", @@ -155,7 +159,7 @@ "Restart required": "再起動が必要です", "Save play queue on exit": "終了時に再生キューを保存する", "Saved at": "保存場所", - "Scrobble when": "Scrobble when", + "Scrobble when": "スクロールすると", "Search Everywhere": "全体から検索", "Search page": "検索ページ", "Search playlists or new playlist name": "プレイリストを検索または新しいプレイリスト名", @@ -182,10 +186,12 @@ "Size": "サイズ", "Skip duplicate tracks": "重複トラックをスキップ", "Skip this version": "このバージョンをスキップ", + "Sort": "ソート", "Soundtrack": "サウンドトラック", "Spoken Word": "スポークン・ワード", "Startup page": "起動時のページ", "Stopped": "停止", + "Success": "成功", "Support the project": "プロジェクトを支援する", "Switch Servers": "サーバーの切替", "Testing connection": "接続テスト", @@ -204,6 +210,8 @@ "Track peak": "トラックピーク", "tracks": "トラック", "UI Scaling": "UIスケーリング", + "Unable to play artist radio": "アーティストラジオを再生できません", + "Unable to play random tracks": "ランダムトラックを再生できません", "URL": "URL", "Use legacy authentication": "レガシー認証を使用する", "Username": "ユーザー名", @@ -229,9 +237,21 @@ "Play song radio": "曲をラジオで再生", "to":"to", "by":"by", + "Jan": "1月", + "Feb": "2月", + "Mar": "3月", + "Apr": "4月", + "May": "5月", + "Jun": "6月", + "Jul": "7月", + "Aug": "8月", + "Sept": "9月", + "Oct": "10月", + "Nov": "11月", + "Dec": "12月", "playlist.addedtracks": { - "one": "Added {{.trackCount}} track to playlist", - "other": "Added {{.trackCount}} tracks to playlist" + "one": "プレイリストにトラックを追加しました", + "other": "プレイリストに{{.trackCount}}個のトラックを追加しました" } } diff --git a/ui/browsing/artistpage.go b/ui/browsing/artistpage.go index e2403a1..8b8c793 100644 --- a/ui/browsing/artistpage.go +++ b/ui/browsing/artistpage.go @@ -247,7 +247,7 @@ func (a *ArtistPage) load() { return } a.artistInfo = artist - a.header.Update(artist) + a.header.Update(artist, a.im) if a.activeView == 0 { a.showAlbumGrid(false /*reSort*/) } else { @@ -361,17 +361,19 @@ const artistBioNotAvailableKey = "Artist biography not available." type ArtistPageHeader struct { widget.BaseWidget - artistID string - artistPage *ArtistPage - artistImage *widgets.ImagePlaceholder - titleDisp *widget.RichText - biographyDisp *widgets.MaxRowsLabel - similarArtists *fyne.Container - favoriteBtn *widgets.FavoriteButton - playBtn *widget.Button - playRadioBtn *widget.Button - menuBtn *widget.Button - container *fyne.Container + artistID string + artistPage *ArtistPage + artistImage *widgets.ImagePlaceholder + artistImageID string + titleDisp *widget.RichText + biographyDisp *widgets.MaxRowsLabel + similarArtists *fyne.Container + favoriteBtn *widgets.FavoriteButton + playBtn *widget.Button + playRadioBtn *widget.Button + menuBtn *widget.Button + container *fyne.Container + fullSizeCoverFetching bool //shareMenuItem *fyne.MenuItem } @@ -388,11 +390,7 @@ func NewArtistPageHeader(page *ArtistPage) *ArtistPageHeader { SizeName: theme.SizeNameHeadingText, } a.artistImage = widgets.NewImagePlaceholder(myTheme.ArtistIcon, 225) - a.artistImage.OnTapped = func(*fyne.PointEvent) { - if im := a.artistImage.Image(); im != nil { - a.artistPage.contr.ShowPopUpImage(im) - } - } + a.artistImage.OnTapped = func(*fyne.PointEvent) { go a.showPopUpCover() } a.favoriteBtn = widgets.NewFavoriteButton(func() { go a.toggleFavorited() }) a.playBtn = widget.NewButtonWithIcon(lang.L("Play Discography"), theme.MediaPlayIcon(), func() { go a.artistPage.pm.PlayArtistDiscography(a.artistID, false /*shuffle*/) @@ -443,6 +441,7 @@ func NewArtistPageHeader(page *ArtistPage) *ArtistPageHeader { func (a *ArtistPageHeader) Clear() { a.artistID = "" + a.artistImageID = "" a.favoriteBtn.IsFavorited = false a.titleDisp.Segments[0].(*widget.TextSegment).Text = "" a.biographyDisp.Text = lang.L(artistBioNotAvailableKey) @@ -450,9 +449,10 @@ func (a *ArtistPageHeader) Clear() { obj.Hide() } a.artistImage.SetImage(nil, false) + a.fullSizeCoverFetching = false } -func (a *ArtistPageHeader) Update(artist *mediaprovider.ArtistWithAlbums) { +func (a *ArtistPageHeader) Update(artist *mediaprovider.ArtistWithAlbums, im *backend.ImageManager) { if artist == nil { return } @@ -464,11 +464,14 @@ func (a *ArtistPageHeader) Update(artist *mediaprovider.ArtistWithAlbums) { if artist.CoverArtID == "" { return } - if im, err := a.artistPage.im.GetCoverThumbnail(artist.CoverArtID); err != nil { - log.Printf("failed to load artist image: %v", err) - } else { - a.artistImage.SetImage(im, true /*tappable*/) - } + a.artistImageID = artist.CoverArtID + go func() { + if cover, err := im.GetCoverThumbnail(artist.CoverArtID); err == nil { + a.artistImage.SetImage(cover, true) + } else { + log.Printf("error fetching cover: %v", err) + } + }() } func (a *ArtistPageHeader) UpdateInfo(info *mediaprovider.ArtistInfo) { @@ -517,6 +520,28 @@ func (a *ArtistPageHeader) UpdateInfo(info *mediaprovider.ArtistInfo) { } } +func (a *ArtistPageHeader) showPopUpCover() { + if a.artistImageID == "" { + if im := a.artistImage.Image(); im != nil { + a.artistPage.contr.ShowPopUpImage(im) + } + } else { + if a.fullSizeCoverFetching { + return + } + a.fullSizeCoverFetching = true + defer func() { a.fullSizeCoverFetching = false }() + cover, err := a.artistPage.im.GetFullSizeCoverArt(a.artistImageID) + if err != nil { + log.Printf("error getting full size album cover: %s", err.Error()) + return + } + if a.artistPage != nil { + a.artistPage.contr.ShowPopUpImage(cover) + } + } +} + func (a *ArtistPageHeader) toggleFavorited() { params := mediaprovider.RatingFavoriteParameters{ArtistIDs: []string{a.artistID}} a.artistPage.mp.SetFavorite(params, a.favoriteBtn.IsFavorited)