diff --git a/main.py b/main.py index 5eb1124..b50bbeb 100644 --- a/main.py +++ b/main.py @@ -15,7 +15,6 @@ import hashlib import settings -NAVIDROME_CONTAINER = getattr(settings, 'NAVIDROME_CONTAINER', 'navidrome-navidrome-1') STAR_UNSTAR_WINDOW = timedelta(seconds=4) # A dictionary to store the timestamp of when a song was starred. @@ -101,9 +100,9 @@ async def main(): docker = None try: docker = aiodocker.Docker() - container = await docker.containers.get(NAVIDROME_CONTAINER) + container = await docker.containers.get(settings.NAVIDROME_CONTAINER) - logging.info(f"Monitoring logs for container '{NAVIDROME_CONTAINER}'...") + logging.info(f"Monitoring logs for container '{settings.NAVIDROME_CONTAINER}'...") logs = container.log( stdout=True, stderr=True, @@ -132,7 +131,7 @@ async def main(): except aiodocker.exceptions.DockerError as e: if e.status == 404: - logging.error(f"Container '{NAVIDROME_CONTAINER}' not found.") + logging.error(f"Container '{settings.NAVIDROME_CONTAINER}' not found.") else: logging.error(f"Error connecting to Docker or getting container: {e}") except Exception as e: diff --git a/settings.py.example b/settings.py.example new file mode 100644 index 0000000..3743d7d --- /dev/null +++ b/settings.py.example @@ -0,0 +1,11 @@ +NAVIDROME_CONTAINER = 'navidrome-navidrome-1' +NAVIDROME_URL = 'https://navidrome.example.com' + +NAVIDROME_USER = '' + +# Set this one: +NAVIDROME_PASSWORD = '' +# or these two: +SUBSONIC_SALT = '' +SUBSONIC_TOKEN = '' +