summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJens Georg <mail@jensge.org>2020-10-12 17:20:56 +0200
committerJens Georg <mail@jensge.org>2020-10-12 17:22:26 +0200
commit37cf8798b5c6388a0af7a8bfa30ed123e039e393 (patch)
treed2eb60a50eeb177d75b9cae87cf15d07b9e02384 /src
parentb36506691cf0fa3566063a3f752e0ea74a8f2f7d (diff)
downloadrygel-37cf8798b5c6388a0af7a8bfa30ed123e039e393.tar.gz
server: add albumArtUri to VideoItem
Fixes #151
Diffstat (limited to 'src')
-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;