fix torrent structures for unusual torrents coding

update go version
better error printing
yet another user notification
This commit is contained in:
rumanzo 2023-12-25 23:39:59 +03:00
parent ee7cb09a2e
commit e41bda56fe
No known key found for this signature in database
4 changed files with 6 additions and 5 deletions

View File

@ -1,4 +1,4 @@
gotag=1.21.4-bullseye gotag=1.21.5-bullseye
commit=$(shell git rev-parse HEAD) commit=$(shell git rev-parse HEAD)

View File

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

View File

@ -44,7 +44,7 @@ func HandleResumeItem(key string, transferStruct *TransferStructure, chans *Chan
// struct for work with // struct for work with
err = helpers.DecodeTorrentFile(transferStruct.TorrentFilePath, transferStruct.TorrentFile) err = helpers.DecodeTorrentFile(transferStruct.TorrentFilePath, transferStruct.TorrentFile)
if err != nil { if err != nil {
chans.ErrChannel <- fmt.Sprintf("Can't decode torrent file %v for %v", transferStruct.TorrentFilePath, key) chans.ErrChannel <- fmt.Sprintf("Can't decode torrent file %v for torrent %v with error %v", transferStruct.TorrentFilePath, key, err)
return err return err
} }
@ -52,7 +52,7 @@ func HandleResumeItem(key string, transferStruct *TransferStructure, chans *Chan
if !strings.HasPrefix(key, "magnet:?") { if !strings.HasPrefix(key, "magnet:?") {
err = helpers.DecodeTorrentFile(transferStruct.TorrentFilePath, &transferStruct.TorrentFileRaw) err = helpers.DecodeTorrentFile(transferStruct.TorrentFilePath, &transferStruct.TorrentFileRaw)
if err != nil { if err != nil {
chans.ErrChannel <- fmt.Sprintf("Can't decode torrent file %v for %v", transferStruct.TorrentFilePath, key) chans.ErrChannel <- fmt.Sprintf("Can't decode torrent file %v for torrent %v with error %v", transferStruct.TorrentFilePath, key, err)
return err return err
} }
} else { } else {

View File

@ -4,7 +4,7 @@ type Torrent struct {
Announce string `bencode:"announce"` Announce string `bencode:"announce"`
Comment string `bencode:"comment"` Comment string `bencode:"comment"`
CreatedBy string `bencode:"created by"` CreatedBy string `bencode:"created by"`
CreationDate int64 `bencode:"creation date"` CreationDate interface{} `bencode:"creation date"` // can't be string or int64
Info *TorrentInfo `bencode:"info"` Info *TorrentInfo `bencode:"info"`
Publisher string `bencode:"publisher,omitempty"` Publisher string `bencode:"publisher,omitempty"`
PublisherUrl string `bencode:"publisher-url,omitempty"` PublisherUrl string `bencode:"publisher-url,omitempty"`