summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJens Georg <mail@jensge.org>2022-05-16 13:26:03 +0200
committerJens Georg <mail@jensge.org>2022-05-22 11:10:18 +0200
commitfabf3f222206fc8354886f5d0d4e34747dbdb990 (patch)
tree52751adf092f0096c8743699e3c760de35456fe9 /src
parentec5491d3aebcb323c6b84143c9b63223e4188549 (diff)
downloadrygel-fabf3f222206fc8354886f5d0d4e34747dbdb990.tar.gz
media-export: Actually turn of meta-data
This was not disabling stuff properly
Diffstat (limited to 'src')
-rw-r--r--src/plugins/media-export/rygel-media-export-extract.vala2
-rw-r--r--src/plugins/media-export/rygel-media-export-extractor.vala14
-rw-r--r--src/plugins/media-export/rygel-media-export-metadata-extractor.vala4
3 files changed, 17 insertions, 3 deletions
diff --git a/src/plugins/media-export/rygel-media-export-extract.vala b/src/plugins/media-export/rygel-media-export-extract.vala
index a1211318..01115599 100644
--- a/src/plugins/media-export/rygel-media-export-extract.vala
+++ b/src/plugins/media-export/rygel-media-export-extract.vala
@@ -177,7 +177,7 @@ int main (string[] args) {
registry.remove_feature (feature);
}
- message ("Started with descriptors %d (in) %d (out)", in_fd, out_fd);
+ message ("Started with descriptors %d (in) %d (out), extracting meta-data: %s", in_fd, out_fd, metadata.to_string ());
input_stream = new DataInputStream (new UnixInputStream (in_fd, true));
output_stream = new UnixOutputStream (out_fd, true);
diff --git a/src/plugins/media-export/rygel-media-export-extractor.vala b/src/plugins/media-export/rygel-media-export-extractor.vala
index 4277e62d..93d5fe9c 100644
--- a/src/plugins/media-export/rygel-media-export-extractor.vala
+++ b/src/plugins/media-export/rygel-media-export-extractor.vala
@@ -117,6 +117,20 @@ public class Rygel.MediaExport.Extractor : Object {
var content_type = ContentType.get_mime_type
(file_info.get_content_type ());
+
+
+ if (!extract_metadata) {
+ if (content_type.has_prefix ("video/")) {
+ this.serialized_info.insert (Serializer.UPNP_CLASS, "s", UPNP_CLASS_VIDEO);
+ } else if (content_type.has_prefix ("image/")) {
+ this.serialized_info.insert (Serializer.UPNP_CLASS, "s", UPNP_CLASS_PHOTO);
+ } else if (content_type.has_prefix ("audio/") || content_type == "application/ogg") {
+ this.serialized_info.insert (Serializer.UPNP_CLASS, "s", UPNP_CLASS_MUSIC);
+ } else { // application/xml or text/xml
+ // Do nothing. Should at least try to parse a DIDL_S playlist here?
+ }
+ }
+
this.serialized_info.insert (Serializer.MIME_TYPE, "s", content_type);
this.serialized_info.insert (Serializer.SIZE, "t", file_info.get_size ());
var id = Checksum.compute_for_string (ChecksumType.MD5,
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 f6b93080..bf3cdafd 100644
--- a/src/plugins/media-export/rygel-media-export-metadata-extractor.vala
+++ b/src/plugins/media-export/rygel-media-export-metadata-extractor.vala
@@ -138,9 +138,9 @@ public class Rygel.MediaExport.MetadataExtractor: GLib.Object {
this.error_uri = null;
if (this.extract_metadata) {
- MX_EXTRACT_ARGV[4] = "--extract-metadata";
+ MX_EXTRACT_ARGV[3] = "--extract-metadata";
} else {
- MX_EXTRACT_ARGV[4] = null;
+ MX_EXTRACT_ARGV[3] = null;
}
var subprocess = launcher.spawnv (MX_EXTRACT_ARGV);