[rygel] server,media-export: Fix media-art extraction



commit 4a685c5a37776a88514bb0707bbe33d215e37c8d
Author: Jens Georg <mail jensge org>
Date:   Mon Nov 10 14:04:40 2014 +0100

    server,media-export: Fix media-art extraction
    
    - mime is meant for the buffer contents
    - Do a proper fall-back to sidecar search
    
    Signed-off-by: Jens Georg <mail jensge org>

 src/librygel-server/rygel-media-art-store.vala     |   21 ++++++++++++++++---
 .../rygel-media-export-item-factory.vala           |    4 +-
 2 files changed, 19 insertions(+), 6 deletions(-)
---
diff --git a/src/librygel-server/rygel-media-art-store.vala b/src/librygel-server/rygel-media-art-store.vala
index 5d939f1..12433d5 100644
--- a/src/librygel-server/rygel-media-art-store.vala
+++ b/src/librygel-server/rygel-media-art-store.vala
@@ -107,14 +107,27 @@ public class Rygel.MediaArtStore : GLib.Object {
         return file;
     }
 
-    public void add (MusicItem item, File file, uint8[]? data) {
-        if (media_art_process == null) {
+    public void add (MusicItem item, File file, uint8[]? data, string? mime) {
+        if (this.media_art_process == null) {
             return;
         }
 
         try {
-            media_art_process.buffer (MediaArt.Type.ALBUM, MediaArt.ProcessFlags.NONE, file,
-                                      data, item.mime_type, item.artist, item.album);
+            if (data != null) {
+                this.media_art_process.buffer (MediaArt.Type.ALBUM,
+                                               MediaArt.ProcessFlags.NONE,
+                                               file,
+                                               data,
+                                               mime,
+                                               item.artist,
+                                               item.album);
+            } else {
+                this.media_art_process.file (MediaArt.Type.ALBUM,
+                                             MediaArt.ProcessFlags.NONE,
+                                             file,
+                                             item.artist,
+                                             item.album);
+            }
         } catch (Error error) {
             warning ("%s", error.message);
         }
diff --git a/src/plugins/media-export/rygel-media-export-item-factory.vala 
b/src/plugins/media-export/rygel-media-export-item-factory.vala
index ae71f40..d8ecd58 100644
--- a/src/plugins/media-export/rygel-media-export-item-factory.vala
+++ b/src/plugins/media-export/rygel-media-export-item-factory.vala
@@ -278,7 +278,7 @@ namespace Rygel.MediaExport.ItemFactory {
         }
 
         if (sample == null) {
-            store.add (item, file, null);
+            store.add (item, file, null, null);
 
             return item;
         }
@@ -294,7 +294,7 @@ namespace Rygel.MediaExport.ItemFactory {
             case Tag.ImageType.FRONT_COVER:
                 Gst.MapInfo map_info;
                 sample.get_buffer ().map (out map_info, Gst.MapFlags.READ);
-                store.add (item, file, map_info.data);
+                store.add (item, file, map_info.data, structure.get_name ());
                 sample.get_buffer ().unmap (map_info);
                 break;
             default:


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