fix DLNA IDs

This commit is contained in:
nikk gitanes
2021-09-07 10:34:28 +03:00
parent 6d499aa655
commit 4d22d8f131
2 changed files with 8 additions and 8 deletions

View File

@@ -22,7 +22,7 @@ func getRoot() (ret []interface{}) {
// Root Object
rootObj := upnpav.Object{
ID: "%2FTorrents",
ID: "%2FTR",
ParentID: "0",
Title: "Torrents",
Class: "object.container.storageFolder",
@@ -52,7 +52,7 @@ func getTorrents() (ret []interface{}) {
vol++
obj := upnpav.Object{
ID: "%2F" + t.TorrentSpec.InfoHash.HexString(),
ParentID: "%2FTorrents",
ParentID: "%2FTR",
Title: t.Title,
Class: "object.container.storageFolder",
Restricted: 1,
@@ -65,8 +65,8 @@ func getTorrents() (ret []interface{}) {
}
if vol == 0 {
obj := upnpav.Object{
ID: "%2FNo Torrents",
ParentID: "%2FTorrents",
ID: "%2FNT",
ParentID: "%2FTR",
Title: "No Torrents",
Class: "object.container.storageFolder",
Restricted: 1,
@@ -98,7 +98,7 @@ func getTorrent(path, host string) (ret []interface{}) {
// if torrent not loaded, get button for load
if torr.Files() == nil {
obj := upnpav.Object{
ID: parent + "%2FLoad Torrent",
ID: parent + "%2FLD",
ParentID: parent,
Title: "Load Torrent",
Class: "object.container.storageFolder",
@@ -181,7 +181,7 @@ func getObjFromTorrent(path, parent, host string, torr *torr.Torrent, file *stat
}
obj := upnpav.Object{
ID: parent + "%2F" + file.Path,
ID: url.PathEscape(parent + "/" + file.Path),
ParentID: parent,
Title: file.Path,
Class: "object.item." + mime.Type() + "Item",