Skip to content

Commit

Permalink
Sort by descending publish date
Browse files Browse the repository at this point in the history
  • Loading branch information
Dzoukr committed Jan 11, 2022
1 parent fed200c commit 9541f50
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Funcaster/Functions.fs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ type Functions(log:ILogger<Functions>, podcast:PodcastTable, episodes:EpisodesTa
let! channelOpt = getPodcast podcast ()
let channel = channelOpt |> Option.defaultValue Stubs.getEmptyChannel
let! allItems = getEpisodes episodes ()
let items = allItems |> List.filter (fun x -> x.Publish <= DateTimeOffset.UtcNow)
let items = allItems |> List.filter (fun x -> x.Publish <= DateTimeOffset.UtcNow) |> List.sortByDescending (fun x -> x.Publish)
let res = req.CreateResponse(HttpStatusCode.OK)
res.Headers.Add("Content-Type", "application/rss+xml; charset=utf-8");
RssXml.getDoc channel items |> RssXml.toString |> res.WriteString
Expand Down

0 comments on commit 9541f50

Please sign in to comment.