A music player that connects to your cloud/distributed storage.

chore: adjust elm-review to new dev env

+64 -65
+3 -2
Justfile
··· 7 7 SYSTEM_DIR := "./system" 8 8 9 9 ESBUILD := "node system/Js/esbuild.mjs" 10 + ELM_REVIEW := NPM_DIR + "/.bin/elm-review " + SRC_DIR + " --config system/Review --compiler " + NPM_DIR + "/.bin/elm --elm-format-path " + NPM_DIR + "/.bin/elm-format" 10 11 11 12 12 13 default: dev ··· 183 184 echo "> Running elm-format" 184 185 {{NPM_DIR}}/.bin/elm-format {{SRC_DIR}} --yes 185 186 echo "> Running elm-review" 186 - {{NPM_DIR}}/.bin/elm-review {{SRC_DIR}} --config system/Review --fix-all 187 + {{ELM_REVIEW}} --fix-all 187 188 188 189 189 190 @quality: check-versions 190 191 echo "> Running es-lint" 191 192 {{NPM_DIR}}/.bin/eslint src/Javascript/**/* 192 193 echo "> Running elm-review" 193 - {{NPM_DIR}}/.bin/elm-review {{SRC_DIR}} --config system/Review 194 + {{ELM_REVIEW}} 194 195 195 196 196 197 @server:
-1
src/Applications/UI/Tracks/Covers.elm
··· 3 3 import Base64 4 4 import Conditional exposing (ifThenElse) 5 5 import Dict 6 - import List.Extra as List 7 6 import Maybe.Extra as Maybe 8 7 import Tracks exposing (..) 9 8
+15 -22
src/Applications/UI/Tracks/Scene/Covers.elm
··· 666 666 nowPlayingId = 667 667 Maybe.unwrap "" (.identifiedTrack >> Tuple.second >> .id) nowPlaying 668 668 669 - album = 670 - cover.identifiedTrackCover 671 - |> Tuple.second 672 - |> .tags 673 - |> .album 674 - 675 669 missingTracks = 676 - List.any 677 - (Tuple.first >> .isMissing) 678 - cover.tracks 670 + List.any 671 + (Tuple.first >> .isMissing) 672 + cover.tracks 679 673 680 674 maybeBlobUrlFromCache = 681 675 cachedCovers ··· 803 797 804 798 missingTracks = 805 799 List.any 806 - (Tuple.first >> .isMissing) 807 - cover.tracks 800 + (Tuple.first >> .isMissing) 801 + cover.tracks 808 802 in 809 803 brick 810 804 (if clickable then ··· 831 825 , "pt-px" 832 826 , "truncate" 833 827 ] 834 - [ 835 - case sortBy of 836 - Album -> 828 + [ case sortBy of 829 + Album -> 837 830 if missingTracks then 838 - text "Missing tracks" 831 + text "Missing tracks" 839 832 840 833 else 841 - text (Maybe.withDefault "Unknown album" track.tags.album) 834 + text (Maybe.withDefault "Unknown album" track.tags.album) 842 835 843 - Artist -> 836 + Artist -> 844 837 if missingTracks then 845 - text "Missing tracks" 838 + text "Missing tracks" 846 839 847 840 else 848 - text (Maybe.withDefault "Unknown artist" track.tags.artist) 841 + text (Maybe.withDefault "Unknown artist" track.tags.artist) 849 842 850 - _ -> 851 - nothing 843 + _ -> 844 + nothing 852 845 ] 853 846 854 847 -- ··· 866 859 867 860 else if not missingTracks && Maybe.isJust track.tags.artist then 868 861 text (Maybe.withDefault "" track.tags.artist) 862 + 869 863 else 870 864 case List.length cover.trackIds of 871 865 1 -> ··· 873 867 874 868 n -> 875 869 text (String.fromInt n ++ " tracks") 876 - 877 870 878 871 Artist -> 879 872 case List.length cover.trackIds of
+33 -30
src/Library/Tracks.elm
··· 2 2 3 3 import Base64 4 4 import List.Extra as List 5 + import Maybe.Extra as Maybe 5 6 import Playlists exposing (Playlist, PlaylistTrack) 6 7 import String.Ext as String 7 8 import Time 8 9 import Time.Ext as Time 9 - import Maybe.Extra as Maybe 10 10 11 11 12 12 ··· 220 220 , scrollContext = "" 221 221 } 222 222 223 + 223 224 {-| If a track doesn't fit into a group, where does it go? 224 225 -} 225 226 fallbackCoverGroup : String 226 227 fallbackCoverGroup = 227 - "MISSING_TRACK_INFO" 228 + "MISSING_TRACK_INFO" 229 + 228 230 229 231 {-| This value is used as a fallback in the UI if the album is missing. 230 232 -} 231 233 fallbackAlbum : String 232 234 fallbackAlbum = 233 - "" 235 + "" 236 + 234 237 235 238 {-| This value is used as a fallback in the UI if the artist is missing. 236 239 -} 237 240 fallbackArtist : String 238 241 fallbackArtist = 239 - "" 242 + "" 243 + 240 244 241 245 242 246 -- MORE STUFF ··· 245 249 coverGroup : SortBy -> IdentifiedTrack -> String 246 250 coverGroup sort ( identifiers, { tags } as track ) = 247 251 if identifiers.isMissing then 248 - "MISSING_TRACKS" 252 + "MISSING_TRACKS" 253 + 249 254 else 250 - (case sort of 251 - Artist -> 252 - Maybe.unwrap fallbackCoverGroup (String.trim >> String.toLower) tags.artist 255 + case sort of 256 + Artist -> 257 + Maybe.unwrap fallbackCoverGroup (String.trim >> String.toLower) tags.artist 253 258 254 - Album -> 255 - -- There is the possibility of albums with the same name, 256 - -- such as "Greatests Hits". 257 - -- To make sure we treat those as different albums, 258 - -- we prefix the album by its parent directory. 259 + Album -> 260 + -- There is the possibility of albums with the same name, 261 + -- such as "Greatests Hits". 262 + -- To make sure we treat those as different albums, 263 + -- we prefix the album by its parent directory. 264 + case tags.album of 265 + Just album -> 266 + (identifiers.parentDirectory ++ album) 267 + |> String.trim 268 + |> String.toLower 259 269 260 - case tags.album of 261 - Just album -> 262 - (identifiers.parentDirectory ++ album) 263 - |> String.trim 264 - |> String.toLower 265 - Nothing -> 266 - fallbackCoverGroup 267 - 268 - PlaylistIndex -> 269 - "" 270 + Nothing -> 271 + fallbackCoverGroup 270 272 271 - Title -> 272 - tags.title 273 - ) 273 + PlaylistIndex -> 274 + "" 274 275 276 + Title -> 277 + tags.title 275 278 276 279 277 280 coverKey : Bool -> Track -> String 278 281 coverKey isVariousArtists { tags } = 279 - if isVariousArtists then 280 - Maybe.withDefault "?" tags.album 282 + if isVariousArtists then 283 + Maybe.withDefault "?" tags.album 281 284 282 - else 283 - Maybe.withDefault "?" tags.artist ++ " --- " ++ Maybe.withDefault "?" tags.album 285 + else 286 + Maybe.withDefault "?" tags.artist ++ " --- " ++ Maybe.withDefault "?" tags.album 284 287 285 288 286 289 isNowPlaying : IdentifiedTrack -> IdentifiedTrack -> Bool
-2
src/Library/Tracks/Collection/Internal/Identify.elm
··· 2 2 3 3 import Dict 4 4 import List.Extra as List 5 - import Maybe.Extra as Maybe 6 5 import Time.Ext as Time 7 6 import Tracks exposing (..) 8 - import Tracks.Favourites as Favourites 9 7 10 8 11 9
+1 -2
src/Library/Tracks/Favourites.elm
··· 2 2 3 3 import List.Extra as List 4 4 import Maybe.Extra as Maybe 5 - import Tracks exposing (Favourite, IdentifiedTrack, Track) 6 - import Tracks exposing (fallbackArtist) 5 + import Tracks exposing (Favourite, IdentifiedTrack, Track, fallbackArtist) 7 6 8 7 9 8
+12 -6
src/Library/Tracks/Sorting.elm
··· 106 106 nr = 107 107 .tags >> .nr 108 108 109 + 109 110 isMissing : Identifiers -> Bool 110 111 isMissing = 111 112 .isMissing ··· 128 129 else 129 130 order 130 131 132 + 131 133 andThenCompareBools : (ctx -> Bool) -> ctx -> ctx -> Order -> Order 132 134 andThenCompareBools fn a b order = 133 135 if order == EQ then 134 136 let 135 - af = fn a 136 - bf = fn b 137 + af = 138 + fn a 139 + 140 + bf = 141 + fn b 137 142 in 138 143 if af == bf then 139 - EQ 144 + EQ 145 + 140 146 else if af == False then 141 - GT 142 - else 143 - LT 147 + GT 144 148 149 + else 150 + LT 145 151 146 152 else 147 153 order