Skip to content

Commit

Permalink
fix: sync-inventory updated to not overwrite excisting mapping (#83)
Browse files Browse the repository at this point in the history
  • Loading branch information
malmen237 authored Nov 7, 2024
1 parent d015087 commit 4000c00
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/api/manager/job/syncInventory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { getIngests, getIngest } from '../../ateliereLive/ingest';
import { upsertSource } from '../sources';
import { getDatabase } from '../../mongoClient/dbClient';
import { WithId } from 'mongodb';
import { API_SECRET_KEY } from '../../../utils/constants';

type SourceWithoutLastConnected = Omit<Source, 'lastConnected'>;

Expand Down Expand Up @@ -141,7 +140,12 @@ export async function runSyncInventory() {
audio_stream:
apiSource.ingest_type === 'SRT' && apiSource.status === 'gone'
? inventorySource.audio_stream
: apiSource.audio_stream,
: {
number_of_channels: apiSource.audio_stream.number_of_channels,
sample_rate: apiSource.audio_stream.sample_rate,
audio_mapping:
inventorySource.audio_stream.audio_mapping || undefined
},
// Add srt metadata if missing from SRT sources
srt: updateSrtMetadata(inventorySource, apiSource)
} satisfies WithId<Source>;
Expand Down

0 comments on commit 4000c00

Please sign in to comment.