Add notification options for pmsupdate

This commit is contained in:
JonnyWong16 2016-06-25 18:41:33 -07:00
parent 984e5588c8
commit 32693b6378
2 changed files with 45 additions and 5 deletions

View file

@ -1984,8 +1984,40 @@
<td>The available update download URL.</td> <td>The available update download URL.</td>
</tr> </tr>
<tr> <tr>
<td><strong>{update_changelog}</strong></td> <td><strong>{update_release_date}</strong></td>
<td>The changelog for the available update.</td> <td>The release date of the update version.</td>
</tr>
<tr>
<td><strong>{update_channel}</strong></td>
<td>The update channel. <span class="small-muted">(Public or Plex Pass)</span></td>
</tr>
<tr>
<td><strong>{update_platform}</strong></td>
<td>The platform of your Plex Server.</td>
</tr>
<tr>
<td><strong>{update_distro}</strong></td>
<td>The distro of your Plex Server.</td>
</tr>
<tr>
<td><strong>{update_distro_build}</strong></td>
<td>The distro build of your Plex Server.</td>
</tr>
<tr>
<td><strong>{update_requirements}</strong></td>
<td>The requirements for the available update.</td>
</tr>
<tr>
<td><strong>{update_extra_info}</strong></td>
<td>Any extra info for the available update.</td>
</tr>
<tr>
<td><strong>{update_changelog_added}</strong></td>
<td>The added changelog for the available update.</td>
</tr>
<tr>
<td><strong>{update_changelog_fixed}</strong></td>
<td>The fixed changelog for the available update.</td>
</tr> </tr>
</tbody> </tbody>
</table> </table>

View file

@ -961,8 +961,7 @@ def build_server_notify_text(notify_action=None, agent_id=None):
update_status = {} update_status = {}
if notify_action == 'pmsupdate': if notify_action == 'pmsupdate':
pms_connect = pmsconnect.PmsConnect() update_status = plex_tv.get_plex_downloads()
update_status = pms_connect.get_update_staus()
if server_times: if server_times:
updated_at = server_times['updated_at'] updated_at = server_times['updated_at']
@ -995,7 +994,16 @@ def build_server_notify_text(notify_action=None, agent_id=None):
# Update parameters # Update parameters
'update_version': update_status.get('version',''), 'update_version': update_status.get('version',''),
'update_url': update_status.get('download_url',''), 'update_url': update_status.get('download_url',''),
'update_changelog': update_status.get('changelog','')} 'update_release_date': arrow.get(update_status.get('release_date','')).format(date_format)
if update_status.get('release_date','') else '',
'update_channel': 'Plex Pass' if plexpy.CONFIG.PMS_UPDATE_CHANNEL == 'plexpass' else 'Public',
'update_platform': update_status.get('platform',''),
'update_distro': update_status.get('distro',''),
'update_distro_build': update_status.get('build',''),
'update_requirements': update_status.get('requirements',''),
'update_extra_info': update_status.get('extra_info',''),
'update_changelog_added': update_status.get('changelog_added',''),
'update_changelog_fixed': update_status.get('changelog_fixed','')}
# Default text # Default text
subject_text = 'PlexPy (%s)' % server_name subject_text = 'PlexPy (%s)' % server_name