Skip to content

Commit

Permalink
better mongo update broadcast fix
Browse files Browse the repository at this point in the history
  • Loading branch information
lastpeony committed Mar 13, 2024
1 parent a85ef68 commit 20ef964
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/main/java/io/antmedia/datastore/db/MongoStore.java
Original file line number Diff line number Diff line change
Expand Up @@ -806,6 +806,10 @@ public boolean updateBroadcastFields(String streamId, Broadcast broadcast) {
if (broadcast.getSpeed() != 0) {
updates.add(set("speed", broadcast.getSpeed()));
}

if(broadcast.getEncoderSettingsString() != null){
updates.add(set("encoderSettingsString",broadcast.getEncoderSettingsString()));
}


prepareFields(broadcast, updates);
Expand All @@ -823,7 +827,6 @@ public boolean updateBroadcastFields(String streamId, Broadcast broadcast) {
updates.add(set("playlistLoopEnabled", broadcast.isPlaylistLoopEnabled()));
updates.add(set("updateTime", broadcast.getUpdateTime()));
updates.add(set("autoStartStopEnabled",broadcast.isAutoStartStopEnabled()));
updates.add(set("encoderSettingsString",broadcast.getEncoderSettingsString());

UpdateResult updateResult = query.update(updates).execute();
return updateResult.getModifiedCount() == 1;
Expand Down

0 comments on commit 20ef964

Please sign in to comment.