I have now disabled "Search for updates of currently shared files" as I normally know that I only add files. It may help.
The status could (as I wrote) write which file it was currently visiting. This is much better info then not showing anything at all. A progress bar isn't necessary. Anything that shows the user that Serviio is actually doing something. As I said, I simply didn't know if Serviio was working properly or not as I got _zero_ feedback from it.
But as the search is depending (heavily) on the number of shared files, there seems to be some room for a better algorithm to see if the file already exists in the database. Have you considered using hashing and/or making the filename (I assume you have to search for the filename) a primary key, possibly in its own table? The hashing would allow to reduce the number of filename compares a lot, but if the filename was a primary key, this would probably already happen automatically (depending on the database used). If the filename is not a primary key and you make a db search for the filename, you are forcing the database to make a full table scan to find the filename. This of course is a very expensive way of doing it. Maybe creating an index of the filename is enough? Then no code change would have to be made (I think). If all this is already done, the whole process has to be reworked: Load the stored filelist into memory, make hashing of the filenames, compare first hashes and then filenames on matching hashes. This should be fast. Possible include sorting on the hashes and make a binary search for added speed.
This is my log (I manually started the refresh and check for updates was enabled at that time):
2012-02-11 19:47:08,031 INFO [LibraryAdditionsCheckerThread] Started looking for newly added files
2012-02-11 19:47:08,032 INFO [LibraryUpdatesCheckerThread] Started looking for updates to currently shared files
2012-02-11 19:47:08,442 INFO [FeedUpdaterThread] Started looking for information about online resources
2012-02-11 19:53:03,708 INFO [LibraryAdditionsCheckerThread] Added file '<thenewfile>.mkv' (title: '<thisisthetitle>) to Library
2012-02-11 19:53:49,262 INFO [LibraryAdditionsCheckerThread] Finished looking for newly added files
2012-02-11 20:03:39,716 INFO [LibraryUpdatesCheckerThread] Finished looking for updates to currently shared files
I hope we can improve upon the existing code. This issue is kind of an annoying spot in an otherwise great software.
