diff --git a/pioneer/packages/joy-media/src/transport.ts b/pioneer/packages/joy-media/src/transport.ts index 788a4c7562..2401a3736e 100644 --- a/pioneer/packages/joy-media/src/transport.ts +++ b/pioneer/packages/joy-media/src/transport.ts @@ -158,7 +158,7 @@ export abstract class MediaTransport extends Transport { async videosByChannelId (channelId: ChannelId, limit?: number, additionalFilter?: (x: VideoType) => boolean): Promise { let videos = (await this.allVideos()) .filter(x => channelId && channelId.eq(x.channelId) && (additionalFilter || (() => true))(x)) - .sort(x => -1 * x.id); + .sort((a, b) => b.id - a.id); if (limit && limit > 0) { videos = videos.slice(0, limit); @@ -208,7 +208,7 @@ export abstract class MediaTransport extends Transport { async allPublicVideoChannels (): Promise { return (await this.allVideoChannels()) .filter(isPublicChannel) - .sort(x => -1 * x.id); + .sort((a, b) => b.id - a.id); } async latestPublicVideoChannels (limit = 6): Promise { @@ -236,7 +236,7 @@ export abstract class MediaTransport extends Transport { return (await this.allVideos()) .filter(isPublicAndNotCurated) - .sort(x => -1 * x.id); + .sort((a, b) => b.id - a.id); } async latestPublicVideos (limit = 12): Promise {