This commit is contained in:
Mukhtar Akere
2024-11-23 21:10:42 +01:00
parent d2a77620bc
commit 2c9a076cd2
3 changed files with 6 additions and 4 deletions

View File

@@ -11,6 +11,7 @@ import (
"net/http"
gourl "net/url"
"os"
"path"
"slices"
"strconv"
"strings"
@@ -170,6 +171,10 @@ func (r *Torbox) GetTorrent(id string) (*Torrent, error) {
Size: f.Size,
}
}
if len(files) > 0 && name == data.Hash {
cleanPath := path.Clean(files[0].Name)
torrent.OriginalFilename = strings.Split(strings.TrimPrefix(cleanPath, "/"), "/")[0]
}
torrent.Files = files
torrent.Debrid = r
return torrent, nil