(associations)
| 3299 | } |
| 3300 | |
| 3301 | static async batchSetEPG(associations) { |
| 3302 | try { |
| 3303 | const response = await request( |
| 3304 | `${host}/api/channels/channels/batch-set-epg/`, |
| 3305 | { |
| 3306 | method: 'POST', |
| 3307 | body: { associations }, |
| 3308 | } |
| 3309 | ); |
| 3310 | |
| 3311 | // If successful, requery channels to update UI |
| 3312 | if (response.success) { |
| 3313 | // Build message based on whether EPG sources need refreshing |
| 3314 | let message = `Updated ${response.channels_updated} channel${response.channels_updated !== 1 ? 's' : ''}`; |
| 3315 | if (response.programs_refreshed > 0) { |
| 3316 | message += `, refreshing ${response.programs_refreshed} EPG source${response.programs_refreshed !== 1 ? 's' : ''}`; |
| 3317 | } |
| 3318 | |
| 3319 | notifications.show({ |
| 3320 | title: 'EPG Association', |
| 3321 | message: message, |
| 3322 | color: 'blue', |
| 3323 | }); |
| 3324 | |
| 3325 | // Then refresh the current table view |
| 3326 | this.requeryChannels(); |
| 3327 | } |
| 3328 | |
| 3329 | return response; |
| 3330 | } catch (e) { |
| 3331 | errorNotification('Failed to update channel EPGs', e); |
| 3332 | } |
| 3333 | } |
| 3334 | |
| 3335 | static async getChannel(id) { |
| 3336 | try { |
no test coverage detected