(sourceId, settings)
| 3931 | } |
| 3932 | |
| 3933 | static async updateEpgSourceSettings(sourceId, settings) { |
| 3934 | try { |
| 3935 | // Read current custom_properties from the store to merge, not replace |
| 3936 | const epgs = useEPGsStore.getState().epgs; |
| 3937 | const source = epgs[sourceId]; |
| 3938 | const cp = { ...(source?.custom_properties || {}), ...settings }; |
| 3939 | |
| 3940 | const response = await request(`${host}/api/epg/sources/${sourceId}/`, { |
| 3941 | method: 'PATCH', |
| 3942 | body: { custom_properties: cp }, |
| 3943 | }); |
| 3944 | |
| 3945 | useEPGsStore.getState().updateEPG(response); |
| 3946 | return response; |
| 3947 | } catch (e) { |
| 3948 | errorNotification('Failed to update EPG source settings', e); |
| 3949 | } |
| 3950 | } |
| 3951 | |
| 3952 | static async updateSDSettings(sourceId, settings) { |
| 3953 | return API.updateEpgSourceSettings(sourceId, settings); |
no test coverage detected