Open Jon12345 opened 4 years ago
What's your use case for this? It was disabled on purpose so that users weren't getting malformed databases from trying to change between multiple servers. Also as I mentioned on the reddit thread, it didn't seem to actually work/save properly from my testing at the time.
I rebooted my router and my jellyfin server got a new IP, so Kodi was no longer able to play items (stuck on "Working" forever). (That seems like another issue - why does it remember an old IP when I only gave it a hostname?)
The work-around is fine - it's just hard for users to know that it's needed. Maybe "Reset database" can be moved to be closer to these server details?
The "proper" fix is to use DNS to connect to your server instead of hardcoded IP addresses. Also a server generally is hardcoded to a given IP address, so getting a new DHCP address just doesn't happen in the large cases.
If you connected by hostname/DNS, it will always use DNS and not store the IP address. However, if you used the autodetect to connect to your server instead of manually entering a URL that will function only over ip:port.
The problem is that the server URL needs to be changed in multiple places in the stored files (and possibly database, I don't remember), so it's not a super straightforward thing to do. And if you were connected to server A and then change it to server B without resetting the database, bad things happen.
Just so I understand correctly, you're recommending to: 1) Not use autodetect to connect (as this will store the IP address), and 2) Manually connect to the server via DNS hostname, not IP address and/or 3) Hardcode IP address for the jellyfin server ?
More or less, yeah.
If you give your server a static IP address, then autodetect is totally fine since it will never change. So it's more
or
I personally would say this is better practice regardless, as this issue will likely occur on all clients, not just Kodi.
Though I can see the appeal of wanting an option to update the server URL in the app without needing to resync the database. We'll need to think more about how it could be done safely. Likely connecting to the new URL and checking if the server ID is the same, otherwise prompting to reset the database.
Sounds good. I don't have any issue with needing to reset the database, or about static IPs. My concern is more about the discoverability - ie how do users know that's what is needed?
Some possible solutions:
Btw a couple of unrelated minor UX issues:
I don't like saying "reset database is the solution" because depending on the library size, that could be a pretty long process. Syncing my music library alone is almost a half hour. Which is kinda why we generally recommend fixing it using other technologies that are meant to handle those sort of dynamic updates so the app doesn't have to worry about them.
I ran into this issue as well by autodiscovery of a dynamic ip. Resetting the db is not an option as the initial sync takes several hours (a lot of music).
My workaround is a static ip mapping for the original dynamic address - clearly my fault as I did not do this before setting up jellyfin&kodi.
I propose several fixes, maybe one of these will help with this problem:
perform a reverse dns lookup upon discovery: hostnames rarely change in contrast to ip addresses
perform the same discovery on startup of jellyfin-kodi (probably a major change as no address can be stored - but the jellyfin android app seems to do this)
enable editing of the server connection info (and probably just store it in one place)
jellyfin-kodi has worked perfectly for me besides this minor issue. I can try and implement options 1 and/or 3 if you like these approaches.
The music sync should be significantly faster since 0.5.8 now (from 15 minutes to 2 minutes on my system), but that's besides the point here.
$HOME/.kodi/userdata/addon_data/plugin.video.jellyfin/settings.xml
and $HOME/.kodi/userdata/addon_data/plugin.video.jellyfin/data.json
. My impression is that it should only live in the settings file. It may also be in the database somewhere, but I don't remember 100%. I don't see it in jellyfin.db
from a quick glance, but more in depth digging is needed.
Looks like a known issue, but it's tripped me up a few times (apologies if there's already a github issue).
https://www.reddit.com/r/jellyfin/comments/g2bshe/jellyfin_for_kodi_server_address_greyed_out_in/
Workaround (as mentioned in reddit): Addons ->My add-ons -> Jellyfin -> Configure -> Advanced -> Reset local Kodi database -> Restart Kodi