Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple Root Path Handling #54

Merged
merged 2 commits into from
Sep 22, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions immich_auto_album.py
Original file line number Diff line number Diff line change
Expand Up @@ -483,14 +483,17 @@ def is_asset_ignored(asset: dict) -> bool:
True if the asset must be ignored, otherwise False
"""
is_asset_ignored = False
asset_root_path = None
asset_path = asset['originalPath']
for root_path in root_paths:
if root_path not in asset_path:
is_asset_ignored = True

if root_path in asset_path:
asset_root_path = root_path
break
logging.debug("Identified root_path for asset %s = %s", asset_path, asset_root_path)
if asset_root_path:
# First apply filter, if any
if path_filter:
if not re.fullmatch(path_filter_regex, asset_path.replace(root_path, '')):
if not re.fullmatch(path_filter_regex, asset_path.replace(asset_root_path, '')):
logging.debug("Ignoring asset %s due to path_filter setting!", asset_path)
is_asset_ignored = True
# Check ignore_albums
Expand Down