mirror of
https://github.com/Ernous/TorrServerJellyfin.git
synced 2025-12-19 21:46:11 +05:00
safe UpdateCompletion() on Release()
This commit is contained in:
@@ -199,7 +199,7 @@ func (c *Cache) cleanPieces() {
|
||||
rems := (c.filled-c.capacity)/c.pieceLength + 1
|
||||
for _, p := range remPieces {
|
||||
c.removePiece(p)
|
||||
c.torrent.Piece(p.Id).UpdateCompletion()
|
||||
//c.torrent.Piece(p.Id).UpdateCompletion() // safe call in Piece.Release()
|
||||
rems--
|
||||
if rems <= 0 {
|
||||
utils.FreeOSMemGC()
|
||||
|
||||
@@ -85,5 +85,5 @@ func (p *DiskPiece) Release() {
|
||||
|
||||
os.Remove(p.name)
|
||||
|
||||
p.piece.cache.torrent.Piece(p.piece.Id).SetPriority(torrent.PiecePriorityNone)
|
||||
//p.piece.cache.torrent.Piece(p.piece.Id).SetPriority(torrent.PiecePriorityNone)
|
||||
}
|
||||
|
||||
@@ -70,5 +70,5 @@ func (p *MemPiece) Release() {
|
||||
p.piece.Size = 0
|
||||
p.piece.Complete = false
|
||||
|
||||
p.piece.cache.torrent.Piece(p.piece.Id).SetPriority(torrent.PiecePriorityNone)
|
||||
//p.piece.cache.torrent.Piece(p.piece.Id).SetPriority(torrent.PiecePriorityNone)
|
||||
}
|
||||
|
||||
@@ -73,9 +73,9 @@ func (p *Piece) Release() {
|
||||
} else {
|
||||
p.dPiece.Release()
|
||||
}
|
||||
// if !p.cache.isClosed {
|
||||
// p.cache.torrent.Piece(p.Id).SetPriority(torrent.PiecePriorityNone)
|
||||
// // fix remove pieces hash
|
||||
// p.cache.torrent.Piece(p.Id).UpdateCompletion()
|
||||
// }
|
||||
if !p.cache.isClosed {
|
||||
p.cache.torrent.Piece(p.Id).SetPriority(torrent.PiecePriorityNone)
|
||||
// fix remove pieces hash and rewind
|
||||
p.cache.torrent.Piece(p.Id).UpdateCompletion()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user