Skip to content

Commit ae44a39

Browse files
fix: process albumprops file in root folder.
This commit fixes the error that previously albumprops files in the root path were only discovered and loaded, but the proprties weren't processed when building album models.
1 parent d26b4e3 commit ae44a39

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

immich_auto_album.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
"""Python script for creating albums in Immich from folder names in an external library."""
22

3+
# pylint: disable=too-many-lines
4+
35
from typing import Tuple
46
import argparse
57
import logging
@@ -529,7 +531,7 @@ def build_inheritance_chain_for_album_path(album_path: str, root_path: str, albu
529531
root_path = os.path.normpath(root_path)
530532

531533
# Walk up the directory tree until we reach the root path
532-
while current_path != root_path and len(current_path) > len(root_path):
534+
while len(current_path) >= len(root_path):
533535
albumprops_path = os.path.join(current_path, ALBUMPROPS_FILE_NAME)
534536

535537
if albumprops_path in albumprops_cache_param:
@@ -540,6 +542,10 @@ def build_inheritance_chain_for_album_path(album_path: str, root_path: str, albu
540542
if not album_model_local.inherit:
541543
break
542544

545+
# If we've reached the root path, stop
546+
if current_path == root_path:
547+
break
548+
543549
# Move up one directory level
544550
parent_path = os.path.dirname(current_path)
545551
if parent_path == current_path: # Reached filesystem root

0 commit comments

Comments
 (0)