summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens Georg <mail@jensge.org>2022-05-16 13:26:03 +0200
committerJens Georg <mail@jensge.org>2022-05-16 13:51:25 +0200
commitb22010cd9229a83eacae30c13aa9f61c10046505 (patch)
tree9cea9411574861ee46d6ea2312bb28f0bf6f07e2
parent3921cb5fc8ec780ddfad4621a0225badafdf3801 (diff)
downloadrygel-b22010cd9229a83eacae30c13aa9f61c10046505.tar.gz
media-export: Actually turn of meta-data
This was not disabling stuff properly
-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);