mirror of
https://github.com/oskvr37/tiddl.git
synced 2026-06-13 12:15:13 +03:00
🐛 Fix #195
This commit is contained in:
+5
-1
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user