Skip videos without playback URL

Videos without a playback_url are now filtered out in all contexts:
- Realtime event notifications
- Scheduled assets (per_album/random mode)
- Scheduled assets (combined mode)

This prevents sending video entries that cannot be played back.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-02-01 21:13:44 +03:00
parent f86839dab4
commit 330026a44a
2 changed files with 25 additions and 4 deletions

View File

@@ -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:

View File

@@ -1,3 +1,3 @@
{
"version": "1.22.6"
"version": "1.22.7"
}