Fix sort videos
This commit is contained in:
parent
af6afdc1dc
commit
8176884124
|
@ -77,14 +77,14 @@ videoMiniatureUrl video =
|
||||||
video.url ++ "miniature-050.png"
|
video.url ++ "miniature-050.png"
|
||||||
|
|
||||||
|
|
||||||
sortPlaylist : Playlist -> Playlist
|
sortPlaylistWithVideos : PlaylistWithVideos -> PlaylistWithVideos
|
||||||
sortPlaylist playlist =
|
sortPlaylistWithVideos playlist =
|
||||||
{ playlist | videos = List.sort playlist.videos |> List.reverse }
|
{ playlist | videos = List.sortBy .url playlist.videos |> List.reverse }
|
||||||
|
|
||||||
|
|
||||||
sortPlaylists : List Playlist -> List Playlist
|
sortPlaylists : List Playlist -> List Playlist
|
||||||
sortPlaylists playlists =
|
sortPlaylists playlists =
|
||||||
List.sortBy .url (List.map sortPlaylist playlists) |> List.reverse
|
List.sortBy .url playlists |> List.reverse
|
||||||
|
|
||||||
|
|
||||||
fetchPlaylists : Task x ( List Playlist, Time.Zone )
|
fetchPlaylists : Task x ( List Playlist, Time.Zone )
|
||||||
|
@ -127,6 +127,7 @@ fetchPlaylistWithVideos name =
|
||||||
fetchPlaylistVideoPaths name
|
fetchPlaylistVideoPaths name
|
||||||
|> Task.andThen (\c -> fetchVideos name c)
|
|> Task.andThen (\c -> fetchVideos name c)
|
||||||
|> Task.map (PlaylistWithVideos name a)
|
|> Task.map (PlaylistWithVideos name a)
|
||||||
|
|> Task.map sortPlaylistWithVideos
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue