diff --git a/src/api/agileLive/ingest.ts b/src/api/agileLive/ingest.ts index dc3b1012..3ff9d207 100644 --- a/src/api/agileLive/ingest.ts +++ b/src/api/agileLive/ingest.ts @@ -123,7 +123,7 @@ export async function getSourceThumbnail( ); if (response.ok) { const json = (await response.json()) as ResourcesThumbnailResponse; - return json?.data; + return json.data; } throw await response.json(); } diff --git a/src/api/manager/job/syncInventory.ts b/src/api/manager/job/syncInventory.ts index 40ae637d..4bba9b59 100644 --- a/src/api/manager/job/syncInventory.ts +++ b/src/api/manager/job/syncInventory.ts @@ -18,7 +18,6 @@ async function getSourcesFromAPI() { result.status === 'fulfilled' ) .map((result) => result.value); - const sources: SourceWithoutLastConnected[] = resolvedIngests.flatMap( (ingest) => { return ingest.sources.map( @@ -32,6 +31,7 @@ async function getSourcesFromAPI() { }, ingest_name: ingest.name, ingest_source_name: source.name, + ingest_type: source.type, video_stream: { width: source?.video_stream?.width, height: source?.video_stream?.height, @@ -66,7 +66,8 @@ export async function runSyncInventory() { const apiSource = apiSources.find((source) => { return ( source.ingest_name === inventorySource.ingest_name && - source.ingest_source_name === inventorySource.ingest_source_name + source.ingest_source_name === inventorySource.ingest_source_name && + source.ingest_type === inventorySource.type ); }); if (!apiSource) { @@ -84,14 +85,14 @@ export async function runSyncInventory() { // Look for new sources that doesn't already exist in the inventory, // these should all be added to the inventory, status of these are set in getSourcesFromAPI. - const newSourcesToUpsert = apiSources .filter((source) => { const existingSource = dbInventoryWithCorrectStatus.find( (inventorySource) => { return ( source.ingest_name === inventorySource.ingest_name && - source.ingest_source_name === inventorySource.ingest_source_name + source.ingest_source_name === inventorySource.ingest_source_name && + source.ingest_type === inventorySource.ingest_type ); } ); diff --git a/src/components/filter/FilterDropdown.tsx b/src/components/filter/FilterDropdown.tsx index 0ed986af..85c9eb27 100644 --- a/src/components/filter/FilterDropdown.tsx +++ b/src/components/filter/FilterDropdown.tsx @@ -12,10 +12,16 @@ function FilterDropdown({ isLocationHidden, showConfigSources, selectedTags, + showNdiType, + showBmdType, + showSrtType, setIsTypeHidden, setIsLocationHidden, setSelectedTags, setOnlyShowActiveSources: setOnlyShowConfigSources, + setOnlyShowNdiSources: setOnlyShowNdiSources, + setOnlyShowBmdSources: setOnlyShowBmdSources, + setOnlyShowSrtSources: setOnlyShowSrtSources, handleSorting }: { close: () => void; @@ -26,10 +32,16 @@ function FilterDropdown({ isLocationHidden: boolean; showConfigSources: boolean; selectedTags: Set; + showNdiType: boolean; + showSrtType: boolean; + showBmdType: boolean; setIsTypeHidden: React.Dispatch>; setIsLocationHidden: React.Dispatch>; setOnlyShowActiveSources: React.Dispatch>; setSelectedTags: React.Dispatch>>; + setOnlyShowNdiSources: React.Dispatch>; + setOnlyShowBmdSources: React.Dispatch>; + setOnlyShowSrtSources: React.Dispatch>; handleSorting: (reversedOrder: boolean) => void; }) { const t = useTranslate(); @@ -67,6 +79,18 @@ function FilterDropdown({ setOnlyShowConfigSources(!showConfigSources); }; + const showSelectedNdiType = () => { + setOnlyShowNdiSources(!showNdiType); + }; + + const showSelectedSrtType = () => { + setOnlyShowSrtSources(!showSrtType); + }; + + const showSelectedBmdType = () => { + setOnlyShowBmdSources(!showBmdType); + }; + const deleteTag = (value: string) => { const temp = selectedTags; temp.delete(value); @@ -125,6 +149,9 @@ function FilterDropdown({ const handleClear = () => { setSelectedTags(new Set()); setOnlyShowConfigSources(false); + setOnlyShowBmdSources(false); + setOnlyShowNdiSources(false); + setOnlyShowSrtSources(false); }; const typesSearch = (event: ChangeEvent) => { @@ -276,17 +303,64 @@ function FilterDropdown({ +
+ + +
+
+ + +
+
+ + +
+ +
diff --git a/src/interfaces/Source.ts b/src/interfaces/Source.ts index 64920f6d..db4838fc 100644 --- a/src/interfaces/Source.ts +++ b/src/interfaces/Source.ts @@ -26,6 +26,7 @@ export interface Source { }; ingest_name: string; ingest_source_name: string; + ingest_type: string; video_stream: VideoStream; audio_stream: AudioStream; lastConnected: Date;