As I said in my previous I have worked on “Scan Selected Files” feature. It is very useful, if you want to perform search for selected files only. Here’s what it will do:
- Get the selected files. If no file is selected then it will take all the files.
- Get the Albums of all the files. If more than two files have same album then their album is taken only once.
- Then it will search for those albums in MusicBrainz database and display the result.
The main problem in implementing this feature was how to get the albums of all files and add the album only once. For this I cannot use a Linked List or an array as it would cost me a polynomial time complexity. So, I decided to use a Hash Table and Glib already has Hash Tables for strings. Hence, a GHashTable is created.
Whenever an album is retrieved from the files, it is searched into the GHashTable. If it is found then it is not added otherwise it will be added. So, this would give me a linear time complexity atleast better than polynomial time.
Moreover, Scan Selected Files does its search Asynchronously.
The coming week I will try to implement the DiscID search and also do some more bug fixing and memory leak fixing.