fix preload with ffprobe

This commit is contained in:
nikk gitanes
2023-03-02 02:52:34 +03:00
parent 478c7a1d2f
commit 56f082e65d
2 changed files with 8 additions and 2 deletions

View File

@@ -119,9 +119,15 @@ func (t *Torrent) WaitInfo() bool {
}
func (t *Torrent) GotInfo() bool {
// log.TLogln("GotInfo state:", t.Stat)
if t.Stat == state.TorrentClosed {
return false
}
// assume we have info in preload state
// and dont override with TorrentWorking
if t.Stat == state.TorrentPreload {
return true
}
t.Stat = state.TorrentGettingInfo
if t.WaitInfo() {
t.Stat = state.TorrentWorking
@@ -250,11 +256,11 @@ func (t *Torrent) GetCache() *torrstor.Cache {
func (t *Torrent) drop() {
t.muTorrent.Lock()
defer t.muTorrent.Unlock()
if t.Torrent != nil {
t.Torrent.Drop()
t.Torrent = nil
}
t.muTorrent.Unlock()
}
func (t *Torrent) Close() {