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:
@@ -863,10 +863,13 @@ variables:
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
# Filter assets based on track_images/track_videos settings
|
# Filter assets based on track_images/track_videos settings
|
||||||
|
# Videos are excluded if they don't have a playback URL
|
||||||
filtered_assets: >
|
filtered_assets: >
|
||||||
{% set ns = namespace(assets = []) %}
|
{% set ns = namespace(assets = []) %}
|
||||||
{% for asset in event_added_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] %}
|
{% set ns.assets = ns.assets + [asset] %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
@@ -1219,8 +1222,17 @@ action:
|
|||||||
entity_id: "{{ current_album_entity }}"
|
entity_id: "{{ current_album_entity }}"
|
||||||
data: "{{ get_assets_data }}"
|
data: "{{ get_assets_data }}"
|
||||||
|
|
||||||
|
# Filter out videos without playback URL
|
||||||
- variables:
|
- 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 }}"
|
fetched_asset_count: "{{ fetched_assets | length }}"
|
||||||
|
|
||||||
# Only send notification if we got assets
|
# Only send notification if we got assets
|
||||||
@@ -1442,8 +1454,17 @@ action:
|
|||||||
entity_id: "{{ repeat.item }}"
|
entity_id: "{{ repeat.item }}"
|
||||||
data: "{{ combined_get_assets_data }}"
|
data: "{{ combined_get_assets_data }}"
|
||||||
|
|
||||||
|
# Filter out videos without playback URL
|
||||||
- variables:
|
- 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 }}"
|
all_fetched_assets: "{{ all_fetched_assets + album_assets }}"
|
||||||
|
|
||||||
- variables:
|
- variables:
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
{
|
{
|
||||||
"version": "1.22.6"
|
"version": "1.22.7"
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user