Iris icon indicating copy to clipboard operation
Iris copied to clipboard

Need to clear local data in firefox everytime mopidy restarts

Open OzymandiasTheGreat opened this issue 2 years ago • 3 comments

Iris version

3.64.1

Operating system(s) affected

  • [ ] Windows
  • [ ] MacOS
  • [ ] iOS
  • [ ] Android
  • [X] Linux
  • [ ] Other

Browser(s) affected

  • [X] Firefox
  • [ ] Chrome
  • [ ] Edge
  • [ ] Other

What happened?

Every time I restart mopidy (or my server crashes) Iris stops working. I can browse media fine, but when I try to add tracks to the queue I get mopidy: failed to add some tracks and no tracks are added. ~Clearing cookies/localstorage and reloading the Iris web interface work again, but I have to go through setup and connecting my accounts again.~ Ok, just found that resetting the database from settings works as well, without resetting my accounts. I'm using Iris with mopidy-ytmusic btw. A minor annoyance, but would be really nice if something could be done about it.

Logs

No response

OzymandiasTheGreat avatar Aug 19 '22 08:08 OzymandiasTheGreat

This seems to be related to the Mopidy-Ytmusic extension itself. Iris caches data in the browser, but it seems that Mopidy-Ytmusic track URIs change over time, even though it may be the very same track. So when adding Iris-cached URIs, they are rejected by the backend.

I suspect the URI contains a time-limited security token, which is renewed/replaced/invalidated on restart.

@OzymandiasTheGreat are you able to create an issue on Mopidy-Ytmusic to cover this issue?

jaedb avatar Aug 20 '22 01:08 jaedb

I actually wrote mopidy-ytmusic, but it received a lot of contributions to get to this point, so I'm not that familiar with the source anymore :sweat_smile: Clearing the database is not that big an issue, so I guess it'll do for now. I just started a new job, so I'm swamped, but once I have more free time I'll look into what can be done about this. Youtube makes it its mission to make getting raw data as difficult as possible and there's no "real" API for music, we're using third-party libraries that reverse engineered the web front-end :sweat_smile:

Just a quick question, is there any way to disable Iris caching? That would be nice, while I figure things out :smile:

OzymandiasTheGreat avatar Aug 20 '22 02:08 OzymandiasTheGreat

I completely understand; looking at how their internal APIs hang together it is clear they don't want to make it at all easy unless it is a Google-certified application.

Cool, if there is something needed at the Iris end to help with this, let me know.

The easiest way to disable caching would be to use a private/incognito browser mode. Alternatively you can clear the local database (note: this is different to local state) within developer console under Storage -> Indexed DB, right-click and Delete all.

jaedb avatar Aug 20 '22 03:08 jaedb