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

Add metadata key in card_item #4

Open
manu3b1 opened this issue Jul 22, 2023 · 0 comments
Open

Add metadata key in card_item #4

manu3b1 opened this issue Jul 22, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@manu3b1
Copy link

manu3b1 commented Jul 22, 2023

Now that Apple TV integration supports Deep Links, would be great to add metadata key in card_item as this is the only way go build a working Plex deep link, like this one:

- variables:
    serverId: "xxxxxxxxxxxxxxxx"
    episodes: "{{ state_attr('sensor.plex_recently_added', 'data') }}"
    key: "{{ episodes[1].key }}"
- service: media_player.play_media
  data:
    media_content_type: url
    media_content_id: plex://play/?metadataKey=%2Flibrary%2Fmetadata%2F{{key}}&metadataType=4&server={{serverId}}
  target:
    entity_id: media_player.mon_apple_tv

I've tested a patch in sensor.py that works well:

                 card_item = {}
                 if 'ratingKey' in media:
                     key = media['ratingKey']
+                    card_item['key'] = media.get('ratingKey', '')
                 else:
                     continue
                 if 'addedAt' in media:

The big interest of Plex deep links thru Apple TV media_player is that they are much more reliable than Plex media_player integration, where the connection between server and client is hazardous.

@manu3b1 manu3b1 added the enhancement New feature or request label Jul 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant