diff --git a/.env.example b/.env.example deleted file mode 100644 index 305c9de..0000000 --- a/.env.example +++ /dev/null @@ -1,5 +0,0 @@ -JELLYFIN_ADDRESS= -JELLYFIN_USER= -JELLYFIN_PASSWORD= - -DISCORD_APP_ID= diff --git a/requirements.txt b/requirements.txt index 9535f0a..44ce05a 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,5 @@ jellyfin-apiclient-python==1.11.0 -python-dotenv==1.2.1 getmac==0.9.5 pypresence==4.6.1 pydantic==2.12.5 +pydantic-settings==2.12.0 diff --git a/settings.py b/settings.py new file mode 100644 index 0000000..d10937a --- /dev/null +++ b/settings.py @@ -0,0 +1,13 @@ +from pydantic import Field +from pydantic_settings import BaseSettings, SettingsConfigDict + +class Settings(BaseSettings): + jellyfin_server_url: str = Field(..., env="JELLYFIN_SERVER_URL") + jellyfin_username: str = Field(..., env="JELLYFIN_USERNAME") + jellyfin_password: str = Field(..., env="JELLYFIN_PASSWORD") + + discord_app_id: str = Field(..., env="DISCORD_APP_ID") + + model_config = SettingsConfigDict(env_file=".env", env_file_encoding="utf-8") + +settings = Settings()