diff --git a/README.md b/README.md index 3eda618..b92078f 100644 --- a/README.md +++ b/README.md @@ -37,8 +37,8 @@ Optional environment variables: - `ALBUM_SEPARATOR`: Separator for `relative` mode; defaults to ` - ` - `PAGE_SIZE`: Immich search page size; defaults to `1000` - `DRY_RUN`: Set to `true` to log planned work without changing albums -- `SYNC_INTERVAL_SECONDS`: Delay between runs; `0` runs once and exits. - Docker Compose defaults to `1800` seconds (30 minutes) +- `SYNC_INTERVAL_SECONDS`: Delay between runs; defaults to `1800` seconds + (30 minutes). Set it to `0` for a single run Run the script after Immich has scanned the external library: diff --git a/src/main.py b/src/main.py index b3945b7..2e577d4 100644 --- a/src/main.py +++ b/src/main.py @@ -33,7 +33,7 @@ ALBUM_SEPARATOR = os.environ.get("ALBUM_SEPARATOR", " - ") PAGE_SIZE = int(os.environ.get("PAGE_SIZE", "1000")) DRY_RUN = os.environ.get("DRY_RUN", "false").lower() == "true" SYNC_INTERVAL_SECONDS = int( - os.environ.get("SYNC_INTERVAL_SECONDS", "0") + os.environ.get("SYNC_INTERVAL_SECONDS", "1800") ) logging.basicConfig( diff --git a/tests/test_main.py b/tests/test_main.py index 7f24871..4abd27d 100644 --- a/tests/test_main.py +++ b/tests/test_main.py @@ -142,6 +142,10 @@ class SynchronizationTests(unittest.TestCase): album_sync, "ALBUM_MODE", "root", + ), patch.object( + album_sync, + "SYNC_INTERVAL_SECONDS", + 0, ), patch.object( album_sync, "check_configuration",