This commit is contained in:
YouROK
2020-11-10 14:06:13 +03:00
parent c95eaccc57
commit 6a11651cf5
15 changed files with 566 additions and 209 deletions

View File

@@ -7,7 +7,7 @@ import (
"github.com/anacrolix/torrent"
"github.com/anacrolix/torrent/metainfo"
"server/torr"
"server/torr/state"
)
type TorrentDB struct {
@@ -18,7 +18,7 @@ type TorrentDB struct {
Timestamp int64 `json:"timestamp,omitempty"`
Files []torr.TorrentFileStat `json:"files,omitempty"`
Files []state.TorrentFileStat `json:"files,omitempty"`
}
type File struct {
@@ -63,7 +63,7 @@ func ListTorrent() []*TorrentDB {
buf := tdb.Get("Torrents", key)
if len(buf) > 0 {
var torr *TorrentDB
err := json.Unmarshal(buf, torr)
err := json.Unmarshal(buf, &torr)
if err == nil {
list = append(list, torr)
}