From 33b6401f1c81d8af4dd75ba08e58aa0c3d0cf8d0 Mon Sep 17 00:00:00 2001 From: Nirvana Date: Thu, 13 Nov 2025 22:52:09 +0100 Subject: [PATCH] Add Magenta 2.0 (DE) --- .../base/ui/kodi_notification_adapter.py | 35 ++++++++++++------- 1 file changed, 22 insertions(+), 13 deletions(-) diff --git a/lib/streaming_providers/base/ui/kodi_notification_adapter.py b/lib/streaming_providers/base/ui/kodi_notification_adapter.py index 5696f50..8dff033 100644 --- a/lib/streaming_providers/base/ui/kodi_notification_adapter.py +++ b/lib/streaming_providers/base/ui/kodi_notification_adapter.py @@ -108,13 +108,19 @@ class KodiNotificationAdapter(NotificationInterface): # Build dialog heading and message heading = "MagentaTV Remote Login" - # Initial message with instructions - line1 = f"Please scan the QR code with your mobile device" - line2 = f"Login Code: [B]{login_code}[/B]" - line3 = f"Expires in: {self._format_time(expires_in)}" + # FIXED: Combine all lines into a single message string + # Kodi DialogProgress.create() only takes 2 arguments: heading and message + message_lines = [ + "Please scan the QR code with your mobile device", + f"Login Code: [B]{login_code}[/B]", + f"Expires in: {self._format_time(expires_in)}", + "", + "Or open the MagentaTV app and enter the code" + ] + message = "\n".join(message_lines) - # Show dialog - self._dialog.create(heading, line1, line2, line3) + # FIXED: Only pass 2 arguments to create() + self._dialog.create(heading, message) # Set QR code image if available if qr_image_path and os.path.exists(qr_image_path): @@ -156,12 +162,16 @@ class KodiNotificationAdapter(NotificationInterface): elapsed = self._expires_in - remaining_seconds percentage = int((elapsed / self._expires_in) * 100) - # Update dialog - line1 = "Please scan the QR code with your mobile device" - line2 = "Or open the MagentaTV app and enter the code" - line3 = f"Time remaining: {self._format_time(remaining_seconds)}" + # FIXED: Combine all lines into a single message string + message_lines = [ + "Please scan the QR code with your mobile device", + "Or open the MagentaTV app and enter the code", + f"Time remaining: {self._format_time(remaining_seconds)}" + ] + message = "\n".join(message_lines) - self._dialog.update(percentage, line1, line2, line3) + # FIXED: Update dialog with combined message + self._dialog.update(percentage, message) return True @@ -306,5 +316,4 @@ class KodiNotificationAdapter(NotificationInterface): if minutes > 0: return f"{minutes}m {secs}s" else: - return f"{secs}s" - + return f"{secs}s" \ No newline at end of file