Hotfix
This commit is contained in:
@@ -11,6 +11,7 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
gourl "net/url"
|
gourl "net/url"
|
||||||
"os"
|
"os"
|
||||||
|
"path"
|
||||||
"slices"
|
"slices"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
@@ -170,6 +171,10 @@ func (r *Torbox) GetTorrent(id string) (*Torrent, error) {
|
|||||||
Size: f.Size,
|
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.Files = files
|
||||||
torrent.Debrid = r
|
torrent.Debrid = r
|
||||||
return torrent, nil
|
return torrent, nil
|
||||||
|
|||||||
@@ -57,12 +57,11 @@ func (t *Torrent) GetSymlinkFolder(parent string) string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (t *Torrent) GetMountFolder(rClonePath string) string {
|
func (t *Torrent) GetMountFolder(rClonePath string) string {
|
||||||
pathWithNoExt := common.RemoveExtension(t.OriginalFilename)
|
|
||||||
if common.FileReady(filepath.Join(rClonePath, t.OriginalFilename)) {
|
if common.FileReady(filepath.Join(rClonePath, t.OriginalFilename)) {
|
||||||
return t.OriginalFilename
|
return t.OriginalFilename
|
||||||
} else if common.FileReady(filepath.Join(rClonePath, t.Filename)) {
|
} else if common.FileReady(filepath.Join(rClonePath, t.Filename)) {
|
||||||
return t.Filename
|
return t.Filename
|
||||||
} else if common.FileReady(filepath.Join(rClonePath, pathWithNoExt)) {
|
} else if pathWithNoExt := common.RemoveExtension(t.OriginalFilename); common.FileReady(filepath.Join(rClonePath, pathWithNoExt)) {
|
||||||
return pathWithNoExt
|
return pathWithNoExt
|
||||||
} else {
|
} else {
|
||||||
return ""
|
return ""
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ import (
|
|||||||
"goBlack/common"
|
"goBlack/common"
|
||||||
"goBlack/pkg/debrid"
|
"goBlack/pkg/debrid"
|
||||||
"goBlack/pkg/qbit/downloaders"
|
"goBlack/pkg/qbit/downloaders"
|
||||||
"log"
|
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"sync"
|
"sync"
|
||||||
@@ -60,7 +59,6 @@ func (q *QBit) processSymlink(torrent *Torrent, debridTorrent *debrid.Torrent, a
|
|||||||
|
|
||||||
q.logger.Printf("Checking %d files...", len(files))
|
q.logger.Printf("Checking %d files...", len(files))
|
||||||
rCloneBase := debridTorrent.Debrid.GetMountPath()
|
rCloneBase := debridTorrent.Debrid.GetMountPath()
|
||||||
log.Println("Rclone base:", rCloneBase)
|
|
||||||
torrentPath, err := q.getTorrentPath(rCloneBase, debridTorrent) // /MyTVShow/
|
torrentPath, err := q.getTorrentPath(rCloneBase, debridTorrent) // /MyTVShow/
|
||||||
if err != nil {
|
if err != nil {
|
||||||
q.MarkAsFailed(torrent)
|
q.MarkAsFailed(torrent)
|
||||||
|
|||||||
Reference in New Issue
Block a user