(channelId, epgDataId)
| 888 | } |
| 889 | |
| 890 | static async setChannelEPG(channelId, epgDataId) { |
| 891 | try { |
| 892 | const response = await request( |
| 893 | `${host}/api/channels/channels/${channelId}/set-epg/`, |
| 894 | { |
| 895 | method: 'POST', |
| 896 | body: { epg_data_id: epgDataId }, |
| 897 | } |
| 898 | ); |
| 899 | |
| 900 | // Update the channel in the store with the refreshed data |
| 901 | if (response.channel) { |
| 902 | useChannelsStore.getState().updateChannel(response.channel); |
| 903 | } |
| 904 | |
| 905 | // Show notification about task status |
| 906 | if (response.task_status) { |
| 907 | notifications.show({ |
| 908 | title: 'EPG Status', |
| 909 | message: response.task_status, |
| 910 | color: 'blue', |
| 911 | }); |
| 912 | } |
| 913 | |
| 914 | return response; |
| 915 | } catch (e) { |
| 916 | errorNotification('Failed to update channel EPG', e); |
| 917 | } |
| 918 | } |
| 919 | |
| 920 | static async setChannelNamesFromEpg(channelIds) { |
| 921 | try { |
no test coverage detected