mirror of
https://github.com/Ernous/TorrServerJellyfin.git
synced 2025-12-19 21:46:11 +05:00
fmt
This commit is contained in:
@@ -6,7 +6,6 @@ import (
|
|||||||
"sort"
|
"sort"
|
||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
"fmt"
|
|
||||||
|
|
||||||
"server/settings"
|
"server/settings"
|
||||||
"server/utils"
|
"server/utils"
|
||||||
@@ -185,16 +184,16 @@ func (t *Torrent) progressEvent() {
|
|||||||
}
|
}
|
||||||
t.muTorrent.Unlock()
|
t.muTorrent.Unlock()
|
||||||
t.lastTimeSpeed = time.Now()
|
t.lastTimeSpeed = time.Now()
|
||||||
if (t.BytesReadUsefulData > settings.Get().PreloadBufferSize) {
|
if t.BytesReadUsefulData > settings.Get().PreloadBufferSize {
|
||||||
adj := int64((int(t.cache.GetState().PiecesLength) * t.Torrent.Stats().ActivePeers) / (1 + t.cache.ReadersLen()))
|
adj := int64((int(t.cache.GetState().PiecesLength) * t.Torrent.Stats().ActivePeers) / (1 + t.cache.ReadersLen()))
|
||||||
switch {
|
switch {
|
||||||
case adj < t.cache.GetState().PiecesLength:
|
case adj < t.cache.GetState().PiecesLength:
|
||||||
adj = t.cache.GetState().PiecesLength
|
adj = t.cache.GetState().PiecesLength
|
||||||
case adj > t.cache.GetState().PiecesLength * 4:
|
case adj > t.cache.GetState().PiecesLength*4:
|
||||||
adj = t.cache.GetState().PiecesLength * 4
|
adj = t.cache.GetState().PiecesLength * 4
|
||||||
}
|
}
|
||||||
t.cache.AdjustRA(adj)
|
t.cache.AdjustRA(adj)
|
||||||
log.Println("Status:", t.Name(), "S:", fmt.Sprintf("%8s", utils.Format(t.DownloadSpeed)), "P:", fmt.Sprintf("%2d", t.Torrent.Stats().ActivePeers), "/", fmt.Sprintf("%2d", t.Torrent.Stats().TotalPeers), "R:", t.cache.ReadersLen(), "RA:", utils.Format(float64(adj)))
|
//log.Println("Status:", t.Name(), "S:", fmt.Sprintf("%8s", utils.Format(t.DownloadSpeed)), "P:", fmt.Sprintf("%2d", t.Torrent.Stats().ActivePeers), "/", fmt.Sprintf("%2d", t.Torrent.Stats().TotalPeers), "R:", t.cache.ReadersLen(), "RA:", utils.Format(float64(adj)))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user