Skip to content

Commit

Permalink
Fix the duplicate issue
Browse files Browse the repository at this point in the history
  • Loading branch information
mekya committed Aug 11, 2024
1 parent e621894 commit d11ee7e
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 28 deletions.
2 changes: 1 addition & 1 deletion src/main/java/io/antmedia/datastore/db/DataStore.java
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public abstract class DataStore {

public abstract String save(Broadcast broadcast);

//In rare scenarios, streamId can not be unique
//TODO: In rare scenarios, streamId can not be unique
public Broadcast saveBroadcast(Broadcast broadcast) {
String streamId = null;
try {
Expand Down
56 changes: 29 additions & 27 deletions src/main/java/io/antmedia/datastore/db/types/BroadcastUpdate.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@

/**
* This is like a clone of Broadcast object. Just some differences, all default values are null in this object
* and it is used to update the broadcast object in the datastore
* and it is used to update the broadcast object in the datastore by only changing fields.
*
* If it's not null, it means that it will be updated in the datastore
* If it a field is not null, it means that it should be updated in the datastore
*
* It's not a good solution. It's a workaround so far that keeps the backward compatibility
*/
@Schema(description="This is the BroadcastUpdate and it's almost same with BroadcastUpdate with all default values are null. We update the fields in update method if it's not null."
+ "It makes this data up to date in race conditions.")
Expand Down Expand Up @@ -287,26 +289,26 @@ public void setCategory(String category) {
public String getIpAddr() {
return ipAddr;
}

public void setIpAddr(String ipAddr) {
this.ipAddr = ipAddr;
public void setUsername(String username) {
this.username = username;
}

public String getUsername() {
return username;
}

public void setUsername(String username) {
this.username = username;
}

public String getPassword() {
return password;

public void setIpAddr(String ipAddr) {
this.ipAddr = ipAddr;
}

public void setPassword(String password) {
this.password = password;
}

public String getPassword() {
return password;
}

public String getQuality() {
return quality;
Expand Down Expand Up @@ -468,42 +470,42 @@ public void setBitrate(Long bitrate) {
this.bitrate = bitrate;
}

public void setUserAgent(String userAgent) {
this.userAgent = userAgent;
}

public String getUserAgent() {
return userAgent;
}

public void setUserAgent(String userAgent) {
this.userAgent = userAgent;
public String getAltitude() {
return altitude;
}

public String getLatitude() {
return latitude;
}

public void setLatitude(String latitude) {
this.latitude = latitude;
}

public String getLongitude() {
return longitude;
}

public String getMainTrackStreamId() {
return mainTrackStreamId;
}

public void setLongitude(String longitude) {
this.longitude = longitude;
}

public String getAltitude() {
return altitude;
public void setLatitude(String latitude) {
this.latitude = latitude;
}

public void setAltitude(String altitude) {
this.altitude = altitude;
}

public String getMainTrackStreamId() {
return mainTrackStreamId;
}

public void setMainTrackStreamId(String mainTrackStreamId) {
this.mainTrackStreamId = mainTrackStreamId;
}
Expand Down

0 comments on commit d11ee7e

Please sign in to comment.