DLNA: don't err for root obj meta

and swap icons order
This commit is contained in:
nikk gitanes
2021-09-09 11:50:10 +03:00
parent 49a72242c4
commit 6bdfc2b935
4 changed files with 38 additions and 24 deletions

View File

@@ -20,8 +20,8 @@ import (
func getRoot() (ret []interface{}) {
// Root Object
rootObj := upnpav.Object{
// Torrents Object
tObj := upnpav.Object{
ID: "%2FTR",
ParentID: "0",
Restricted: 1,
@@ -30,9 +30,9 @@ func getRoot() (ret []interface{}) {
Date: upnpav.Timestamp{Time: time.Now()},
}
// add Root Object
lenl := len(torr.ListTorrent())
cnt := upnpav.Container{Object: rootObj, ChildCount: lenl}
// add Torrents Object
vol := len(torr.ListTorrent())
cnt := upnpav.Container{Object: tObj, ChildCount: vol}
ret = append(ret, cnt)
return
@@ -74,7 +74,6 @@ func getTorrents() (ret []interface{}) {
}
cnt := upnpav.Container{Object: obj, ChildCount: 1}
ret = append(ret, cnt)
vol = 1
}
return
}