Merge pull request #18 from PiratesIRC/claude/debug-errors-01VkfCYGtyKBfWLL81bppBGd
Debug and identify error issues
This commit is contained in:
@@ -2642,6 +2642,7 @@ class Plugin:
|
|||||||
|
|
||||||
channels_updated = 0
|
channels_updated = 0
|
||||||
total_streams_added = 0
|
total_streams_added = 0
|
||||||
|
channels_skipped = 0
|
||||||
|
|
||||||
self._send_progress_update("add_streams_to_channels", 'running', 20,
|
self._send_progress_update("add_streams_to_channels", 'running', 20,
|
||||||
f'Processing {len(channel_groups)} channel groups...', context)
|
f'Processing {len(channel_groups)} channel groups...', context)
|
||||||
@@ -2660,6 +2661,13 @@ class Plugin:
|
|||||||
|
|
||||||
for channel in channels_to_update:
|
for channel in channels_to_update:
|
||||||
channel_id = channel['id']
|
channel_id = channel['id']
|
||||||
|
|
||||||
|
# Validate that channel exists in database before attempting operations
|
||||||
|
if not Channel.objects.filter(id=channel_id).exists():
|
||||||
|
logger.warning(f"[Stream-Mapparr] Skipping channel '{channel['name']}' (ID: {channel_id}) - channel no longer exists in database. Consider reloading channels.")
|
||||||
|
channels_skipped += 1
|
||||||
|
continue
|
||||||
|
|
||||||
try:
|
try:
|
||||||
if matched_streams:
|
if matched_streams:
|
||||||
if overwrite_streams:
|
if overwrite_streams:
|
||||||
@@ -2788,6 +2796,9 @@ class Plugin:
|
|||||||
|
|
||||||
# Send final completion notification
|
# Send final completion notification
|
||||||
success_msg = f"Updated {channels_updated} channels with {total_streams_added} streams."
|
success_msg = f"Updated {channels_updated} channels with {total_streams_added} streams."
|
||||||
|
if channels_skipped > 0:
|
||||||
|
success_msg += f" Skipped {channels_skipped} deleted channel(s)."
|
||||||
|
logger.info(f"[Stream-Mapparr] {success_msg}")
|
||||||
self._send_progress_update("add_streams_to_channels", 'success', 100, success_msg, context)
|
self._send_progress_update("add_streams_to_channels", 'success', 100, success_msg, context)
|
||||||
|
|
||||||
return {"status": "success", "message": success_msg}
|
return {"status": "success", "message": success_msg}
|
||||||
|
|||||||
Reference in New Issue
Block a user