Installation ID field for /rest/application and /cds/application endpoints

Issue #621 resolved
Will Lunniss created an issue

It would be very useful, especially for a CDS application, to be able to indentify different installations of Serviio via an ID, so that data can be cached on the device.

E.g. in ServiiGo, i create IP-PORT subfolders where I store thumbnails and images. If the user re-installs Serviio, they much clear these out. If the machine running Serviio gets a new IP, or they switch to using dynamic dns, then that cached data must be refetched.

Solution: When creating the library/database for the first time, generate an ID (probably a UUID or something based on timestamp and hardware feature e.g. mac address), and store that. When calling /application, return that ID.

If you the user re-installs Serviio, or deleted the library folder, the client will see the new ID and can clear the cache. If the IP address of the machine changes, the ID will stay the same, and the client can know to re-use the cache.

Edit: Actually, getting this in for 1.2 so that it is fed into the next homestream release would be really usful.

Comments (8)

  1. Petr Nejedly repo owner

    I already have a UPnP device ID, which is a function of the bound IP address. Would this work?

  2. Will Lunniss reporter

    Is it based on the time and bound IP/Does it follow the structure I outlined i.e. gets regenerated each time Serviio is re-installed or the /library is deleted (and is different from the last time even if the bound IP address is the same), but does not change if the IP address changes.

  3. Petr Nejedly repo owner

    So I can do that every time a sql upgrade script is run. This would give a new ID on: - a new install - an upgrade where there is a DB change (not always) - when the library has to be recreated (removed library folder)

    It'll stay the same when IP changes, etc.

    Would this do?

  4. Will Lunniss reporter

    Yes that sounds good. I basically want to keep everything in the cache as for as long as possible and only clear it out when I have to because the media ids have reset.

    an upgrade where there is a DB change (not always) Do you mean, it will sometimes give a new ID when doing a minor upgrade that doesn't re-set the media ids etc... or that it will only give a new ID when a major upgrade occurs that does re-set the media ids?

    This will also make the app more tollerant towards users who just use it over WiFi and have the server running on a machine with a dynamically changing DHCP assigned IP.

  5. Log in to comment