After a powercut my cable modem rebooted and reassigned IP addresses for my Vero and Network drive which made all the video files shortcuts in OSMC fail to work.
I tried editing sources.xml to change to the new IP address for the network drive but it didn’t appear to work at all and on rebooting the Vero the sources.xml was a blank file.
I tried copying a backup of sources.xml I’d previously made to the userdata folder but that didn’t help.
I used the OSMC gui to make the links to folders all over again which has worked for a few days but this morning I found that the links had all gone and that sources.xml was a blank file again.
Is there a trick to backing up and/or editing sources.xml? If I need to re-install at any tie it would be useful to know.
Thanks
I don’t quite follow why you think you need to edit sources.xml because your public IP address changed ? You need to explain a bit more about your setup for that to make sense.
Edit: I see that you mean the private IP addresses on your network. In which case you really ought to either use static IP’s or DHCP reservations.
BTW editing sources.xml only edits the sources you see in Videos->Files it does not change the paths to already scanned in Library items, which I suspect you are probably expecting to be the case. The original paths of the files in the Library are stored in the library database independently of anything you put in sources.xml.
The links were to videos on the local network drive, the local IP address of which changed. I suspect that trying to have static IP set would be academic if the router reverts to factory settings after a powercut again which is why being able to successfully edit sources.xml would be useful.
A router losing its configuration would not affect statically assigned devices. It would affect DHCP reservations though.
If you think this is something that might happen again I’d suggest you configure your NAS statically and outside the normal DHCP range. (But inside the same subnet)
Generally speaking assigning the IP address of a NAS dynamically is a bad idea.
I’m not sure why your sources.xml ended up blank but as I’ve explained editing it does not fix any of the existing entries that are already scanned into the library anyway.
You would need to remove your sources, making sure you tell it to remove library items when prompted (or you will end up with orphaned entries that are hard to remove) and then re add the sources and rescan them into the library.
This is just the way Kodi works unfortunately - there’s nothing we (OSMC devs) can do to alter this.