Ignore renames
This commit is contained in:
@@ -16,8 +16,8 @@ concurrent_workers: 20
|
|||||||
# How often should we check Real-Debrid API for file changes?
|
# How often should we check Real-Debrid API for file changes?
|
||||||
check_for_changes_every_secs: 15
|
check_for_changes_every_secs: 15
|
||||||
|
|
||||||
# if true, you can rename directories and files; if false, saved rename info (if it exists) will be ignored
|
# if true, saved rename info (if it exists) will be ignored
|
||||||
allow_renames: true
|
ignore_renames: false
|
||||||
|
|
||||||
# if true, it will strictly follow Real-Debrid API filename property
|
# if true, it will strictly follow Real-Debrid API filename property
|
||||||
# setting to true should make zurg more compatible with rdt-client
|
# setting to true should make zurg more compatible with rdt-client
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ type ConfigInterface interface {
|
|||||||
GetNetworkBufferSize() int
|
GetNetworkBufferSize() int
|
||||||
EnableRetainFolderNameExtension() bool
|
EnableRetainFolderNameExtension() bool
|
||||||
EnableRetainRDTorrentName() bool
|
EnableRetainRDTorrentName() bool
|
||||||
ShouldAllowRenames() bool
|
ShouldIgnoreRenames() bool
|
||||||
GetRandomPreferredHost() string
|
GetRandomPreferredHost() string
|
||||||
ShouldServeFromRclone() bool
|
ShouldServeFromRclone() bool
|
||||||
ShouldVerifyDownloadLink() bool
|
ShouldVerifyDownloadLink() bool
|
||||||
@@ -42,7 +42,7 @@ type ZurgConfig struct {
|
|||||||
NumOfWorkers int `yaml:"concurrent_workers" json:"concurrent_workers"`
|
NumOfWorkers int `yaml:"concurrent_workers" json:"concurrent_workers"`
|
||||||
RefreshEverySeconds int `yaml:"check_for_changes_every_secs" json:"check_for_changes_every_secs"`
|
RefreshEverySeconds int `yaml:"check_for_changes_every_secs" json:"check_for_changes_every_secs"`
|
||||||
|
|
||||||
AllowRenames bool `yaml:"allow_renames" json:"allow_renames"`
|
IgnoreRenames bool `yaml:"ignore_renames" json:"ignore_renames"`
|
||||||
RetainRDTorrentName bool `yaml:"retain_rd_torrent_name" json:"retain_rd_torrent_name"`
|
RetainRDTorrentName bool `yaml:"retain_rd_torrent_name" json:"retain_rd_torrent_name"`
|
||||||
RetainFolderNameExtension bool `yaml:"retain_folder_name_extension" json:"retain_folder_name_extension"`
|
RetainFolderNameExtension bool `yaml:"retain_folder_name_extension" json:"retain_folder_name_extension"`
|
||||||
|
|
||||||
@@ -129,8 +129,8 @@ func (z *ZurgConfig) EnableRetainRDTorrentName() bool {
|
|||||||
return z.RetainRDTorrentName
|
return z.RetainRDTorrentName
|
||||||
}
|
}
|
||||||
|
|
||||||
func (z *ZurgConfig) ShouldAllowRenames() bool {
|
func (z *ZurgConfig) ShouldIgnoreRenames() bool {
|
||||||
return z.AllowRenames
|
return !z.IgnoreRenames
|
||||||
}
|
}
|
||||||
|
|
||||||
func (z *ZurgConfig) GetRandomPreferredHost() string {
|
func (z *ZurgConfig) GetRandomPreferredHost() string {
|
||||||
|
|||||||
@@ -175,7 +175,7 @@ func (t *TorrentManager) assignedDirectoryCb(tor *Torrent, cb func(string)) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (t *TorrentManager) GetKey(torrent *Torrent) string {
|
func (t *TorrentManager) GetKey(torrent *Torrent) string {
|
||||||
if t.Config.ShouldAllowRenames() && torrent.Rename != "" {
|
if !t.Config.ShouldIgnoreRenames() && torrent.Rename != "" {
|
||||||
return torrent.Rename
|
return torrent.Rename
|
||||||
}
|
}
|
||||||
if t.Config.EnableRetainRDTorrentName() {
|
if t.Config.EnableRetainRDTorrentName() {
|
||||||
|
|||||||
Reference in New Issue
Block a user