mirror of
https://github.com/rclone/rclone
synced 2025-01-13 17:06:24 +01:00
dlna: cds: use modification time as date in dlna metadata
We havn't been outputting anything for this until now, which leads to my Samsung showing an epoch/1970 date for all files.
This commit is contained in:
parent
393b94bb70
commit
7586a345ff
@ -104,6 +104,7 @@ func (cds *contentDirectoryService) cdsObjectToUpnpavObject(cdsObject object, fi
|
|||||||
|
|
||||||
obj.Class = "object.item." + mediaType[1] + "Item"
|
obj.Class = "object.item." + mediaType[1] + "Item"
|
||||||
obj.Title = fileInfo.Name()
|
obj.Title = fileInfo.Name()
|
||||||
|
obj.Date = upnpav.Timestamp{Time: fileInfo.ModTime()}
|
||||||
|
|
||||||
item := upnpav.Item{
|
item := upnpav.Item{
|
||||||
Object: obj,
|
Object: obj,
|
||||||
|
@ -124,6 +124,8 @@ func TestContentDirectoryBrowseMetadata(t *testing.T) {
|
|||||||
require.NotContains(t, string(body), html.EscapeString("<item "))
|
require.NotContains(t, string(body), html.EscapeString("<item "))
|
||||||
// if there is a childCount, it better not be zero
|
// if there is a childCount, it better not be zero
|
||||||
require.NotContains(t, string(body), html.EscapeString(" childCount=\"0\""))
|
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.
|
// Check that the X_MS_MediaReceiverRegistrar is faked out properly.
|
||||||
|
Loading…
Reference in New Issue
Block a user