This commit is contained in:
Oskar Dudziński
2025-11-08 23:19:57 +01:00
committed by GitHub
parent 75572bb043
commit cd454a4220
+5 -1
View File
@@ -1,6 +1,6 @@
from logging import getLogger
from pathlib import Path
from pydantic import BaseModel
from pydantic import BaseModel, field_validator
from tomllib import loads as parse_toml
from typing import Literal
@@ -60,6 +60,10 @@ class Config(BaseModel):
self.download_path = self.download_path.expanduser().resolve()
self.scan_path = self.scan_path.expanduser().resolve()
@field_validator("download_path", "scan_path", mode="before")
def str_to_path(cls, v):
return Path(v) if isinstance(v, str) else v
download: DownloadConfig = DownloadConfig()
class M3UConfig(BaseModel):