From ba3b8f0f025d7d001ed0d976e97007190cea934b Mon Sep 17 00:00:00 2001 From: nikk gitanes Date: Sat, 6 Jan 2024 02:54:39 +0300 Subject: [PATCH] don't allow remove torrents in readOnly DB mode --- server/torr/apihelper.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/server/torr/apihelper.go b/server/torr/apihelper.go index 1384ec0..247adc7 100644 --- a/server/torr/apihelper.go +++ b/server/torr/apihelper.go @@ -139,6 +139,9 @@ func SetTorrent(hashHex, title, poster, data string) *Torrent { } func RemTorrent(hashHex string) { + if sets.ReadOnly { + return + } hash := metainfo.NewHashFromHex(hashHex) if sets.BTsets.UseDisk && hashHex != "" && hashHex != "/" { name := filepath.Join(sets.BTsets.TorrentsSavePath, hashHex)