Skip to content

Allow the sending of the prowl url parameter#1314

Merged
liiight merged 3 commits intoFlexget:developfrom
m-hume:patch-1
Aug 7, 2016
Merged

Allow the sending of the prowl url parameter#1314
liiight merged 3 commits intoFlexget:developfrom
m-hume:patch-1

Conversation

@m-hume
Copy link
Copy Markdown
Contributor

@m-hume m-hume commented Aug 7, 2016

Motivation for changes:

Allow the sending of the url parameter in prowl notifications

Detailed changes:

This alteration allows the prowl message to link to a user defined url
Such as the imdb page for a movie

    prowl:
      apikey: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
      event: 'New movie'
      description: '{{title}}'
      url: '{{imdb_url}}'

Or for the more tech savy a custom page that deals with the torrent

    prowl:
      apikey: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
      event: 'New movie'
      description: '{{title}}'
      url: 'https://myserver.com/ctrl/{{torrent_info_hash}}'

Addressed issues:

n/a

Config usage if relevant (new plugin or updated schema):

    prowl:
      apikey: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
      event: 'New movie'
      description: '{{title}}'
      url: '{{imdb_url}}'

Log and/or tests output (preferably both):

paste output here

This alteration allows the prowl message to link to a user defined url
Such as the imdb page for a movie
```    prowl:
      apikey: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
      event: 'New movie'
      description: '{{title}}'
      url: '{{imdb_url}}'```

Or for the more tech savy a custom page that deals with the torrent
```    prowl:
      apikey: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
      event: 'New movie'
      description: '{{title}}'
      url: 'https://myserver.com/ctrl/{{torrent_info_hash}}'```
try:
message_url = entry.render(message_url)
except RenderError as e:
log.error('Error rendering jinja url: %s' % e)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You need to supply a default for message_url or it'll crash when you try to send if a RenderError as occured.

event = entry.get('event', config['event'])
priority = entry.get('priority', config['priority'])
description = config.get('description', entry['title'])
message_url = config.get('url', '')
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should set a default blank url!?

try:
message_url = entry.render(message_url)
except RenderError as e:
message_url = ''
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@liiight liiight merged commit 90f9f8e into Flexget:develop Aug 7, 2016
@m-hume m-hume deleted the patch-1 branch August 7, 2016 13:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants