summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens Georg <mail@jensge.org>2020-10-12 17:20:56 +0200
committerJens Georg <mail@jensge.org>2020-12-27 16:46:49 +0100
commit509c9aaf40e466fd44678cc75a28b36b90606788 (patch)
tree3b1779fbbf81d5818a1d40da040a09ea03440f04
parente68d688b34e7c0fceaf0026ad5933e66ea70c7f4 (diff)
downloadrygel-509c9aaf40e466fd44678cc75a28b36b90606788.tar.gz
server: add albumArtUri to VideoItem
Fixes #151
-rw-r--r--src/librygel-server/rygel-video-item.vala20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/librygel-server/rygel-video-item.vala b/src/librygel-server/rygel-video-item.vala
index 78248225..dc82bd15 100644
--- a/src/librygel-server/rygel-video-item.vala
+++ b/src/librygel-server/rygel-video-item.vala
@@ -182,6 +182,7 @@ public class Rygel.VideoItem : AudioItem, VisualItem {
subtitle.add_didl_node (didl_item);
}
}
+
if (main_subtitle != null) {
// Add resource-level subtitle metadata to all streamable
// video resources Note: All resources have already been
@@ -201,6 +202,25 @@ public class Rygel.VideoItem : AudioItem, VisualItem {
}
}
+ // Also add upnp:albumArtURI for thumbnails. Some players need this apparently
+ // even for videos instead of using the JPEG_TN/PNG_TN resource
+ if (this.thumbnails.size != 0) {
+ var protocol = this.get_protocol_for_uri (this.thumbnails[0].uri);
+ if (http_server.is_local () || protocol != "internal") {
+ didl_item.album_art = this.thumbnails[0].uri;
+ } else {
+ // Create a http uri for the album art that our server can process
+ string http_uri = http_server.create_uri_for_object (this,
+ 0,
+ -1,
+ null);
+ didl_item.album_art = MediaFileItem.address_regex.replace_literal
+ (http_uri,
+ -1,
+ 0,
+ http_server.context.host_ip);
+ }
+ }
}
return didl_item;