mirror of
https://github.com/Ernous/TorrServerJellyfin.git
synced 2025-12-19 13:36:09 +05:00
update
This commit is contained in:
@@ -19,6 +19,7 @@ type TorrentDB struct {
|
||||
Poster string `json:"poster,omitempty"`
|
||||
|
||||
Timestamp int64 `json:"timestamp,omitempty"`
|
||||
Size int64 `json:"size,omitempty"`
|
||||
|
||||
Files []state.TorrentFileStat `json:"files,omitempty"`
|
||||
}
|
||||
|
||||
@@ -29,6 +29,7 @@ func GetTorrentDB(hash metainfo.Hash) *Torrent {
|
||||
torr.Title = db.Title
|
||||
torr.Poster = db.Poster
|
||||
torr.Timestamp = db.Timestamp
|
||||
torr.Size = db.Size
|
||||
torr.Stat = state.TorrentInDB
|
||||
return torr
|
||||
}
|
||||
@@ -49,6 +50,7 @@ func ListTorrentsDB() map[metainfo.Hash]*Torrent {
|
||||
torr.Title = db.Title
|
||||
torr.Poster = db.Poster
|
||||
torr.Timestamp = db.Timestamp
|
||||
torr.Size = db.Size
|
||||
torr.Stat = state.TorrentInDB
|
||||
ret[torr.TorrentSpec.InfoHash] = torr
|
||||
}
|
||||
|
||||
@@ -26,6 +26,7 @@ type Torrent struct {
|
||||
|
||||
Stat state.TorrentStat
|
||||
Timestamp int64
|
||||
Size int64
|
||||
/////
|
||||
|
||||
*torrent.Torrent
|
||||
@@ -80,6 +81,7 @@ func NewTorrent(spec *torrent.TorrentSpec, bt *BTServer) (*Torrent, error) {
|
||||
torr.TorrentSpec = spec
|
||||
torr.expiredTime = time.Now().Add(time.Minute)
|
||||
torr.Timestamp = time.Now().Unix()
|
||||
torr.Size = goTorrent.Length()
|
||||
|
||||
go torr.watch()
|
||||
|
||||
@@ -353,6 +355,7 @@ func (t *Torrent) Status() *state.TorrentStatus {
|
||||
st.Title = t.Title
|
||||
st.Poster = t.Poster
|
||||
st.Timestamp = t.Timestamp
|
||||
st.TorrentSize = t.Size
|
||||
|
||||
if t.TorrentSpec != nil {
|
||||
st.Hash = t.TorrentSpec.InfoHash.HexString()
|
||||
@@ -361,7 +364,7 @@ func (t *Torrent) Status() *state.TorrentStatus {
|
||||
st.Name = t.Torrent.Name()
|
||||
st.Hash = t.Torrent.InfoHash().HexString()
|
||||
st.LoadedSize = t.Torrent.BytesCompleted()
|
||||
st.TorrentSize = t.Length()
|
||||
st.TorrentSize = t.Torrent.Length()
|
||||
st.PreloadedBytes = t.PreloadedBytes
|
||||
st.PreloadSize = t.PreloadSize
|
||||
st.DownloadSpeed = t.DownloadSpeed
|
||||
|
||||
Reference in New Issue
Block a user