mirror of
https://github.com/Ernous/TorrServerJellyfin.git
synced 2025-12-19 21:46:11 +05:00
update
This commit is contained in:
@@ -58,6 +58,9 @@ func ListViewed(hash string) []*Viewed {
|
||||
var err error
|
||||
if hash != "" {
|
||||
buf := tdb.Get("Viewed", hash)
|
||||
if len(buf) == 0 {
|
||||
return []*Viewed{}
|
||||
}
|
||||
var indeces map[int]struct{}
|
||||
err = json.Unmarshal(buf, &indeces)
|
||||
if err == nil {
|
||||
@@ -72,6 +75,9 @@ func ListViewed(hash string) []*Viewed {
|
||||
keys := tdb.List("Viewed")
|
||||
for _, key := range keys {
|
||||
buf := tdb.Get("Viewed", key)
|
||||
if len(buf) == 0 {
|
||||
return []*Viewed{}
|
||||
}
|
||||
var indeces map[int]struct{}
|
||||
err = json.Unmarshal(buf, &indeces)
|
||||
if err == nil {
|
||||
@@ -86,5 +92,5 @@ func ListViewed(hash string) []*Viewed {
|
||||
if err != nil {
|
||||
log.TLogln("Error list viewed:", err)
|
||||
}
|
||||
return nil
|
||||
return []*Viewed{}
|
||||
}
|
||||
|
||||
@@ -62,13 +62,12 @@ func GetTorrent(hashHex string) *Torrent {
|
||||
|
||||
tor = GetTorrentDB(hash)
|
||||
|
||||
tr, err := NewTorrent(tor.TorrentSpec, bts)
|
||||
if err != nil {
|
||||
log.TLogln("error get torrent db:", err)
|
||||
}
|
||||
go func() {
|
||||
tr, _ := NewTorrent(tor.TorrentSpec, bts)
|
||||
if tr != nil {
|
||||
go tr.GotInfo()
|
||||
tr.GotInfo()
|
||||
}
|
||||
}()
|
||||
return tor
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user