diff --git a/server/torr/storage/torrstor/diskpiece.go b/server/torr/storage/torrstor/diskpiece.go index fe29bd3..b20de74 100644 --- a/server/torr/storage/torrstor/diskpiece.go +++ b/server/torr/storage/torrstor/diskpiece.go @@ -8,8 +8,6 @@ import ( "sync" "time" - "github.com/anacrolix/torrent" - "server/log" "server/settings" ) @@ -84,7 +82,4 @@ func (p *DiskPiece) Release() { p.piece.Complete = false os.Remove(p.name) - - p.piece.cache.torrent.Piece(p.piece.Id).SetPriority(torrent.PiecePriorityNone) - p.piece.cache.torrent.Piece(p.piece.Id).UpdateCompletion() } diff --git a/server/torr/storage/torrstor/mempiece.go b/server/torr/storage/torrstor/mempiece.go index 3fdc873..acb3074 100644 --- a/server/torr/storage/torrstor/mempiece.go +++ b/server/torr/storage/torrstor/mempiece.go @@ -4,8 +4,6 @@ import ( "io" "sync" "time" - - "github.com/anacrolix/torrent" ) type MemPiece struct { @@ -69,7 +67,4 @@ 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).UpdateCompletion() } diff --git a/server/torr/storage/torrstor/piece.go b/server/torr/storage/torrstor/piece.go index dc8c643..f91aac4 100644 --- a/server/torr/storage/torrstor/piece.go +++ b/server/torr/storage/torrstor/piece.go @@ -1,6 +1,7 @@ package torrstor import ( + "github.com/anacrolix/torrent" "github.com/anacrolix/torrent/storage" "server/settings" ) @@ -73,9 +74,8 @@ 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) + p.cache.torrent.Piece(p.Id).UpdateCompletion() + } }