Skip to content

Commit 365ce85

Browse files
committed
bug fix
1 parent a0f94c0 commit 365ce85

File tree

2 files changed

+14
-5
lines changed

2 files changed

+14
-5
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
# OpenDistributedFileStorage
2+
[![Build docker images](https://github.com/aczwink/OpenDistributedFileStorage/actions/workflows/docker-image.yml/badge.svg)](https://github.com/aczwink/OpenDistributedFileStorage/actions/workflows/docker-image.yml)
3+
24
A web-based file storage service with distributed storage targets

service/src/services/FFProbeService.ts

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
22
* OpenDistributedFileStorage
3-
* Copyright (C) 2024 Amir Czwink ([email protected])
3+
* Copyright (C) 2024-2025 Amir Czwink ([email protected])
44
*
55
* This program is free software: you can redistribute it and/or modify
66
* it under the terms of the GNU Affero General Public License as published by
@@ -71,11 +71,18 @@ export class FFProbeService
7171

7272
public ExtractVideoStream(mediaInfo: FFProbe_MediaInfo)
7373
{
74-
const streams = mediaInfo.streams.filter(x => x.codec_type === "video");
75-
if(streams.length != 1)
76-
throw new Error("TODO: implement me");
74+
const streams = mediaInfo.streams.filter(x => x.codec_type === "video") as FFProbe_VideoStreamInfo[];
75+
if(streams.length === 0)
76+
throw new Error("TODO: implement me1");
77+
if(streams.length > 1)
78+
{
79+
const withoutImages = streams.filter(x => x.codec_name !== "png");
80+
if(withoutImages.length === 1)
81+
return withoutImages[0];
82+
throw new Error("TODO: implement me2");
83+
}
7784

78-
return streams[0] as FFProbe_VideoStreamInfo;
85+
return streams[0];
7986
}
8087

8188
public IsStreamable(mediaType: string, mediaInfo: FFProbe_MediaInfo)

0 commit comments

Comments
 (0)