This patch also adds the genre field to the list of fields that can be
searched.
Implements #62: Replace filter layer with token matching
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
We only need to do this after Ocarina init has completed, otherwise
artist playlists will be added twice.
Fixes#79: Artist playlists not updated when tracks are added
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
We were calling the queue function directly, rather than passing through
the playlist layer. This means random state isn't saved when the button
is clicked and Ocarina is closed.
Fixes#78: Call playlist_set_random() when clicking random button
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
But only if the library database is empty. This patch also changes the
prompt of the dialog to "Add Music" so users know what is going on.
Fixes#80: Pop up FileChooserDialog the first time Ocarina is run
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
This is easier than responding to events from the treeview. Let's just
pop up a dialog and let the user select from there, rather than doing
something complicated with a stack.
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
System playlists cannot be deleted, but library playlists can. Deleting
a library playlist removes the library and associated tracks from the database.
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
I'm going to use this to distinguish between various playlist types that
are about to be added. Let's update the playlist functions first, and
then add more types in a future patch.
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
Otherwise the existance check will still pass the next time
__queue_filter() is called, and we will attempt to destroy it again.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
I wasn't doing this, but I also wasn't refiltering queues when they were
changed. This resulted in showing a filtered queue, but without a way
to clear it. Remembering the text lets me simply set the text, instead
of refiltering queues whenever they are changed.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
This preserves the original behavior, where the collection is always
selected from the beginning. This can be improved upon later, once
queued tracks are implemented as a playlist.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
I think this is cleaner than having an upper layer allocate the results
set manually. This also lets me return NULL in the case that there were
no results.
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
I was storing database indexes, but this assumes that database indexes
are constant. I intend to change this with database defragmentation.
Implements #46: Filter stores a track pointer
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
The file filter and preview widget are both cleaned up when the file
chooser dialog is destroyed.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
Sometimes Ocarina gets the correct image for CD1, but not for CD2.
Allow traversing into hidden folders so users can select the correct
image out of the artwork cache.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
Otherwise the new image will never be updated due to the "did the album
change?" check in __artwork_set_pixbuf()
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
This lets users actually see images before selecting them for ablum art.
Implements #59: Add preview widget to album art chooser
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
Using gdk_pixbuf_new_from_file_at_scale() can result in a blurry image
due to something in the gdk backend. I want to have a sharper image, so
we need to perform the scale manually through Cairo.
Fixes issue #60: Album art is blurry
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
Since MusicBrainz limits us to one request each second, it doesn't
really make sense to poll for new artwork every half second. Instead,
let's just put this into a new timeout function that gets called every
two seconds. This should also let us stop polling once artwork has been
found.
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
If the user is fixing broken album art then we need to update the image
immediately, otherwise the user will be confused.
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
Using gdk_pixbuf_new_from_file_at_scale() will load a scaled pixbuf,
which looks better than loading a height x height square.
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>