- Fix symlinks % bug
- A cleaner settings page - More bug fixes
This commit is contained in:
@@ -177,16 +177,17 @@ func (q *QBit) createSymlinksWebdav(debridTorrent *debrid.Torrent, rclonePath, t
|
||||
|
||||
// Check which files exist in this batch
|
||||
for _, entry := range entries {
|
||||
if file, exists := remainingFiles[entry.Name()]; exists {
|
||||
fullFilePath := filepath.Join(rclonePath, file.Name)
|
||||
filename := entry.Name()
|
||||
if file, exists := remainingFiles[filename]; exists {
|
||||
fullFilePath := filepath.Join(rclonePath, filename)
|
||||
fileSymlinkPath := filepath.Join(symlinkPath, file.Name)
|
||||
|
||||
if err := os.Symlink(fullFilePath, fileSymlinkPath); err != nil && !os.IsExist(err) {
|
||||
q.logger.Debug().Msgf("Failed to create symlink: %s: %v", fileSymlinkPath, err)
|
||||
} else {
|
||||
q.logger.Info().Msgf("File is ready: %s", file.Name)
|
||||
filePaths = append(filePaths, fileSymlinkPath)
|
||||
delete(remainingFiles, file.Name)
|
||||
delete(remainingFiles, filename)
|
||||
q.logger.Info().Msgf("File is ready: %s", file.Name)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -10,7 +10,7 @@ func (q *QBit) Routes() http.Handler {
|
||||
r.Use(q.CategoryContext)
|
||||
r.Group(func(r chi.Router) {
|
||||
r.Use(q.authContext)
|
||||
r.Post("/auth/login", q.handleLogin)
|
||||
r.Post("/register/login", q.handleLogin)
|
||||
r.Route("/torrents", func(r chi.Router) {
|
||||
r.Use(HashesCtx)
|
||||
r.Get("/info", q.handleTorrentsInfo)
|
||||
|
||||
@@ -250,7 +250,6 @@ func (ts *TorrentStorage) DeleteMultiple(hashes []string, removeFromDebrid bool)
|
||||
if dbClient == nil {
|
||||
continue
|
||||
}
|
||||
fmt.Println("Deleting torrent from debrid:", id)
|
||||
err := dbClient.DeleteTorrent(id)
|
||||
if err != nil {
|
||||
fmt.Println(err)
|
||||
|
||||
Reference in New Issue
Block a user