GNOME Bugzilla – Bug 794845
magnatune: Add cover art support
Last modified: 2018-03-31 19:43:24 UTC
It follows the specifications defined at: http://magnatune.com/info/sqlite-normalized
Created attachment 370350 [details] [review] magnatune: Add cover art support It follows the specifications defined at: http://magnatune.com/info/sqlite-normalized
Victor should be the one reviewing this.
Review of attachment 370350 [details] [review]: Thanks for the patch! Just small comments on the code but the change itself looks good. ::: src/magnatune/grl-magnatune.c @@ +117,3 @@ + +#define COVER_ART_SIZES 50, 75, 100, 160, 200, 300, 600, 1400 +#define COVER_ART_LENGTH 8 You might move that cover_sizes[] declaration here instead of these two defines. To get the length of static array you can use G_N_ELEMENTS() on it. @@ +352,3 @@ gchar *content = NULL; gsize length = 0; + gboolean ret = FALSE; Trailing spaces should be done in an extra patch. @@ +387,3 @@ { GrlNetWc *wc = NULL; + ditto @@ +512,3 @@ gchar *old_crc = NULL; gsize length = 0; + gboolean ret = FALSE; ditto @@ +613,3 @@ gint duration, + const gchar *url_to_mp3, + GPtrArray *url_to_covers) No tabs, space only please. @@ +653,3 @@ + gchar *encoded_album; + int cover_sizes[] = {COVER_ART_SIZES}; + gchar *cover; You can move 'cover' to inside the for scope @@ +672,3 @@ + for (i = 0; i < COVER_ART_LENGTH; i++) { + cover = g_strdup_printf("%s/%s/%s/%s_%d.%s", URL_SONG_COVER, encoded_artist, + encoded_album, "cover", cover_sizes[i], "jpg"); Maybe an extra define here would be useful, such as: URL_SONG_COVER_FORMAT URL_SONG_COVER "/%s/%s/cover_%d.jpg" @@ +707,3 @@ } +static GList* ditto @@ +733,3 @@ } + while ((ret = sqlite3_step(sql_stmt)) == SQLITE_BUSY); ditto
Created attachment 370376 [details] [review] magnatune: Remove trailing spaces
Created attachment 370377 [details] [review] magnatune: Add cover art support It follows the specifications defined at: http://magnatune.com/info/sqlite-normalized
Review of attachment 370376 [details] [review]: Pushed as de694c68862e86fa6ff2ed3c0d2dd4e765afce18
Review of attachment 370377 [details] [review]: Moved the cover_art[] array up (global) and removed the #define COVER_ART_SIZES Pushed as 81076c6da54599acd814e2ce628fb6e2208cbed5 Many thanks!