feat(epg): order EPG sources by priority (#24)
Add persistent EPG priority ordering, source reorder validation, and priority-aware EPG matching for live channels. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@ -47,6 +47,20 @@ router.get('/type/:type', async (req, res) => {
|
||||
}
|
||||
});
|
||||
|
||||
router.put('/epg/order', async (req, res) => {
|
||||
try {
|
||||
const ordered = await sources.reorderEpg(req.body?.orderedIds);
|
||||
res.json(ordered.map(source => ({
|
||||
...source,
|
||||
password: source.password ? '••••••••' : null
|
||||
})));
|
||||
} catch (err) {
|
||||
if (err.code) return res.status(400).json({ error: err.message, code: err.code });
|
||||
console.error('Error reordering EPG sources:', err);
|
||||
res.status(500).json({ error: 'Failed to reorder EPG sources' });
|
||||
}
|
||||
});
|
||||
|
||||
// Get single source
|
||||
router.get('/:id', async (req, res) => {
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user