Skip to content

Commit e41bda5

Browse files
committed
fix torrent structures for unusual torrents coding
update go version better error printing yet another user notification
1 parent ee7cb09 commit e41bda5

File tree

4 files changed

+6
-5
lines changed

4 files changed

+6
-5
lines changed

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
gotag=1.21.4-bullseye
1+
gotag=1.21.5-bullseye
22

33
commit=$(shell git rev-parse HEAD)
44

bt2qbt.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,8 @@ func main() {
5454
color.Green("It will be performed processing from directory %v to directory %v\n", opts.BitDir, opts.QBitDir)
5555
color.HiRed("Check that the qBittorrent is turned off and the directory %v and %v is backed up.\n",
5656
opts.QBitDir, opts.Categories)
57-
color.HiRed("Check that you previously disable option \"Append .!ut/.!bt to incomplete files\" in preferences of uTorrent/Bittorrent \n\n")
57+
color.HiRed("Check that you previously disable option \"Append .!ut/.!bt to incomplete files\" in preferences of uTorrent/Bittorrent \n")
58+
color.HiRed("Close uTorrent/Bittorrent and qBittorrent previously\n\n")
5859
fmt.Println("Press Enter to start")
5960
fmt.Scanln()
6061
log.Println("Started")

internal/transfer/resumeHandle.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -44,15 +44,15 @@ func HandleResumeItem(key string, transferStruct *TransferStructure, chans *Chan
4444
// struct for work with
4545
err = helpers.DecodeTorrentFile(transferStruct.TorrentFilePath, transferStruct.TorrentFile)
4646
if err != nil {
47-
chans.ErrChannel <- fmt.Sprintf("Can't decode torrent file %v for %v", transferStruct.TorrentFilePath, key)
47+
chans.ErrChannel <- fmt.Sprintf("Can't decode torrent file %v for torrent %v with error %v", transferStruct.TorrentFilePath, key, err)
4848
return err
4949
}
5050

5151
// because hash of info very important it will be better to use interface for get hash
5252
if !strings.HasPrefix(key, "magnet:?") {
5353
err = helpers.DecodeTorrentFile(transferStruct.TorrentFilePath, &transferStruct.TorrentFileRaw)
5454
if err != nil {
55-
chans.ErrChannel <- fmt.Sprintf("Can't decode torrent file %v for %v", transferStruct.TorrentFilePath, key)
55+
chans.ErrChannel <- fmt.Sprintf("Can't decode torrent file %v for torrent %v with error %v", transferStruct.TorrentFilePath, key, err)
5656
return err
5757
}
5858
} else {

pkg/torrentStructures/torrent.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ type Torrent struct {
44
Announce string `bencode:"announce"`
55
Comment string `bencode:"comment"`
66
CreatedBy string `bencode:"created by"`
7-
CreationDate int64 `bencode:"creation date"`
7+
CreationDate interface{} `bencode:"creation date"` // can't be string or int64
88
Info *TorrentInfo `bencode:"info"`
99
Publisher string `bencode:"publisher,omitempty"`
1010
PublisherUrl string `bencode:"publisher-url,omitempty"`

0 commit comments

Comments
 (0)