Skip to content

Commit 4f07511

Browse files
rootclaude
authored andcommitted
Fix dashboard embed update issues with enhanced logging and configuration
- Enable show_all libraries in config.json to display all Jellyfin libraries - Add comprehensive debug logging to dashboard update process - Enhance Jellyfin connection error logging and feedback - Improve message creation/editing logs with detailed status messages - Add stack traces for better error debugging (exc_info=True) 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent d648230 commit 4f07511

File tree

2 files changed

+17
-3
lines changed

2 files changed

+17
-3
lines changed

cogs/jellyfin_core.py

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -338,24 +338,32 @@ async def update_status(self) -> None:
338338
async def update_dashboard(self) -> None:
339339
"""Update the dashboard message periodically."""
340340
try:
341+
self.logger.info(f"Dashboard update starting - Channel ID: {self.CHANNEL_ID}")
342+
self.logger.info(f"Dashboard message ID: {self.dashboard_message_id}")
343+
341344
info = await self.get_server_info()
342345
if not info:
346+
self.logger.warning("No server info received - Jellyfin may be unreachable")
343347
return
344348

345349
channel = self.bot.get_channel(self.CHANNEL_ID)
346350
if not channel:
347351
self.logger.error("Dashboard channel not found")
348352
return
349353

354+
self.logger.info(f"Creating dashboard embed with info keys: {list(info.keys())}")
350355
embed = await self.create_dashboard_embed(info)
351356
await self._update_dashboard_message(channel, embed)
357+
self.logger.info("Dashboard update completed successfully")
352358
except Exception as e:
353-
self.logger.error(f"Error updating dashboard: {e}")
359+
self.logger.error(f"Error updating dashboard: {e}", exc_info=True)
354360

355361
async def get_server_info(self) -> Dict[str, Any]:
356362
"""Get server information from Jellyfin."""
357363
try:
364+
self.logger.info("Attempting to connect to Jellyfin...")
358365
if not await self.connect_to_jellyfin():
366+
self.logger.error("Failed to connect to Jellyfin server")
359367
return {}
360368

361369
headers = {
@@ -701,9 +709,11 @@ async def _update_dashboard_message(self, channel: discord.TextChannel, embed: d
701709
return
702710

703711
if self.dashboard_message_id:
712+
self.logger.info(f"Attempting to edit existing message ID: {self.dashboard_message_id}")
704713
try:
705714
message = await channel.fetch_message(self.dashboard_message_id)
706715
await message.edit(embed=embed)
716+
self.logger.info("Successfully edited existing dashboard message")
707717
return
708718
except discord.RateLimited as e:
709719
self.logger.warning(f"Rate limited, waiting {e.retry_after} seconds")
@@ -712,21 +722,25 @@ async def _update_dashboard_message(self, channel: discord.TextChannel, embed: d
712722
try:
713723
message = await channel.fetch_message(self.dashboard_message_id)
714724
await message.edit(embed=embed)
725+
self.logger.info("Successfully edited dashboard message after rate limit")
715726
return
716727
except Exception as retry_e:
717728
self.logger.error(f"Failed to edit message after rate limit: {retry_e}")
718729
return
719730
except discord.NotFound:
731+
self.logger.warning(f"Dashboard message {self.dashboard_message_id} not found, will create new message")
720732
self.dashboard_message_id = None
721733
except discord.Forbidden:
722734
self.logger.error("Bot doesn't have permission to edit messages in the channel")
723735
return
724736

737+
self.logger.info("Creating new dashboard message")
725738
message = await channel.send(embed=embed)
726739
self.dashboard_message_id = message.id
727740
self._save_message_id(message.id)
741+
self.logger.info(f"Successfully created new dashboard message with ID: {message.id}")
728742
except Exception as e:
729-
self.logger.error(f"Error updating dashboard message: {e}")
743+
self.logger.error(f"Error updating dashboard message: {e}", exc_info=True)
730744

731745
@app_commands.command(name="update_libraries", description="Update library sections in the dashboard")
732746
@app_commands.check(is_authorized)

data/config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"color": "#00A4DC"
77
},
88
"jellyfin_sections": {
9-
"show_all": 0,
9+
"show_all": 1,
1010
"sections": {
1111
"Movies": {
1212
"display_name": "Movies",

0 commit comments

Comments
 (0)