+ },
+
+ ffprobe: (path: string) => {
+ return ffprobePromise(path)
+ },
+
+ getFiles: async (id: number | string) => {
+ const video = await VideoModel.loadFull(id)
+ if (!video) return undefined
+
+ const webtorrentVideoFiles = (video.VideoFiles || []).map(f => ({
+ path: f.storage === VideoStorage.FILE_SYSTEM
+ ? VideoPathManager.Instance.getFSVideoFileOutputPath(video, f)
+ : null,
+ url: f.getFileUrl(video),
+
+ resolution: f.resolution,
+ size: f.size,
+ fps: f.fps
+ }))
+
+ const hls = video.getHLSPlaylist()
+
+ const hlsVideoFiles = hls
+ ? (video.getHLSPlaylist().VideoFiles || []).map(f => {
+ return {
+ path: f.storage === VideoStorage.FILE_SYSTEM
+ ? VideoPathManager.Instance.getFSVideoFileOutputPath(hls, f)
+ : null,
+ url: f.getFileUrl(video),
+ resolution: f.resolution,
+ size: f.size,
+ fps: f.fps
+ }
+ })
+ : []
+
+ const thumbnails = video.Thumbnails.map(t => ({
+ type: t.type,
+ url: t.getFileUrl(video),
+ path: t.getPath()
+ }))
+
+ return {
+ webtorrent: {
+ videoFiles: webtorrentVideoFiles
+ },
+
+ hls: {
+ videoFiles: hlsVideoFiles
+ },
+
+ thumbnails
+ }