lekma / plugin.video.invidious

Invidious Addon for Kodi
GNU General Public License v3.0
50 stars 7 forks source link

[Feature Request] Search history #23

Closed Dreamdance61 closed 4 years ago

Dreamdance61 commented 4 years ago

Using search it would be nice to have a stack of the latest N searches to quickly get back to an old query.

lekma commented 4 years ago

That should not be too difficult (famous last words). I'll have a go at it.

lekma commented 4 years ago

ok, so I gave it a try, could you please test c4b0902e84b66a6641048b140e15f226c40e5b1a and tell me if I'm on right tracks?

thanks for your help

Dreamdance61 commented 4 years ago

Tried it as fresh installation with Android Tablet and Kodi 18.7 .

Step 1: Installed plugin => ok Step 2: Called 'Invidious'-Plugin Step 3: Selected menu entry 'Popular' => ok Step 4: Selected and viewed an video => ok Step 5: Going back to Invidious Main Menu =>ok Step 6: Selected menu entry 'Search' -> 'Videos' => ok Step 7: Entered search text and started search => NOT ok, running first search there was an error

ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--

  • NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS! Error Type: <type 'exceptions.IOError'> Error Contents: [Errno 2] No such file or directory: u'/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/userdata/addon_data/plugin.video.invidious/search_history.pickle' Traceback (most recent call last): File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/plugin.video.invidious/lib/plugin.py", line 207, in dispatch(*sys.argv) File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/plugin.video.invidious/lib/plugin.py", line 202, in dispatch Dispatcher(url, int(handle)).dispatch(parseQuery(query)) File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/plugin.video.invidious/lib/plugin.py", line 196, in dispatch return action(kwargs) File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/plugin.video.invidious/lib/plugin.py", line 31, in wrapper success = func(self, **kwargs) File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/plugin.video.invidious/lib/plugin.py", line 168, in new_search q = newSearch(kwargs["type"]) File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/plugin.video.invidious/lib/persistence.py", line 77, in newSearch _dumpSearchHistory(search_history) File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/plugin.video.invidious/lib/persistence.py", line 66, in _dumpSearchHistory return _dumpObject(search_history, _search_historypath) File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/plugin.video.invidious/lib/persistence.py", line 22, in _dumpObject with open(path, "w+") as f: IOError: [Errno 2] No such file or directory: u'/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/userdata/addon_data/plugin.video.invidious/search_history.pickle' -->End of Python script error report<-- 2020-06-02 16:22:29.031 T:22221 ERROR: CGUIMediaWindow::GetDirectory(plugin://plugin.video.invidious/?action=new_search&type=video) failed

Good news: After running and saving addon-settings ....

Now, I'm happy :+1: Thank you very much

lekma commented 4 years ago

yep, I can reproduce, it happens when the profile folder for the plugin has not been created yet (fresh install, no settings changed). I'll try and fix that before release.

thanks for the feedback