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.
- package/cjs/CamStreamerAPI.js +6 -1
- package/esm/CamStreamerAPI.js +6 -1
- package/package.json +1 -1
package/cjs/CamStreamerAPI.js
CHANGED
|
@@ -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.
|
|
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);
|
package/esm/CamStreamerAPI.js
CHANGED
|
@@ -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.
|
|
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);
|