Merge pull request #274 from JonnyWong16/miscellaneous-fixes

Add more metadata options to notifications
This commit is contained in:
JonnyWong16 2015-11-09 19:16:08 -08:00
commit 2eed2d54ca
4 changed files with 42 additions and 15 deletions

View file

@ -938,10 +938,30 @@ available_notification_agents = sorted(notifiers.available_notification_agents()
<td width="150"><strong>{content_rating}</strong></td>
<td>The content rating for the media item. (e.g. TV-MA, TV-PG, etc.)</td>
</tr>
<tr>
<td width="150"><strong>{directors}</strong></td>
<td>A list of directors for the media item.</td>
</tr>
<tr>
<td width="150"><strong>{writers}</strong></td>
<td>A list of writers for the media item.</td>
</tr>
<tr>
<td width="150"><strong>{actors}</strong></td>
<td>A list of actors for the media item.</td>
</tr>
<tr>
<td width="150"><strong>{genres}</strong></td>
<td>A list of genres for the media item.</td>
</tr>
<tr>
<td width="150"><strong>{summary}</strong></td>
<td>A short plot summary for the media item.</td>
</tr>
<tr>
<td width="150"><strong>{tagline}</strong></td>
<td>A tagline for the media item.</td>
</tr>
<tr>
<td width="150"><strong>{rating}</strong></td>
<td>The rating (out of 10) for the item.</td>

View file

@ -404,7 +404,12 @@ def build_notify_text(session=None, timeline=None, state=None):
'year': metadata['year'],
'studio': metadata['studio'],
'content_rating': metadata['content_rating'],
'directors': ', '.join(metadata['directors']),
'writers': ', '.join(metadata['writers']),
'actors': ', '.join(metadata['actors']),
'genres': ', '.join(metadata['genres']),
'summary': metadata['summary'],
'tagline': metadata['tagline'],
'rating': metadata['rating'],
'duration': duration,
'stream_duration': stream_duration,

View file

@ -1418,10 +1418,10 @@ class IFTTT(object):
config_option = [{'label': 'Ifttt Maker Channel Key',
'value': self.apikey,
'name': 'ifttt_key',
'description': 'Your Ifttt key. You can get a key from here https://ifttt.com/maker',
'description': 'Your Ifttt key. You can get a key from <a href="https://ifttt.com/maker" target="_blank">here</a>.',
'input_type': 'text'
},
{'label': 'Ifttt event',
{'label': 'Ifttt Event',
'value': self.event,
'name': 'ifttt_event',
'description': 'The Ifttt maker event to fire. The notification subject and body will be sent'
@ -1490,13 +1490,13 @@ class TELEGRAM(object):
config_option = [{'label': 'Telegram Bot Token',
'value': self.bot_token,
'name': 'telegram_bot_token',
'description': 'Your bot token. Contact <a href="http://telegram.me/BotFather">@BotFather</a> on Telegram to get one.',
'description': 'Your Telegram bot token. Contact <a href="http://telegram.me/BotFather" target="_blank">@BotFather</a> on Telegram to get one.',
'input_type': 'text'
},
{'label': 'Telegram Chat ID',
'value': self.chat_id,
'name': 'telegram_chat_id',
'description': 'Your Telegram Chat ID or Group ID. Contact <a href="http://telegram.me/myidbot">@myidbot</a> on Telegram to get an ID.',
'description': 'Your Telegram Chat ID or Group ID. Contact <a href="http://telegram.me/myidbot" target="_blank">@myidbot</a> on Telegram to get an ID.',
'input_type': 'text'
}
]

View file

@ -413,9 +413,9 @@ class PmsConnect(object):
'parent_index': helpers.get_xml_attr(metadata_main, 'parentIndex'),
'parent_title': helpers.get_xml_attr(metadata_main, 'parentTitle'),
'index': helpers.get_xml_attr(metadata_main, 'index'),
'studio': helpers.get_xml_attr(metadata_main, 'studio'),
'studio': show_details['metadata']['studio'],
'title': helpers.get_xml_attr(metadata_main, 'title'),
'content_rating': helpers.get_xml_attr(metadata_main, 'contentRating'),
'content_rating': show_details['metadata']['content_rating'],
'summary': show_details['metadata']['summary'],
'tagline': helpers.get_xml_attr(metadata_main, 'tagline'),
'rating': helpers.get_xml_attr(metadata_main, 'rating'),
@ -430,13 +430,15 @@ class PmsConnect(object):
'updated_at': helpers.get_xml_attr(metadata_main, 'updatedAt'),
'last_viewed_at': helpers.get_xml_attr(metadata_main, 'lastViewedAt'),
'guid': helpers.get_xml_attr(metadata_main, 'guid'),
'genres': genres,
'actors': actors,
'writers': writers,
'directors': directors
'genres': show_details['metadata']['genres'],
'actors': show_details['metadata']['actors'],
'writers': show_details['metadata']['writers'],
'directors': show_details['metadata']['directors']
}
metadata_list = {'metadata': metadata}
elif metadata_type == 'episode':
grandparent_rating_key = helpers.get_xml_attr(metadata_main, 'grandparentRatingKey')
show_details = self.get_metadata_details(grandparent_rating_key)
metadata = {'media_type': metadata_type,
'rating_key': helpers.get_xml_attr(metadata_main, 'ratingKey'),
'parent_rating_key': helpers.get_xml_attr(metadata_main, 'parentRatingKey'),
@ -445,7 +447,7 @@ class PmsConnect(object):
'parent_index': helpers.get_xml_attr(metadata_main, 'parentIndex'),
'parent_title': helpers.get_xml_attr(metadata_main, 'parentTitle'),
'index': helpers.get_xml_attr(metadata_main, 'index'),
'studio': helpers.get_xml_attr(metadata_main, 'studio'),
'studio': show_details['metadata']['studio'],
'title': helpers.get_xml_attr(metadata_main, 'title'),
'content_rating': helpers.get_xml_attr(metadata_main, 'contentRating'),
'summary': helpers.get_xml_attr(metadata_main, 'summary'),
@ -462,10 +464,10 @@ class PmsConnect(object):
'updated_at': helpers.get_xml_attr(metadata_main, 'updatedAt'),
'last_viewed_at': helpers.get_xml_attr(metadata_main, 'lastViewedAt'),
'guid': helpers.get_xml_attr(metadata_main, 'guid'),
'genres': show_details['metadata']['genres'],
'actors': show_details['metadata']['actors'],
'writers': writers,
'directors': directors,
'genres': genres,
'actors': actors
'directors': directors
}
metadata_list = {'metadata': metadata}
elif metadata_type == 'movie':
@ -589,7 +591,7 @@ class PmsConnect(object):
'updated_at': helpers.get_xml_attr(metadata_main, 'updatedAt'),
'last_viewed_at': helpers.get_xml_attr(metadata_main, 'lastViewedAt'),
'guid': helpers.get_xml_attr(metadata_main, 'guid'),
'genres': genres,
'genres': album_details['metadata']['genres'],
'actors': actors,
'writers': writers,
'directors': directors