Skip to content

Commit

Permalink
fix torrent structures for unusual torrents coding
Browse files Browse the repository at this point in the history
update go version
better error printing
yet another user notification
  • Loading branch information
rumanzo committed Dec 25, 2023
1 parent ee7cb09 commit e41bda5
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
gotag=1.21.4-bullseye
gotag=1.21.5-bullseye

commit=$(shell git rev-parse HEAD)

Expand Down
3 changes: 2 additions & 1 deletion bt2qbt.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
4 changes: 2 additions & 2 deletions internal/transfer/resumeHandle.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,15 @@ 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
}

// because hash of info very important it will be better to use interface for get hash
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 {
Expand Down
2 changes: 1 addition & 1 deletion pkg/torrentStructures/torrent.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
Expand Down

0 comments on commit e41bda5

Please sign in to comment.