Browse Source

Merge branch 'master' into update-from-master

Mokhtar Naamani 4 years ago
parent
commit
34953129d4
1 changed files with 4 additions and 4 deletions
  1. 4 4
      pioneer/packages/joy-media/src/transport.ts

+ 4 - 4
pioneer/packages/joy-media/src/transport.ts

@@ -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);
@@ -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[]> {
@@ -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[]> {