[tracker] Save folder media art for ogg files.



commit e3eb37570fce2bd5216a8e084c6c49e65b38048f
Author: Andrew den Exter <andrew den exter jollamobile com>
Date:   Fri Aug 16 08:10:12 2013 +0000

    Save folder media art for ogg files.

 src/tracker-extract/tracker-extract-vorbis.c |   18 +++++++++++++++---
 1 files changed, 15 insertions(+), 3 deletions(-)
---
diff --git a/src/tracker-extract/tracker-extract-vorbis.c b/src/tracker-extract/tracker-extract-vorbis.c
index 124be4f..175008e 100644
--- a/src/tracker-extract/tracker-extract-vorbis.c
+++ b/src/tracker-extract/tracker-extract-vorbis.c
@@ -32,6 +32,8 @@
 
 #include <libtracker-extract/tracker-extract.h>
 
+#include "tracker-media-art.h"
+
 typedef struct {
        const gchar *creator;
        gchar *creator_uri;
@@ -93,7 +95,7 @@ tracker_extract_get_metadata (TrackerExtractInfo *info)
        VorbisData vd = { 0 };
        MergeData md = { 0 };
        FILE *f;
-       gchar *filename;
+       gchar *filename, *uri;
        OggVorbis_File vf;
        vorbis_comment *comment;
        vorbis_info *vi;
@@ -360,8 +362,7 @@ tracker_extract_get_metadata (TrackerExtractInfo *info)
                tracker_sparql_builder_predicate (metadata, "nmm:musicAlbumDisc");
                tracker_sparql_builder_object_iri (metadata, album_disc_uri);
 
-               g_free (album_disc_uri);
-               g_free (vd.album);
+               g_free (album_disc_uri);
 
                tracker_sparql_builder_predicate (metadata, "nmm:musicAlbum");
                tracker_sparql_builder_object_iri (metadata, uri);
@@ -510,7 +511,18 @@ tracker_extract_get_metadata (TrackerExtractInfo *info)
                tracker_sparql_builder_object_int64 (metadata, (gint64) time);
        }
 
+       uri = g_file_get_uri (file);
+       tracker_media_art_process (NULL,
+                               0,
+                               NULL,
+                               TRACKER_MEDIA_ART_ALBUM,
+                               vd.album_artist ? vd.album_artist : vd.artist,
+                               vd.album,
+                               uri);
+       g_free (uri);
+
        g_free (vd.artist);
+       g_free (vd.album);
        g_free (vd.album_artist);
        g_free (vd.performer);
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]