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

Configure Feed

Select the types of activity you want to include in your feed.

fix: Prefer file extension over mime type in WebDAV sources + ignore Synology metadata

+36 -21
+1 -1
Justfile
··· 226 226 227 227 228 228 @watch-elm: 229 - watchexec -p -w {{SRC_DIR}} -e elm -- just elm css 229 + watchexec -p -w {{SRC_DIR}} -e elm -- just elm js css 230 230 231 231 232 232 @watch-js:
+35 -20
src/Library/Sources/Services/WebDav/Parser.elm
··· 1 1 module Sources.Services.WebDav.Parser exposing (..) 2 2 3 3 import Maybe.Extra as Maybe 4 + import Sources.Pick exposing (isMusicFile) 4 5 import Sources.Processing exposing (Marker, TreeAnswer) 5 6 import Sources.Services.Ipfs.Marker as Marker 6 7 import String.Ext as String ··· 82 83 withNamespace = 83 84 String.append namespace 84 85 in 85 - map2 86 - (\_ h -> h) 87 - (oneOf 88 - [ -- Audio 89 - -------- 90 - string 91 - |> single 92 - |> path [ withNamespace "propstat", withNamespace "prop", withNamespace "getcontenttype" ] 93 - |> andThen mustBeAudio 86 + string 87 + |> single 88 + |> path [ withNamespace "href" ] 89 + |> andThen 90 + (\href -> 91 + oneOf 92 + [ -- Audio 93 + -------- 94 + string 95 + |> single 96 + |> path [ withNamespace "propstat", withNamespace "prop", withNamespace "getcontenttype" ] 97 + |> andThen (mustBeAudio href) 98 + |> map (\_ -> href) 94 99 95 - -- Directory 96 - ------------ 97 - , string 98 - |> single 99 - |> path [ withNamespace "propstat", withNamespace "prop", withNamespace "resourcetype", withNamespace "collection" ] 100 - ] 101 - ) 102 - (path [ withNamespace "href" ] (single string)) 100 + -- Directory 101 + ------------ 102 + , string 103 + |> single 104 + |> path [ withNamespace "propstat", withNamespace "prop", withNamespace "resourcetype", withNamespace "collection" ] 105 + |> andThen 106 + (\_ -> 107 + if String.endsWith "/@eaDir/" href then 108 + fail "Ignore Synology metadata" 109 + 110 + else 111 + succeed href 112 + ) 113 + ] 114 + ) 103 115 104 116 105 - mustBeAudio : String -> Decoder String 106 - mustBeAudio contentType = 107 - if String.startsWith "audio/" contentType then 117 + mustBeAudio : String -> String -> Decoder String 118 + mustBeAudio href contentType = 119 + if isMusicFile href then 120 + succeed contentType 121 + 122 + else if String.startsWith "audio/" contentType then 108 123 succeed contentType 109 124 110 125 else