Fix resolution order
authorChocobozzz <me@florianbigard.com>
Mon, 19 Mar 2018 14:37:31 +0000 (15:37 +0100)
committerChocobozzz <me@florianbigard.com>
Mon, 19 Mar 2018 14:37:31 +0000 (15:37 +0100)
server/models/video/video.ts

index 78789ba2c50a41f0fe773d03cba5678adebfd94d..4e175c410ee2d9ab0633da2a8dda088e7ec30e47 100644 (file)
@@ -990,8 +990,8 @@ export class VideoModel extends Model<VideoModel> {
         }
       })
       .sort((a, b) => {
-        if (a.resolution < b.resolution) return 1
-        if (a.resolution === b.resolution) return 0
+        if (a.resolution.id < b.resolution.id) return 1
+        if (a.resolution.id === b.resolution.id) return 0
         return -1
       })