From 0880d20359db4b1ae314ba51108ef0101500020c Mon Sep 17 00:00:00 2001 From: Simon Date: Thu, 27 Jul 2023 22:38:49 +0700 Subject: [PATCH] refactor for docker build --- README.md | 4 ++-- main.py => app/main.py | 0 {src => app/src}/__init__.py | 0 {src => app/src}/config.py | 4 ++-- {src => app/src}/connect.py | 0 {src => app/src}/episode.py | 0 {src => app/src}/season.py | 0 {src => app/src}/series.py | 0 {src => app/src}/static_types.py | 0 9 files changed, 4 insertions(+), 4 deletions(-) rename main.py => app/main.py (100%) rename {src => app/src}/__init__.py (100%) rename {src => app/src}/config.py (91%) rename {src => app/src}/connect.py (100%) rename {src => app/src}/episode.py (100%) rename {src => app/src}/season.py (100%) rename {src => app/src}/series.py (100%) rename {src => app/src}/static_types.py (100%) diff --git a/README.md b/README.md index f77f9d6..e703b82 100644 --- a/README.md +++ b/README.md @@ -68,9 +68,9 @@ pip install -r requirements.txt - `jf_url`: Full URL where Jellyfin is reachable - `jf_token`: Jellyfin API token -Then run the script with python, e.g. +Then run the script from the main folder with python, e.g. ```python -python main.py +python app/main.py ``` ## Install with Docker diff --git a/main.py b/app/main.py similarity index 100% rename from main.py rename to app/main.py diff --git a/src/__init__.py b/app/src/__init__.py similarity index 100% rename from src/__init__.py rename to app/src/__init__.py diff --git a/src/config.py b/app/src/config.py similarity index 91% rename from src/config.py rename to app/src/config.py index 9951391..7a27663 100644 --- a/src/config.py +++ b/app/src/config.py @@ -20,8 +20,8 @@ def get_config() -> ConfigType: def get_config_file() -> ConfigType | Literal[False]: """read config file if available""" - if os.path.exists("config.json"): - with open("config.json", "r", encoding="utf-8") as f: + if os.path.exists("./config.json"): + with open("./config.json", "r", encoding="utf-8") as f: config_content: ConfigType = json.loads(f.read()) return config_content diff --git a/src/connect.py b/app/src/connect.py similarity index 100% rename from src/connect.py rename to app/src/connect.py diff --git a/src/episode.py b/app/src/episode.py similarity index 100% rename from src/episode.py rename to app/src/episode.py diff --git a/src/season.py b/app/src/season.py similarity index 100% rename from src/season.py rename to app/src/season.py diff --git a/src/series.py b/app/src/series.py similarity index 100% rename from src/series.py rename to app/src/series.py diff --git a/src/static_types.py b/app/src/static_types.py similarity index 100% rename from src/static_types.py rename to app/src/static_types.py