ampache / ampache-xbmc-plugin

KODI plugin for Ampache
Other
8 stars 3 forks source link

Connection goes stale and is not re-established? maybe... album/artist shows only "next items..." #10

Closed Jieiku closed 3 years ago

Jieiku commented 3 years ago

It appears that after it sits for a while the plugin loses connectivity to ampache. I come to Kodi an hour or two later and click into Library then album or artist and all that is returned is "next items..."

If I click change server, then selected the same server I am already on, it will re-establish the connection.

Then I can once again browse and play the music.

lusum commented 3 years ago

This bug is fixed with new 1.2.1 that i will release soon

Jieiku commented 3 years ago

@lusum This still happens on my Media PC, i am not sure about my desktop yet.

I put my Desktop PC into the browse albums menu, and will let it sit there for a couple hours and check later, will post back if the desktop pc does it as well.

UPDATE: Also happens on the Desktop PC, connection went stale and only shows "next items..."

lusum commented 3 years ago

Ampache develop branch now has a better connection error handling, try this to have more info about your error

Jieiku commented 3 years ago

I am running Ampache develop branch, but maybe I should report this particular error there and see if lachlan notices anything?

Let me know how you think I should proceed on this one, thanks again, plugin looks great and cannot wait to use it :)

For now I am going to enable ampache full debugging info and see if There is anything in those logs that might help.

You may have also meant the plugins develop branch, where I assumed you meant develop branch of ampache itself, I just found this: https://github.com/ampache/ampache-xbmc-plugin/tree/develop

Jieiku commented 3 years ago

Once the connection goes stale and the ampache kodi plugin is only showing "next items..."

The ampache server logs show this:

2021-02-01T18:43:19-08:00 [ampache] (Access Denied) -> Invalid Session attempt to API [albums] 
2021-02-01T18:45:45-08:00 [ampache] (Access Denied) -> Invalid Session attempt to API [albums]

At that point the only fix is to select "Switch Server" in the kodi ampache plugin and just select the same server, this will re-establish the connection.

The session appears to be valid for 1 hour, after that 1 hour is up if the kodi plugin has been sitting idle it will no longer be able to access ampache unless you use the "Switch Server" trick.

I am going to try using an API key instead of username and password, maybe that would solve the problem I am having.

Jieiku commented 3 years ago

I tested this using an API key. The API key works, but the connection expires with it as well.

The result is the same thing, once the system with the kodi plugin has sat idle for over an hour it can no longer authenticate with the ampache server, and the ampache server shows this in the log:

2021-02-01T20:35:40-08:00 [ampache] (Access Denied) -> Invalid Session attempt to API [albums]

lusum commented 3 years ago

Ampache plugin develop i mean :)

I will test the connection error, this pulgin is NOT tested for ampache develop

Jieiku commented 3 years ago

I see, I have been using ampache develop for months, many of the new features and bug fixes are there, some of which I submitted the bug reports for, and lachlan was able to fix.

Once all the bug fixes that I am making use of are part of the next stable release then I could go back to using stable instead of develop, but I would only be doing so to make use of this plugin, because the develop branch has worked perfectly otherwise.

lusum commented 3 years ago

Fixed. It works, cause technical limitation of python2.7, only with python 3.7 and above. So, only in kodi 19 and above.

I have switched from a fixed expiration time to the exact expiration time sent by server.

Jieiku commented 3 years ago

@lusum Awesome! Thank you for working on this, I will see about upgrading my machines so that they use kodi 19+

lusum commented 3 years ago

Ok, i found another one bug related to this one and corrected. I cancelled a lot of duplicate code so some bug had to be corrected again, but in a more correct way that to insert spaghetti code without knowing the real reason.