PeerTube/server/models/video/formatter/shared/video-format-utils.ts

8 lines
249 B
TypeScript
Raw Normal View History

2023-06-05 13:22:16 +02:00
import { MVideoFile } from '@server/types/models'
export function sortByResolutionDesc (fileA: MVideoFile, fileB: MVideoFile) {
if (fileA.resolution < fileB.resolution) return 1
if (fileA.resolution === fileB.resolution) return 0
return -1
}