Set filenames properly
This commit is contained in:
@@ -110,9 +110,11 @@ func (t *TorrentManager) GetKey(torrent *Torrent) string {
|
||||
func (t *TorrentManager) GetPath(file *File) string {
|
||||
if t.Config.ShouldExposeFullPath() {
|
||||
filename := strings.TrimPrefix(file.Path, "/")
|
||||
return strings.ReplaceAll(filename, "/", " - ")
|
||||
filename = strings.ReplaceAll(filename, "/", " - ")
|
||||
return filename
|
||||
}
|
||||
return filepath.Base(file.Path)
|
||||
filename := filepath.Base(file.Path)
|
||||
return filename
|
||||
}
|
||||
|
||||
func (t *TorrentManager) writeTorrentToFile(instanceID string, torrent *Torrent) {
|
||||
|
||||
@@ -147,7 +147,6 @@ func (t *TorrentManager) getMoreInfo(rdTorrent realdebrid.Torrent) *Torrent {
|
||||
if torrentFromCache, exists := infoCache.Get(rdTorrent.ID); exists &&
|
||||
!torrentFromCache.AnyInProgress() &&
|
||||
torrentFromCache.SelectedFiles.Count() == len(rdTorrent.Links) {
|
||||
t.ResetSelectedFiles(torrentFromCache)
|
||||
return torrentFromCache
|
||||
}
|
||||
|
||||
@@ -165,6 +164,7 @@ func (t *TorrentManager) getMoreInfo(rdTorrent realdebrid.Torrent) *Torrent {
|
||||
|
||||
if !hasBrokenFiles {
|
||||
infoCache.Set(rdTorrent.ID, torrentFromFile)
|
||||
t.ResetSelectedFiles(torrentFromFile)
|
||||
return torrentFromFile
|
||||
} else {
|
||||
t.log.Warnf("Torrent %s has broken files, will not save on info cache", rdTorrent.ID)
|
||||
|
||||
Reference in New Issue
Block a user