Something went wrong. Try again.
A music player that connects to your cloud/distributed storage. forked from tokono.ma/diffuse
Something went wrong. Try again.
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950module Sources.Services.Common exposing (cleanPath, noPrep)
import Sources exposing (..)import Sources.Processing exposing (..)import String.Ext as Stringimport Time
-- PATHS
{-| Clean a path.
>>> cleanPath " " ""
>>> cleanPath "/example" "example/"
>>> cleanPath "example" "example/"
>>> cleanPath "example/" "example/"
-}cleanPath : String -> StringcleanPath dirtyPath = dirtyPath |> String.trim |> String.chopStart "/" |> String.chopEnd "/" |> (\p -> if String.isEmpty p then p
else p ++ "/" )
-- PARSING
noPrep : String -> Time.Posix -> SourceData -> Marker -> PrepationAnswer MarkernoPrep _ _ srcData _ = { sourceData = srcData, marker = TheEnd }