sor required fields, add date and enable StallEventSubscribe

This commit is contained in:
nikk gitanes
2021-09-02 16:40:06 +03:00
parent 0f718b65e7
commit 132d5dbd44
2 changed files with 10 additions and 6 deletions

View File

@@ -39,6 +39,7 @@ func Start() {
FriendlyName: getDefaultFriendlyName(),
NoTranscode: true,
NoProbe: true,
StallEventSubscribe: true,
Icons: []dms.Icon{
dms.Icon{
Width: 32,

View File

@@ -22,12 +22,13 @@ func getTorrents() (ret []interface{}) {
for _, t := range torrs {
obj := upnpav.Object{
ID: "%2F" + t.TorrentSpec.InfoHash.HexString(),
Restricted: 1,
ParentID: "0",
Class: "object.container.storageFolder",
Title: t.Title,
Class: "object.container.storageFolder",
Restricted: 1,
Icon: t.Poster,
AlbumArtURI: t.Poster,
Date: upnpav.Timestamp{Time: time.Now()},
}
cnt := upnpav.Container{Object: obj}
ret = append(ret, cnt)
@@ -55,10 +56,11 @@ func getTorrent(path, host string) (ret []interface{}) {
if torr.Files() == nil {
obj := upnpav.Object{
ID: parent + "%2FLoad Torrent",
Restricted: 1,
ParentID: parent,
Class: "object.container.storageFolder",
Title: "Load Torrent",
Class: "object.container.storageFolder",
Restricted: 1,
Date: upnpav.Timestamp{Time: time.Now()},
}
cnt := upnpav.Container{Object: obj}
ret = append(ret, cnt)
@@ -132,10 +134,11 @@ func getObjFromTorrent(path, parent, host string, torr *torr.Torrent, file *stat
obj := upnpav.Object{
ID: parent + "%2F" + file.Path,
Restricted: 1,
ParentID: parent,
Class: "object.item." + mime.Type() + "Item",
Title: file.Path,
Class: "object.item." + mime.Type() + "Item",
Restricted: 1,
Date: upnpav.Timestamp{Time: time.Now()},
}
item := upnpav.Item{