[rygel/rygel-0-40] media-export: Actually turn of meta-data
- From: Jens Georg <jensgeorg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [rygel/rygel-0-40] media-export: Actually turn of meta-data
- Date: Mon, 16 May 2022 11:51:31 +0000 (UTC)
commit b22010cd9229a83eacae30c13aa9f61c10046505
Author: Jens Georg <mail jensge org>
Date: Mon May 16 13:26:03 2022 +0200
media-export: Actually turn of meta-data
This was not disabling stuff properly
src/plugins/media-export/rygel-media-export-extract.vala | 2 +-
src/plugins/media-export/rygel-media-export-extractor.vala | 14 ++++++++++++++
.../rygel-media-export-metadata-extractor.vala | 4 ++--
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);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]