Commit Graph

3454 Commits

Author SHA1 Message Date
Anna Schumaker c8ccf7b844 core/tags/album: Place multiple queries to find artwork
If searching for artist and album fails, then fall back on album and
year or even just album name.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-07-04 21:30:06 -04:00
Anna Schumaker b4218833c5 core/tags/album: Immediately retry query on 503 error
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-07-04 20:59:29 -04:00
Anna Schumaker 2ea5104d42 core/tags/album: Fetch album art in the same step as metadata
This will help prepare for running multiple queries to find a release.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-07-04 20:59:28 -04:00
Anna Schumaker 86b63298a5 gui/idle: Show the idle progress as a tooltip
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-07-04 20:07:50 -04:00
Anna Schumaker 3c9798a6b7 gui: Remove unused GtkAdjustment
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-06-30 11:19:59 -04:00
Anna Schumaker ecc7843ea5 gui: Clean up setting album art
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-06-30 10:28:17 -04:00
Anna Schumaker dd66b10dfa gui: Properly load a pixbuf
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>
2016-06-30 10:28:17 -04:00
Anna Schumaker 9ef9b17b93 gui: Fix up main GtkGrid
Somewhere along the line the grid formatting got messed up, probably
after several merges while other bugs were fixed.  This patch reworks
the grid so everything is formatted correctly.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-06-30 10:27:57 -04:00
Anna Schumaker 1ac9e69128 gui: Minor spacing updates
This helps some widgets line up better, instead of looking slightly out
of place.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-06-30 09:19:15 -04:00
Anna Schumaker cbb9631877 gui: Add a function for determining the height of widgets
It's eaiser to do it in the builder code, rather than repeating this
code in several places.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-06-30 08:18:11 -04:00
Anna Schumaker 1e59968154 gui: Initialize track labels with whitespace
This gives labels the correct initial size, rather than forcing them to
resize after startup.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-06-30 08:08:56 -04:00
Anna Schumaker 5b7a985dc6 Ocarina 6.4.15-rc
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-06-24 11:13:55 -04:00
Anna Schumaker 54af68a57f gui/audio: Add album art support
Also add the "o_cover" widget to the glade file for setting album art.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-06-24 10:50:37 -04:00
Anna Schumaker d0dddeacdb core/tags/album: Add album_artwork_path() function
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-06-24 10:50:37 -04:00
Anna Schumaker 940d2d1dc2 core/tags/album: Query the Cover Art Archive for album art
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-06-24 10:50:37 -04:00
Anna Schumaker 570efda299 core/tags/album: Query MusicBrainz for album release information
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-06-24 10:50:37 -04:00
Anna Schumaker d79eb2c9b8 core/tags/album: Add album_artwork_exists() function
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-06-24 10:50:37 -04:00
Anna Schumaker 0d9b7baff6 core/tags/album: Add a pointer to the struct artist
This is needed for album art fetching to get more accurate results for
our MusicBrainz query.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-06-24 10:50:37 -04:00
Anna Schumaker 97c8f80393 core/idle: Add a way to reschedule idle tasks
This will be needed to reschedule MusicBrainz requests if the server is
busy.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-06-24 10:50:37 -04:00
Anna Schumaker 6b52775e58 core/idle: Add support for running idle tasks in a new thread
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-06-24 10:50:37 -04:00
Anna Schumaker 6a44f9e1a1 core/idle: Add idle_sync_t enum
I intend to use this to select between sync and async idle tasks.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-06-24 10:50:37 -04:00
Anna Schumaker a6bfbbb1c6 core/file: Add file_remove() function
I plan to use this for upgrades to remove obsolete files.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-06-24 10:50:37 -04:00
Anna Schumaker 0344a2088d core/file: Add cache_file_write() function
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-06-24 10:50:37 -04:00
Anna Schumaker 9db9df619f core/file: Add cache_file_close() function
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-06-24 10:50:37 -04:00
Anna Schumaker e137eb0108 core/file: Add cache_file_open() function
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-06-24 10:50:37 -04:00
Anna Schumaker 3723dff87d core/file: Add cache_file_exists() function
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-06-24 10:50:37 -04:00
Anna Schumaker 79ecaa11fb core/file: Add cache_file_write_path() function
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-06-24 10:50:37 -04:00
Anna Schumaker 5dcf681e48 core/file: Add cache_file_path() function
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-06-24 10:50:37 -04:00
Anna Schumaker b5e13af30c core/file: Add cache_file_init() function
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-06-24 10:50:37 -04:00
Anna Schumaker 12949651f7 core/file: Add struct cache_file
I want to reuse as much file code as I can for cache files, but I need a
new struct since data and cache files track different properties.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-06-24 10:50:37 -04:00
Anna Schumaker 9e0f017e61 core/file: Build in minimum version checks
I don't think it makes sense that callers of file_open() are expected to
check the file version after opening.  This should be something handled
by the file code so we can print a consistent error message.

Implements issue #5: Better file versioning
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-06-24 10:50:37 -04:00
Anna Schumaker fe6f31b1e5 core/file: Rework REPORT_ERROR() function
I want to be able to print any message as an error message without
relying on errno.  Let's handle this by introducing REPORT_ERRNO() to
look up the right error message for a given errno.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-06-24 10:50:37 -04:00
Anna Schumaker ee4f0d4c89 core/file: Writes go to a temporary file first
And then rename the temporary file when closed.  This protects users
data in case Ocarina gets killed.

Implements issue #31: Make file writes seem atomic
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-06-24 10:50:37 -04:00
Anna Schumaker c308ba7f8e core/file: Rewrite file opening
There are enough differences in the read and write paths that
__file_open_common() was still trying to account for.  Let's make a
simpler wrapper around g_fopen() and move differing code into
__file_open_read() and __file_open_write().

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-06-24 10:50:37 -04:00
Anna Schumaker 224290d4eb core/file: file->f_name can be a pointer
I'm only setting this to a static string, so it doesn't make sense to
store this as a char array.  Let's use a string pointer instead.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-06-24 10:50:37 -04:00
Anna Schumaker 427319b72e core/file: Move OCARINA_NAME configuration into version.h
I'm going to use this for saving album art to the right place.  I moved
it into an include file to avoid duplicating code.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-06-24 10:50:37 -04:00
Anna Schumaker 98faba93d1 core/string: Add a string_length() function
This is a wrapper around strlen(), but checks for a NULL pointer first.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-06-24 10:50:37 -04:00
Anna Schumaker 096c0e8eaa Ocarina 6.4.14
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-06-24 10:22:55 -04:00
Anna Schumaker c4e0efbe72 gui: GtkPaned spacing improvements
Use a smaller handle, but add more space to the child widgets margins.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-06-20 10:05:15 -04:00
Anna Schumaker 2f3bdf353d Ocarina 6.4.14-rc
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-06-16 14:50:00 -04:00
Anna Schumaker ea10b7e630 core/playlist: Improve average playcount calculation
The track database now tallys total play count and unplayed track count,
so we can use this information for calculating averages.  I also changed
the least played tracks playlist to allow tracks with play count equal
to the average.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-06-14 17:11:25 -04:00
Anna Schumaker 4998b0867b core/tags/track: Find the average play count of tracks
This function returns the average count of tracks that have been played,
and not the average count of all tracks.

Implements #29: Efficiently calculate average play count of tracks
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-06-14 17:11:06 -04:00
Anna Schumaker 1973d15605 core/tags/track: Count the total number of tracks played
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-06-14 17:10:52 -04:00
Anna Schumaker a97ec66e7f core/tags/track: Count the number of unplayed tracks
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-06-14 17:10:47 -04:00
Anna Schumaker d825e2d481 core: Remove random functions
I no longer need these now that the queue is using the glib
g_random_int_range() function.

Implements #32: Remove custom RNG code
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-06-14 17:10:30 -04:00
Anna Schumaker f1bcc7746e core/queue: Call g_random_int_range() rather than random_range()
Using somebody else's library is probably better than relying on my own
random number function.

Implements #32: Remove custom RNG code
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-06-14 17:09:46 -04:00
Anna Schumaker bc513532c1 gui/idle: Add a function to disable processing idle tasks
This is needed during ocarina shutdown to prevent a segfault.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-06-14 17:09:39 -04:00
Anna Schumaker fff2da5439 gui/ocarina: Deinitialize gui with the GtkApplication "shutdown" signal
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-06-14 17:09:38 -04:00
Anna Schumaker d0179a9bfa gui/ocarina: Initialize gui with the GtkApplication "startup" signal
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-06-14 17:09:34 -04:00
Anna Schumaker 9a209d098b core/tags: Switch over to db_load_idle()
Load all tag databases with the new load function.

Implements #15: Load track database through an idle task
Implements #16: Load library database through an idle task
Implements #17: Load genre database through an idle task
Implements #18: Load artist database through an idle task
Implements #19: Load album database through an idle task
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-06-14 17:07:55 -04:00