Page 1 of 1

API: Library Refresh

PostPosted: Sun Nov 17, 2013 12:21 pm
by DenyAll
Hi zip,
I am working on customising the library refresh using my WinHelper tool. A couple of questions if I may:
  • If an app forces a library refresh using the configuration API (posts a /rest/action/forceLibraryRefresh) and then does so again before the first refresh is finished - what happens. Does it:
    1. Ignore the second request
    2. Start the refresh process from the beginning (terminate current refresh process and start again)
    3. Queue the second request and process it once the first refresh is finished
    I believe (from what I have observed) its the second option, but better to check. My post is really for the next question....
  • If a refresh begins, and the scanForUpdates for a particular folder is subsequently changed (before the refresh is finished) does it affect the currently running refresh process? For example, if the scanForUpdates for folder C:\XXX is true, and then a /rest/action/forceLibraryRefresh is issued (starting the refresh process) and then very shortly after, the scanForUpdates for folder C:\XXX is set to false is C:\XXX included in the scan? (ie. does Serviio take a snapshot of the library scanForUpdates status at the beginning of the refresh process or does it check as needed throughout the process?).
FYI, I am endeavouring to use the WinAPI to actively monitor changes to the shared folders and, on detecting a change, refresh the library. I have safeguarded somewhat against multiple file file changes triggering multiple refresh requests but it can still happen to a limited extent - once a minute maximum (relates to the first question). I am also trying to cater for removed drives - this involves setting the scanForUpdates for the shared folder on or off if the drive is present (relates to second question).

Any concerns or issues you foresee would be greatly appreciated.

Re: API: Library Refresh

PostPosted: Sun Nov 17, 2013 9:40 pm
by zip
as or 1) - you are right, second is correct
as for 2) - it loops over the shared folders and makes the check just before it starts processing the folder (so no snapshot at the beginning)

Re: API: Library Refresh

PostPosted: Sun Nov 17, 2013 11:29 pm
by DenyAll
Thanks for the prompt response. Greatly appreciated.