joaconigro / plugin.audio.tuneinradio

TuneIn addon for Kodi based on brianhornsby addon
MIT License
15 stars 2 forks source link

Can't open any list of stations in android. #3

Closed keystroke3 closed 3 years ago

keystroke3 commented 3 years ago

I installed the addon using the matrix beta zip file on my phone, laptop and smart tv with andoid tv. It works flawlessly on the laptop, but brings up an error and refuses to open stations list on the phone and tv. I checked the logs, and was able to isolate the following:

2021-05-17 22:18:53.724 T:12922    INFO <general>: initializing python engine.
2021-05-17 22:18:54.188 T:12922 WARNING <general>: xbmc.translatePath is deprecated and might be removed in future kodi versions. Please use xbmcvfs.translatePath instead.
2021-05-17 22:18:55.835 T:12922    INFO <general>: Skipped 37 duplicate messages..
2021-05-17 22:18:55.835 T:12922    INFO <general>: CPythonInvoker(34, /storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/plugin.audio.tuneinradio/addon.py): script successfully run
2021-05-17 22:18:56.042 T:12922 WARNING <general>: CPythonInvoker(34, /storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/plugin.audio.tuneinradio/addon.py): the python script "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/plugin.audio.tuneinradio/addon.py" has left several classes in memory that we couldn't clean up. The classes include: N9XBMCAddon9xbmcaddon5AddonE
2021-05-17 22:18:56.042 T:12922    INFO <general>: Python interpreter stopped
2021-05-17 22:18:56.843 T:12927    INFO <general>: initializing python engine.
2021-05-17 22:18:57.267 T:12927 WARNING <general>: xbmc.translatePath is deprecated and might be removed in future kodi versions. Please use xbmcvfs.translatePath instead.
2021-05-17 22:18:58.317 T:12927   ERROR <general>: Skipped 5 duplicate messages..
2021-05-17 22:18:58.317 T:12927   ERROR <general>: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
                                                    - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
                                                   Error Type: <class 'SyntaxError'>
                                                   Error Contents: unexpected EOF while parsing (<string>, line 0)
                                                   Traceback (most recent call last):
                                                     File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/plugin.audio.tuneinradio/addon.py", line 742, in <module>
                                                       process_tunein_json(results)
                                                     File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/plugin.audio.tuneinradio/addon.py", line 183, in process_tunein_json
                                                       add_station_outline(element['station'])
                                                     File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/plugin.audio.tuneinradio/addon.py", line 457, in add_station_outline
                                                       genre = get_genre_name(utils.get_value(station, 'genre_id'))
                                                     File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/plugin.audio.tuneinradio/addon.py", line 641, in get_genre_name
                                                       for genre in __genrescache__.get()[0]:
                                                     File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/plugin.audio.tuneinradio/resources/lib/cache.py", line 49, in get
                                                       return eval(open(self.cachedb, 'r').read())
                                                     File "<string>", line 0

                                                       ^
                                                   SyntaxError: unexpected EOF while parsing
                                                   -->End of Python script error report<--

2021-05-17 22:18:58.331 T:8460     INFO <general>: CActiveAESink::OpenSink - initialize sink
2021-05-17 22:18:58.332 T:8460     INFO <general>: Trying to open: samplerate: 44100, channelMask: 12, encoding: 4
2021-05-17 22:18:58.361 T:8460     INFO <general>: CAESinkAUDIOTRACK::Initializing with: m_sampleRate: 44100 format: AE_FMT_FLOAT (AE) method: PCM stream-type: PCM-STREAM min_buffer_size: 56704 m_frames: 1772 m_frameSize: 8 channels: 2
2021-05-17 22:18:58.519 T:12927 WARNING <general>: CPythonInvoker(35, /storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/plugin.audio.tuneinradio/addon.py): the python script "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/plugin.audio.tuneinradio/addon.py" has left several classes in memory that we couldn't clean up. The classes include: N9XBMCAddon9xbmcaddon5AddonE
2021-05-17 22:18:58.519 T:12927    INFO <general>: Python interpreter stopped
2021-05-17 22:18:58.536 T:12926   ERROR <general>: GetDirectory - Error getting plugin://plugin.audio.tuneinradio/?c=local&id&name=Local%20Radio&offset&path=browse&pivot
2021-05-17 22:18:58.545 T:8440    ERROR <general>: CGUIMediaWindow::GetDirectory(plugin://plugin.audio.tuneinradio/?c=local&id&name=Local%20Radio&offset&path=browse&pivot) failed
2021-05-17 22:19:05.583 T:8440     INFO <general>: CWinSystemAndroid::DestroyWindow

I am not sure where the problem is here. The syntax used in the get method of the cache.py file seems fine to me. The laptop kodi does not have this issue.

keystroke3 commented 3 years ago

The PR fixes this issue.