camstreamerlib 4.0.4 → 4.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -116,7 +116,12 @@ class CamStreamerAPI extends BasicAPI_1.BasicAPI {
116
116
  await this._postUrlEncoded(`${BASE_PATH}/set_stream_active.cgi`, { stream_id: streamId, active: active ? 1 : 0 }, options);
117
117
  }
118
118
  async deleteStream(streamId, options) {
119
- await this._postUrlEncoded(`${BASE_PATH}/remove.cgi`, { stream_id: streamId }, options);
119
+ const streamList = await this.getStreamList(options);
120
+ const filteredList = streamList.filter((stream) => !('streamId' in stream) || stream.streamId !== streamId);
121
+ if (filteredList.length === streamList.length) {
122
+ return;
123
+ }
124
+ await this.setStreamList(filteredList, options);
120
125
  }
121
126
  async listFiles(options) {
122
127
  const res = await this._getJson(`${BASE_PATH}/upload_audio.cgi`, { action: 'list' }, options);
@@ -113,7 +113,12 @@ export class CamStreamerAPI extends BasicAPI {
113
113
  await this._postUrlEncoded(`${BASE_PATH}/set_stream_active.cgi`, { stream_id: streamId, active: active ? 1 : 0 }, options);
114
114
  }
115
115
  async deleteStream(streamId, options) {
116
- await this._postUrlEncoded(`${BASE_PATH}/remove.cgi`, { stream_id: streamId }, options);
116
+ const streamList = await this.getStreamList(options);
117
+ const filteredList = streamList.filter((stream) => !('streamId' in stream) || stream.streamId !== streamId);
118
+ if (filteredList.length === streamList.length) {
119
+ return;
120
+ }
121
+ await this.setStreamList(filteredList, options);
117
122
  }
118
123
  async listFiles(options) {
119
124
  const res = await this._getJson(`${BASE_PATH}/upload_audio.cgi`, { action: 'list' }, options);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "camstreamerlib",
3
- "version": "4.0.4",
3
+ "version": "4.0.5",
4
4
  "description": "Helper library for CamStreamer ACAP applications.",
5
5
  "prettier": "@camstreamer/prettier-config",
6
6
  "engine": {