Dividing queue size by 3 seems to give a better distribution of tracks,
but only for a large set of tracks (such as the entire collection).
let's skip the division if the queue only has a small number of tracks.
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
If the library isn't valid, then we shouldn't try to pick another track
until the user fixes things.
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
I was assuming that my disk returns -EIO when it enters its failed
state, but it really seems to be return -ENOENT. Let's have this code
check for any error, rather than one specific one.
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
I'm seeing Ocarina crash when a tempq finishes and gets removed. For
now, let's only have the gui handle queue clearing if tracks were
actually removed.
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
I had the condition reversed for enabling random on temporary queues, so
the flag was getting set whenever I didn't want it.
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
One of my disks frequently returns this error, and has wiped out my
track database on more than one occasion. Let's handle this error by
disabling the library until the user tells us it is safe to use again.
Fixes#33: Handle music directories disappearing better
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
The first thing queue_deinit() does is clear the queue, so calling
tempq_save() here will overwrite any tempq state currently on disk.
This seems reasonable at first, but ends up erasing any temporary queues
during Ocarina shutdown.
Fixes#34: Temporary queues not saving
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
We were returning right away if the file version check fails, without
closing the file. This could cause future reads or writes to fail to
open.
Fixes#25: File version checking doesn't look quite right
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
I also take this opportunity to drop support for upgrading from file
format 0. I've had several releases since this format was supported, so
this should be safe to do.
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
I decided that having a uniqueue history queue doesn't really get me
anything, so I dropped that portion of the behavior.
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
I haven't referred to this in forever, and it's a few versions out of
date. I don't think it's needed anymore.
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
This function is used to cancel all idle tasks and free the memory
allocated for them. This needs to be called when Ocarina is shutting
down to prevent a possible hang with the gtk idle callback continuing to
process tasks.
Fixes#30: Closing Ocarina should cancel idle tasks
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
"Banning" a track is a bit harsh. Let's talking about hiding tracks
instead, so that it sounds friendlier.
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
Rather than doing this in two separate lines. Also drop the -j2
argument to scons to help with memory issues.
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
GitLab CI failed on this test because the last remaining idle task was
the one to scan the new directory. Let's make sure we've run through
all idle tasks before continuing on with this test.
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
I created a new function for checking if a group of tests is running to
help determine if the sanity test needs to run before anything else.
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
I think it makes more sense to have the collection manage if banned
tracks are displayed or not, rather than doing this from the playlist
layer.
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>