Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions pioneer/packages/joy-media/src/transport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,8 @@ export abstract class MediaTransport {

async videosByChannelId (channelId: ChannelId, limit?: number, additionalFilter?: (x: VideoType) => boolean): Promise<VideoType[]> {
let videos = (await this.allVideos())
.filter((x) => channelId && channelId.eq(x.channelId) && (additionalFilter || (() => true))(x))
.sort((x) => -1 * x.id);
.filter(x => channelId && channelId.eq(x.channelId) && (additionalFilter || (() => true))(x))
.sort((a, b) => b.id - a.id);

if (limit && limit > 0) {
videos = videos.slice(0, limit);
Expand Down Expand Up @@ -218,7 +218,7 @@ export abstract class MediaTransport {
async allPublicVideoChannels (): Promise<ChannelEntity[]> {
return (await this.allVideoChannels())
.filter(isPublicChannel)
.sort((x) => -1 * x.id);
.sort((a, b) => b.id - a.id);
}

async latestPublicVideoChannels (limit = 6): Promise<ChannelEntity[]> {
Expand Down Expand Up @@ -247,7 +247,7 @@ export abstract class MediaTransport {

return (await this.allVideos())
.filter(isPublicAndNotCurated)
.sort((x) => -1 * x.id);
.sort((a, b) => b.id - a.id);
}

async latestPublicVideos (limit = 12): Promise<VideoType[]> {
Expand Down