mirror of
https://github.com/Ernous/TorrServerJellyfin.git
synced 2025-12-19 13:36:09 +05:00
refactor
This commit is contained in:
@@ -8,8 +8,6 @@ import (
|
|||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/anacrolix/torrent"
|
|
||||||
|
|
||||||
"server/log"
|
"server/log"
|
||||||
"server/settings"
|
"server/settings"
|
||||||
)
|
)
|
||||||
@@ -84,7 +82,4 @@ func (p *DiskPiece) Release() {
|
|||||||
p.piece.Complete = false
|
p.piece.Complete = false
|
||||||
|
|
||||||
os.Remove(p.name)
|
os.Remove(p.name)
|
||||||
|
|
||||||
p.piece.cache.torrent.Piece(p.piece.Id).SetPriority(torrent.PiecePriorityNone)
|
|
||||||
p.piece.cache.torrent.Piece(p.piece.Id).UpdateCompletion()
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,8 +4,6 @@ import (
|
|||||||
"io"
|
"io"
|
||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/anacrolix/torrent"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type MemPiece struct {
|
type MemPiece struct {
|
||||||
@@ -69,7 +67,4 @@ func (p *MemPiece) Release() {
|
|||||||
}
|
}
|
||||||
p.piece.Size = 0
|
p.piece.Size = 0
|
||||||
p.piece.Complete = false
|
p.piece.Complete = false
|
||||||
|
|
||||||
p.piece.cache.torrent.Piece(p.piece.Id).SetPriority(torrent.PiecePriorityNone)
|
|
||||||
p.piece.cache.torrent.Piece(p.piece.Id).UpdateCompletion()
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package torrstor
|
package torrstor
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"github.com/anacrolix/torrent"
|
||||||
"github.com/anacrolix/torrent/storage"
|
"github.com/anacrolix/torrent/storage"
|
||||||
"server/settings"
|
"server/settings"
|
||||||
)
|
)
|
||||||
@@ -73,9 +74,8 @@ func (p *Piece) Release() {
|
|||||||
} else {
|
} else {
|
||||||
p.dPiece.Release()
|
p.dPiece.Release()
|
||||||
}
|
}
|
||||||
// if !p.cache.isClosed {
|
if !p.cache.isClosed {
|
||||||
// p.cache.torrent.Piece(p.Id).SetPriority(torrent.PiecePriorityNone)
|
p.cache.torrent.Piece(p.Id).SetPriority(torrent.PiecePriorityNone)
|
||||||
// // fix remove pieces hash
|
p.cache.torrent.Piece(p.Id).UpdateCompletion()
|
||||||
// p.cache.torrent.Piece(p.Id).UpdateCompletion()
|
}
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user