MCPcopy Create free account
hub / github.com/Dispatcharr/Dispatcharr / addPlaylist

Method addPlaylist

frontend/src/api.js:1407–1432  ·  view source on GitHub ↗
(values)

Source from the content-addressed store, hash-verified

1405 }
1406
1407 static async addPlaylist(values) {
1408 try {
1409 let body = null;
1410 if (values.file) {
1411 body = new FormData();
1412 for (const prop in values) {
1413 if (values[prop] === null || values[prop] === undefined) continue;
1414 body.append(prop, values[prop]);
1415 }
1416 } else {
1417 body = { ...values };
1418 delete body.file;
1419 }
1420
1421 const response = await request(`${host}/api/m3u/accounts/`, {
1422 method: 'POST',
1423 body,
1424 });
1425
1426 usePlaylistsStore.getState().addPlaylist(response);
1427
1428 return response;
1429 } catch (e) {
1430 errorNotification('Failed to create M3U account', e);
1431 }
1432 }
1433
1434 static async refreshPlaylist(id) {
1435 try {

Callers 2

addPlaylistFunction · 0.80
playlists.test.jsxFile · 0.80

Calls 2

requestFunction · 0.85
errorNotificationFunction · 0.85

Tested by

no test coverage detected