diff --git a/Common/Immich Album Watcher/blueprint.yaml b/Common/Immich Album Watcher/blueprint.yaml index d2aa6ec..d28d9db 100644 --- a/Common/Immich Album Watcher/blueprint.yaml +++ b/Common/Immich Album Watcher/blueprint.yaml @@ -863,10 +863,13 @@ variables: {% endif %} # Filter assets based on track_images/track_videos settings + # Videos are excluded if they don't have a playback URL filtered_assets: > {% set ns = namespace(assets = []) %} {% for asset in event_added_assets %} - {% if (asset.type == 'IMAGE' and track_images) or (asset.type == 'VIDEO' and track_videos) %} + {% if asset.type == 'IMAGE' and track_images %} + {% set ns.assets = ns.assets + [asset] %} + {% elif asset.type == 'VIDEO' and track_videos and (asset.playback_url | default('') | length > 0) %} {% set ns.assets = ns.assets + [asset] %} {% endif %} {% endfor %} @@ -1219,8 +1222,17 @@ action: entity_id: "{{ current_album_entity }}" data: "{{ get_assets_data }}" + # Filter out videos without playback URL - variables: - fetched_assets: "{{ fetched_assets_response[current_album_entity].assets | default([]) }}" + fetched_assets: > + {% set raw_assets = fetched_assets_response[current_album_entity].assets | default([]) %} + {% set ns = namespace(assets = []) %} + {% for asset in raw_assets %} + {% if asset.type == 'IMAGE' or (asset.type == 'VIDEO' and (asset.playback_url | default('') | length > 0)) %} + {% set ns.assets = ns.assets + [asset] %} + {% endif %} + {% endfor %} + {{ ns.assets }} fetched_asset_count: "{{ fetched_assets | length }}" # Only send notification if we got assets @@ -1442,8 +1454,17 @@ action: entity_id: "{{ repeat.item }}" data: "{{ combined_get_assets_data }}" + # Filter out videos without playback URL - variables: - album_assets: "{{ combined_fetch_response[repeat.item].assets | default([]) }}" + album_assets: > + {% set raw_assets = combined_fetch_response[repeat.item].assets | default([]) %} + {% set ns = namespace(assets = []) %} + {% for asset in raw_assets %} + {% if asset.type == 'IMAGE' or (asset.type == 'VIDEO' and (asset.playback_url | default('') | length > 0)) %} + {% set ns.assets = ns.assets + [asset] %} + {% endif %} + {% endfor %} + {{ ns.assets }} all_fetched_assets: "{{ all_fetched_assets + album_assets }}" - variables: diff --git a/manifest.json b/manifest.json index 1309f47..3371de3 100644 --- a/manifest.json +++ b/manifest.json @@ -1,3 +1,3 @@ { - "version": "1.22.6" + "version": "1.22.7" }