mirror of
https://github.com/rumanzo/bt2qbt.git
synced 2024-11-22 10:22:38 +01:00
commit
79f4dff753
@ -220,7 +220,11 @@ func logic(key string, value map[string]interface{}, flags *Flags, chans *Channe
|
||||
newstructure.QbtQueuePosition = position
|
||||
newstructure.Started(value["started"].(int64))
|
||||
newstructure.FinishedTime = int64(time.Since(time.Unix(value["completed_on"].(int64), 0)).Minutes())
|
||||
newstructure.TotalDownloaded = value["downloaded"].(int64)
|
||||
if value["completed_on"].(int64) == 0 {
|
||||
newstructure.TotalDownloaded = 0
|
||||
} else {
|
||||
newstructure.TotalDownloaded = value["downloaded"].(int64)
|
||||
}
|
||||
newstructure.TotalUploaded = value["uploaded"].(int64)
|
||||
newstructure.UploadRateLimit = value["upspeed"].(int64)
|
||||
newstructure.IfTags(value["labels"])
|
||||
|
@ -150,15 +150,20 @@ func (newstructure *NewTorrentStructure) FillMissing() {
|
||||
newstructure.FillSizes()
|
||||
newstructure.FillSavePaths()
|
||||
if newstructure.Unfinished != nil {
|
||||
newstructure.Pieces = newstructure.FillNotHaveFiles("0")
|
||||
newstructure.Pieces = newstructure.FillWholePieces("0")
|
||||
if newstructure.HasFiles {
|
||||
newstructure.PiecePriority = newstructure.FillPiecesParted()
|
||||
} else {
|
||||
newstructure.PiecePriority = newstructure.FillWholePieces("1")
|
||||
}
|
||||
} else {
|
||||
if newstructure.HasFiles {
|
||||
newstructure.Pieces = newstructure.FillHaveFiles()
|
||||
newstructure.Pieces = newstructure.FillPiecesParted()
|
||||
} else {
|
||||
newstructure.Pieces = newstructure.FillNotHaveFiles("1")
|
||||
newstructure.Pieces = newstructure.FillWholePieces("1")
|
||||
}
|
||||
newstructure.PiecePriority = newstructure.Pieces
|
||||
}
|
||||
newstructure.PiecePriority = newstructure.Pieces
|
||||
}
|
||||
|
||||
func (newstructure *NewTorrentStructure) FillSizes() {
|
||||
@ -196,7 +201,7 @@ func (newstructure *NewTorrentStructure) FillSizes() {
|
||||
}
|
||||
}
|
||||
|
||||
func (newstructure *NewTorrentStructure) FillNotHaveFiles(chr string) []byte {
|
||||
func (newstructure *NewTorrentStructure) FillWholePieces(chr string) []byte {
|
||||
var newpieces = make([]byte, 0, newstructure.NumPieces)
|
||||
nchr, _ := strconv.Atoi(chr)
|
||||
for i := int64(0); i < newstructure.NumPieces; i++ {
|
||||
@ -213,7 +218,7 @@ func (newstructure *NewTorrentStructure) GetHash() (hash string) {
|
||||
return
|
||||
}
|
||||
|
||||
func (newstructure *NewTorrentStructure) FillHaveFiles() []byte {
|
||||
func (newstructure *NewTorrentStructure) FillPiecesParted() []byte {
|
||||
var newpieces = make([]byte, 0, newstructure.NumPieces)
|
||||
var allocation [][]int64
|
||||
chrone, _ := strconv.Atoi("1")
|
||||
|
Loading…
Reference in New Issue
Block a user