Set filenames properly

This commit is contained in:
Ben Sarmiento
2024-01-28 03:48:53 +01:00
parent 3d9ad6a791
commit 00e4f8013c
3 changed files with 9 additions and 7 deletions

View File

@@ -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) {