We now have an interface for controlling everything through struct
db_entry, so let's just have the database store a db_entry directly.
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
Track tags need to add themselves to the filter index and update the
library track count once added to the database.
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
The Track tag needs to do some cleanup when removed from a database, so
we need to use this op when removing items.
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
For allocating new database items from a given key. Tracks do not need
this function since we have special handling for creation and insertion.
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
I also take the chance to modify this function slightly. Now, if a
matching item could not be found a new item will be allocated.
I added the new function db_get() if callers just want to get an item
without allocating.
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
I also introduced a file_readf() function to make it easier to read a
formatted string from the file.
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
I also introduced a file_writef() function to make it easier to write a
formatted string to the file.
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
I replace it with calls to g_strdup_printf(). This has the additional
benefit that I can do uint conversions at the same time as other
formatting options, so this seems like a win. The only downside is that
I have to manually free the memory that glib allocates, but that's easy
enough.
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
The album_db should really be controlled from within the Album tag, so
this patch adds functions to find or create Album tags to the tags
namespace.
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
Also make it inherit from the GenericTag base class. Also also, add a
unit test specific to Album tags. Finally, I remove the corresponding
section of the DESIGN file since it is no longer needed.
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>