[rygel/wip/dvd: 240/240] media-export: Continue harvesting



commit 1949d964558560a38e12ebd351e62e661d82d145
Author: Jens Georg <jensg openismus com>
Date:   Sun Jul 21 14:26:31 2013 +0200

    media-export: Continue harvesting

 .../rygel-media-export-dvd-parser.vala             |    2 +-
 .../rygel-media-export-item-factory.vala           |    9 ++++++++-
 .../rygel-media-export-metadata-extractor.vala     |    6 +++++-
 3 files changed, 14 insertions(+), 3 deletions(-)
---
diff --git a/src/plugins/media-export/rygel-media-export-dvd-parser.vala 
b/src/plugins/media-export/rygel-media-export-dvd-parser.vala
index b4a4fef..19e9993 100644
--- a/src/plugins/media-export/rygel-media-export-dvd-parser.vala
+++ b/src/plugins/media-export/rygel-media-export-dvd-parser.vala
@@ -22,7 +22,7 @@
 
 internal class Rygel.MediaExport.DVDParser : GLib.Object {
     /// URI to the image / toplevel directory
-    public File file { private get; construct; }
+    public File file { public get; construct; }
 
     private File cache_file;
 
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 a0866b2..47b0cdc 100644
--- a/src/plugins/media-export/rygel-media-export-item-factory.vala
+++ b/src/plugins/media-export/rygel-media-export-item-factory.vala
@@ -46,13 +46,20 @@ namespace Rygel.MediaExport.ItemFactory {
             item = new PhotoItem (MediaCache.get_id (file), parent, title);
         } else if (mime.has_prefix ("audio/") || mime == "application/ogg") {
             item = new MusicItem (MediaCache.get_id (file), parent, title);
-        } else { // application/xml or text/xml
+        } else if (mime.has_suffix ("/xml")) {
             item = ItemFactory.create_playlist_item (file, parent, title);
             if (item == null) {
                 return null;
             }
             // DLNA requires that DIDL_S playlist have text/xml MIME type.
             mime = "text/xml";
+        } else if (mime == "application/x-cd-image") {
+            // The code analysing the file should already have checked that
+            // this really is a DVD and not some live CD or so.
+            //item = ItemFactory.create_dvd_item (file, parent, title);
+            return null;
+        } else {
+            return null;
         }
 
         item.mime_type = mime;
diff --git a/src/plugins/media-export/rygel-media-export-metadata-extractor.vala 
b/src/plugins/media-export/rygel-media-export-metadata-extractor.vala
index a173ae1..f5ee63c 100644
--- a/src/plugins/media-export/rygel-media-export-metadata-extractor.vala
+++ b/src/plugins/media-export/rygel-media-export-metadata-extractor.vala
@@ -78,7 +78,7 @@ public class Rygel.MediaExport.MetadataExtractor: GLib.Object {
 
         if (content_type == "application/x-cd-image") {
             this.dvd_parser = new DVDParser (file);
-            this.dvd_parser.run.begin ();
+            this.dvd_parser.run.begin (this.on_dvd_parser_done);
 
             return;
         }
@@ -138,6 +138,10 @@ public class Rygel.MediaExport.MetadataExtractor: GLib.Object {
         this.extract_basic_information (file, info, dlna);
     }
 
+    private void on_dvd_parser_done () {
+        this.extract_basic_information (this.dvd_parser.file, null, null);
+    }
+
     private void extract_basic_information (File               file,
                                             DiscovererInfo?    info,
                                             GUPnPDLNA.Profile? dlna) {


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