Fix detection issues

This commit is contained in:
Ben Sarmiento
2024-02-18 04:15:41 +01:00
parent 02d900971d
commit 36298dd979
6 changed files with 63 additions and 67 deletions

View File

@@ -30,6 +30,7 @@ type ConfigInterface interface {
ShouldDeleteRarFiles() bool
GetDownloadsEveryMins() int
GetPlayableExtensions() []string
GetTorrentsCount() int
}
type ZurgConfig struct {
@@ -60,6 +61,7 @@ type ZurgConfig struct {
RetriesUntilFailed int `yaml:"retries_until_failed" json:"retries_until_failed"`
ServeFromRclone bool `yaml:"serve_from_rclone" json:"serve_from_rclone"`
Username string `yaml:"username" json:"username"`
TorrentsCount int `yaml:"get_torrents_count" json:"get_torrents_count"`
}
func (z *ZurgConfig) GetConfig() ZurgConfig {
@@ -201,3 +203,10 @@ func (z *ZurgConfig) GetPlayableExtensions() []string {
}
return z.PlayableExtensions
}
func (z *ZurgConfig) GetTorrentsCount() int {
if z.TorrentsCount == 0 {
return 100
}
return z.TorrentsCount
}