From e8112a4647dad7ddadb29a716b70e7f1395e5a84 Mon Sep 17 00:00:00 2001 From: Mukhtar Akere Date: Sat, 26 Apr 2025 21:13:09 +0100 Subject: [PATCH] hotfix --- pkg/debrid/debrid/cache.go | 5 +++-- pkg/web/api.go | 3 +++ pkg/web/templates/config.html | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/pkg/debrid/debrid/cache.go b/pkg/debrid/debrid/cache.go index aa0f727..e8c817e 100644 --- a/pkg/debrid/debrid/cache.go +++ b/pkg/debrid/debrid/cache.go @@ -117,7 +117,7 @@ func New(dc config.Debrid, client types.Client) *Cache { } return &Cache{ dir: filepath.Join(cfg.Path, "cache", dc.Name), // path to save cache files - torrents: xsync.NewMapOf[string, *CachedTorrent](), + torrents: xsync.NewMapOf[string, string](), torrentsNames: xsync.NewMapOf[string, *CachedTorrent](), invalidDownloadLinks: xsync.NewMapOf[string, string](), client: client, @@ -644,11 +644,12 @@ func (c *Cache) deleteTorrent(id string, removeFromDebrid bool) bool { } }() // defer delete from debrid - if t, ok := c.torrentsNames.Load(torrentName); ok { + if t, ok := c.torrentsNames.Load(torrentName); ok && t.Id == id { newFiles := map[string]types.File{} newId := t.Id for _, file := range t.Files { if file.TorrentId != "" && file.TorrentId != id { + newId = file.TorrentId newFiles[file.Name] = file } } diff --git a/pkg/web/api.go b/pkg/web/api.go index db14ec3..1ff9839 100644 --- a/pkg/web/api.go +++ b/pkg/web/api.go @@ -221,7 +221,10 @@ func (ui *Handler) handleUpdateConfig(w http.ResponseWriter, r *http.Request) { if len(updatedConfig.Debrids) > 0 { currentConfig.Debrids = updatedConfig.Debrids // Clear legacy single debrid if using array + } + if len(updatedConfig.Arrs) > 0 { + currentConfig.Arrs = updatedConfig.Arrs } // Update Arrs through the service diff --git a/pkg/web/templates/config.html b/pkg/web/templates/config.html index b3c244e..f0ee00c 100644 --- a/pkg/web/templates/config.html +++ b/pkg/web/templates/config.html @@ -221,7 +221,7 @@
-
+