Fix AllDebrid symlink bug

This commit is contained in:
Mukhtar Akere
2025-01-19 08:56:52 +01:00
parent a986c4b5d0
commit cfb0051b04
6 changed files with 36 additions and 24 deletions
+7 -1
View File
@@ -248,5 +248,11 @@ func (u *uiHandler) handleDeleteTorrent(w http.ResponseWriter, r *http.Request)
func (u *uiHandler) handleGetConfig(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Content-Type", "application/json")
common.JSONResponse(w, common.CONFIG, http.StatusOK)
config := common.CONFIG
arrCfgs := make([]common.ArrConfig, 0)
for _, a := range u.qbit.Arrs.GetAll() {
arrCfgs = append(arrCfgs, common.ArrConfig{Host: a.Host, Name: a.Name, Token: a.Token})
}
config.Arrs = arrCfgs
common.JSONResponse(w, config, http.StatusOK)
}
+1 -1
View File
@@ -110,7 +110,7 @@ func (q *QBit) createSymLink(path string, torrentMountPath string, file debrid.T
// Combine the directory and filename to form a full path
fullPath := filepath.Join(path, file.Name) // /mnt/symlinks/{category}/MyTVShow/MyTVShow.S01E01.720p.mkv
// Create a symbolic link if file doesn't exist
torrentFilePath := filepath.Join(torrentMountPath, file.Name) // debridFolder/MyTVShow/MyTVShow.S01E01.720p.mkv
torrentFilePath := filepath.Join(torrentMountPath, file.Path) // debridFolder/MyTVShow/MyTVShow.S01E01.720p.mkv
err := os.Symlink(torrentFilePath, fullPath)
if err != nil {
q.logger.Info().Msgf("Failed to create symlink: %s: %v", fullPath, err)