I also have to replace the "library" namespace with the "collection"
namespace to avoid naming collisions.
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>
Unplayed tracks is a dynamic playlist generated whenever we are asked to
select the "Unplayed" playlist. Note that dynamic playlists aren't
hooked up to the other playlist functions (has, add, del, or
get_tracks). This is to avoid adding them to the index and potentially
writing out to disk.
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
This will go unnoticed for Favorites and Banned playlists, but will
allow dynamic playlists to be refreshed without switching to a different
playlist first.
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
I don't want anybody outside of the IndexEntry class to modify the
values in this container. This patch makes it private and provides
iterator access instead.
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
This variable should only be set by the Database when a DatabaseItem is
first created. This means I should hide _index from the rest of the
world to prevent accidental modifications. I also add an accessor
function for other code that needs to read _index.
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
I plan to introduce a new lib/ that sits between the gui and the backend
files (similar to how glibc sits between the kernel and userspace).
This gets the rename out of the way before I change my mind again.
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>