Сделал пароль qBittorrent опциональным (config)

qBittorrent может работать без аутентификации (обход авторизации для
доверенной подсети) — пустой пароль валиден.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
av
2026-06-29 12:25:14 +03:00
co-authored by Claude Opus 4.8
parent 4fc8c41b3a
commit 783664622c
2 changed files with 14 additions and 6 deletions
+11 -1
View File
@@ -33,6 +33,17 @@ func TestValidate_OK(t *testing.T) {
}
}
// TestValidate_NoQBittorrentPassword — пустой пароль qBittorrent валиден:
// клиент может работать без аутентификации (обход авторизации для доверенной
// подсети).
func TestValidate_NoQBittorrentPassword(t *testing.T) {
c := validCfg(t)
c.QBittorrent.Password = ""
if err := c.validate(); err != nil {
t.Fatalf("пустой пароль qBittorrent должен быть валиден, got %v", err)
}
}
// TestValidate_KeylessLocalLLM — keyless-local LLM (задан base_url, пустой
// api_key, напр. LM Studio) — валиден: ключ не обязателен.
func TestValidate_KeylessLocalLLM(t *testing.T) {
@@ -51,7 +62,6 @@ func TestValidate_Errors(t *testing.T) {
want string
}{
{"empty qbittorrent.url", func(c *Config) { c.QBittorrent.URL = "" }, "qbittorrent.url"},
{"empty qbittorrent.password", func(c *Config) { c.QBittorrent.Password = "" }, "qbittorrent.password"},
{"empty db_path", func(c *Config) { c.Storage.DBPath = "" }, "storage.db_path"},
{"bad llm.type", func(c *Config) { c.LLM.Type = "anthropic" }, "llm.type"},
{"relative movies", func(c *Config) { c.Paths.Movies = "movies" }, "absolute"},