From e41bda56fe45d2489d3552fff6d5f9556ac086cd Mon Sep 17 00:00:00 2001 From: rumanzo Date: Mon, 25 Dec 2023 23:39:59 +0300 Subject: [PATCH] fix torrent structures for unusual torrents coding update go version better error printing yet another user notification --- Makefile | 2 +- bt2qbt.go | 3 ++- internal/transfer/resumeHandle.go | 4 ++-- pkg/torrentStructures/torrent.go | 2 +- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index f0301c2..ad710e6 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -gotag=1.21.4-bullseye +gotag=1.21.5-bullseye commit=$(shell git rev-parse HEAD) diff --git a/bt2qbt.go b/bt2qbt.go index dd49807..fcb749d 100644 --- a/bt2qbt.go +++ b/bt2qbt.go @@ -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.HiRed("Check that the qBittorrent is turned off and the directory %v and %v is backed up.\n", 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.Scanln() log.Println("Started") diff --git a/internal/transfer/resumeHandle.go b/internal/transfer/resumeHandle.go index 30e727b..2cbdd37 100644 --- a/internal/transfer/resumeHandle.go +++ b/internal/transfer/resumeHandle.go @@ -44,7 +44,7 @@ func HandleResumeItem(key string, transferStruct *TransferStructure, chans *Chan // struct for work with err = helpers.DecodeTorrentFile(transferStruct.TorrentFilePath, transferStruct.TorrentFile) 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 } @@ -52,7 +52,7 @@ func HandleResumeItem(key string, transferStruct *TransferStructure, chans *Chan if !strings.HasPrefix(key, "magnet:?") { err = helpers.DecodeTorrentFile(transferStruct.TorrentFilePath, &transferStruct.TorrentFileRaw) 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 } } else { diff --git a/pkg/torrentStructures/torrent.go b/pkg/torrentStructures/torrent.go index 4b2af7a..a92c69c 100644 --- a/pkg/torrentStructures/torrent.go +++ b/pkg/torrentStructures/torrent.go @@ -4,7 +4,7 @@ type Torrent struct { Announce string `bencode:"announce"` Comment string `bencode:"comment"` 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"` Publisher string `bencode:"publisher,omitempty"` PublisherUrl string `bencode:"publisher-url,omitempty"`