plexinc / plex-for-kodi

Offical Plex for Kodi add-on releases.
GNU General Public License v2.0
249 stars 123 forks source link

object has no attribute 'updateBackgroundFrom' #390

Open ZsBT opened 9 months ago

ZsBT commented 9 months ago

Description:

BUG: AttributeError: 'PrePlayWindow' object has no attribute 'updateBackgroundFrom'

A couple of other Window classes drop the exception above.

Details:

Checklist

2023-12-10 21:04:49.214 T:1482928   ERROR <general>: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
                                                    - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
                                                   Error Type: <class 'AttributeError'>
                                                   Error Contents: 'PrePlayWindow' object has no attribute 'updateBackgroundFrom'
                                                   Traceback (most recent call last):
                                                     File "/root/.kodi/addons/script.plexmod/lib/windows/kodigui.py", line 116, in onInit
                                                       else "ff000000"
                                                     File "/root/.kodi/addons/script.plexmod/lib/windows/preplay.py", line 105, in onReInit
                                                       self.refreshInfo(from_reinit=True)
                                                     File "/root/.kodi/addons/script.plexmod/lib/windows/preplay.py", line 113, in refreshInfo
                                                       self.setInfo(skip_bg=from_reinit and not (self.PLAY_BUTTON_ID <= oldFocusId <= self.MEDIA_BUTTON_ID))
                                                     File "/root/.kodi/addons/script.plexmod/lib/windows/preplay.py", line 509, in setInfo
                                                       self.updateBackgroundFrom(self.video)
                                                   AttributeError: 'PrePlayWindow' object has no attribute 'updateBackgroundFrom'
                                                   -->End of Python script error report<--
ZsBT commented 9 months ago

workaround patch:

--- a/lib/windows/windowutils.py
+++ b/lib/windows/windowutils.py
@@ -13,6 +13,9 @@ class UtilMixin():
     def __init__(self):
         self.exitCommand = None

+    def updateBackgroundFrom(self, obj):
+        return
+
     def goHome(self, section=None):
         HOME.show()
         if section:
pannal commented 4 months ago

You're in the wrong project. You're using my fork, PM4K. https://github.com/pannal/plex-for-kodi/