Add bin other torrent when torrent is completed
This commit is contained in:
@@ -209,7 +209,7 @@ func (t *TorrentManager) deleteTorrentFile(hash string) {
|
||||
/// info functions
|
||||
|
||||
func (t *TorrentManager) getInfoFiles() mapset.Set[string] {
|
||||
files, err := filepath.Glob("data/*.info_zurg")
|
||||
files, err := filepath.Glob("data/*.zurginfo")
|
||||
if err != nil {
|
||||
t.log.Warnf("Cannot get files in data directory: %v", err)
|
||||
return nil
|
||||
@@ -218,7 +218,7 @@ func (t *TorrentManager) getInfoFiles() mapset.Set[string] {
|
||||
}
|
||||
|
||||
func (t *TorrentManager) writeInfoToFile(info *realdebrid.TorrentInfo) {
|
||||
filePath := "data/" + info.ID + ".info_zurg"
|
||||
filePath := "data/" + info.ID + ".zurginfo"
|
||||
file, err := os.Create(filePath)
|
||||
if err != nil {
|
||||
t.log.Warnf("Cannot create info file %s: %v", filePath, err)
|
||||
@@ -241,7 +241,7 @@ func (t *TorrentManager) writeInfoToFile(info *realdebrid.TorrentInfo) {
|
||||
}
|
||||
|
||||
func (t *TorrentManager) readInfoFromFile(torrentID string) *realdebrid.TorrentInfo {
|
||||
filePath := "data/" + torrentID + ".info_zurg"
|
||||
filePath := "data/" + torrentID + ".zurginfo"
|
||||
file, err := os.Open(filePath)
|
||||
if err != nil {
|
||||
if os.IsNotExist(err) {
|
||||
@@ -262,7 +262,7 @@ func (t *TorrentManager) readInfoFromFile(torrentID string) *realdebrid.TorrentI
|
||||
}
|
||||
|
||||
func (t *TorrentManager) deleteInfoFile(torrentID string) {
|
||||
filePath := "data/" + torrentID + ".info_zurg"
|
||||
filePath := "data/" + torrentID + ".zurginfo"
|
||||
_ = os.Remove(filePath)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user