Remove tests

This commit is contained in:
Ben Sarmiento
2023-10-24 22:19:43 +02:00
parent 2ce8273779
commit 37cd84d07b
2 changed files with 8 additions and 17 deletions

View File

@@ -30,7 +30,7 @@ type TorrentManager struct {
// and store them in-memory
func NewTorrentManager(config config.ConfigInterface, cache *expirable.LRU[string, string]) *TorrentManager {
t := &TorrentManager{
requiredVersion: "v2",
requiredVersion: "24.10.2023",
config: config,
cache: cache,
workerPool: make(chan bool, config.GetNumOfWorkers()),
@@ -95,11 +95,11 @@ func (t *TorrentManager) GetByDirectory(directory string) []Torrent {
}
// HideTheFile marks a file as deleted
func (t *TorrentManager) HideTheFile(torrent *Torrent, file *File) {
file.Link = ""
t.writeToFile(torrent)
t.repair(torrent.ID, []File{*file}, false)
}
// func (t *TorrentManager) HideTheFile(torrent *Torrent, file *File) {
// file.Link = ""
// t.writeToFile(torrent)
// t.repair(torrent.ID, []File{*file}, false)
// }
// FindAllTorrentsWithName finds all torrents in a given directory with a given name
func (t *TorrentManager) FindAllTorrentsWithName(directory, torrentName string) []Torrent {
@@ -253,16 +253,11 @@ func (t *TorrentManager) addMoreInfo(torrent *Torrent) {
// file cache
torrentFromFile := t.readFromFile(torrent.ID)
if torrentFromFile != nil {
fmt.Println("from file!")
// see if api data and file data still match
// then it means data is still usable
if len(torrentFromFile.Links) == len(torrent.Links) {
torrent.ForRepair = torrentFromFile.ForRepair
torrent.SelectedFiles = torrentFromFile.SelectedFiles[:]
if torrentFromFile.ID == "ABUNEKZP3UPMU" || torrentFromFile.ID == "TAA5WUJ6BVEAE" {
fmt.Println(">>>>>>>>>>>>>>>>", torrentFromFile.ID, len(torrentFromFile.Links), len(torrent.Links), len(torrent.SelectedFiles[0].Link))
torrent.Version = "v2"
}
return
}
}