Skip to content

Commit

Permalink
Use start attribute for sorting
Browse files Browse the repository at this point in the history
  • Loading branch information
MatthiasReumann committed Aug 30, 2023
1 parent 2b0e72f commit 834806c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions web/ts/data-store/stream-playlist.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ export class StreamPlaylistProvider extends StreamableMapProvider<number, Stream
const result = await StreamPlaylist.get(streamId);
return result
.map((e) => {
e.createdAtDate = new Date(e.createdAt);
e.startDate = new Date(e.start);
return e;
})
.sort((a, b) => a.createdAtDate.getTime() - b.createdAtDate.getTime());
.sort((a, b) => (a.startDate < b.startDate ? -1 : 1));
}
}

Expand All @@ -23,7 +23,7 @@ export type StreamPlaylistEntry = {
createdAt: string;

// Client Generated
createdAtDate: Date;
startDate: Date;
};

const StreamPlaylist = {
Expand Down

0 comments on commit 834806c

Please sign in to comment.