Skip to content

"rsync for cloud storage" - Google Drive, S3, Dropbox, Backblaze B2, One Drive, Swift, Hubic, Wasabi, Google Cloud Storage, Azure Blob, Azure Files, Yandex Files

dlna: cds: use modification time as date in dlna metadata

Dan Walters7586a345ff3c
diff --git a/cmd/serve/dlna/cds.go b/cmd/serve/dlna/cds.go
index 1fa1cfe9f..1b600f203 100644
--- a/cmd/serve/dlna/cds.go
+++ b/cmd/serve/dlna/cds.go
@@ -104,6 +104,7 @@ func (cds *contentDirectoryService) cdsObjectToUpnpavObject(cdsObject object, fi
obj.Class = "object.item." + mediaType[1] + "Item"
obj.Title = fileInfo.Name()
+ obj.Date = upnpav.Timestamp{Time: fileInfo.ModTime()}
item := upnpav.Item{
Object: obj,
diff --git a/cmd/serve/dlna/dlna_test.go b/cmd/serve/dlna/dlna_test.go
index eaeab4091..540a59b44 100644
--- a/cmd/serve/dlna/dlna_test.go
+++ b/cmd/serve/dlna/dlna_test.go
@@ -124,6 +124,8 @@ func TestContentDirectoryBrowseMetadata(t *testing.T) {
require.NotContains(t, string(body), html.EscapeString("<item "))
// if there is a childCount, it better not be zero
require.NotContains(t, string(body), html.EscapeString(" childCount=\"0\""))
+ // should have a dc:date element
+ require.Contains(t, string(body), html.EscapeString("<dc:date>"))
}
// Check that the X_MS_MediaReceiverRegistrar is faked out properly.