don't allow remove torrents in readOnly DB mode

This commit is contained in:
nikk gitanes
2024-01-06 02:54:39 +03:00
parent 2aaed8cdb2
commit ba3b8f0f02

View File

@@ -139,6 +139,9 @@ func SetTorrent(hashHex, title, poster, data string) *Torrent {
} }
func RemTorrent(hashHex string) { func RemTorrent(hashHex string) {
if sets.ReadOnly {
return
}
hash := metainfo.NewHashFromHex(hashHex) hash := metainfo.NewHashFromHex(hashHex)
if sets.BTsets.UseDisk && hashHex != "" && hashHex != "/" { if sets.BTsets.UseDisk && hashHex != "" && hashHex != "/" {
name := filepath.Join(sets.BTsets.TorrentsSavePath, hashHex) name := filepath.Join(sets.BTsets.TorrentsSavePath, hashHex)