Skip to content

Commit

Permalink
Use Addon instance from util so that there is just one Addon instance…
Browse files Browse the repository at this point in the history
…. Fixes issue with authorization not triggering a push server connect

Change the default settings for push handling to 'Show Notification'
  • Loading branch information
ruuk committed Oct 31, 2014
1 parent 462da29 commit c4784ae
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 10 deletions.
3 changes: 1 addition & 2 deletions lib/common.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import xbmc
import xbmcaddon
from util import * #TODO: Move util funtions to here

__addon__ = xbmcaddon.Addon()
__addon__ = ADDON
__addonid__ = __addon__.getAddonInfo('id')
__addonversion__ = __addon__.getAddonInfo('version')
__addonname__ = __addon__.getAddonInfo('name')
Expand Down
12 changes: 6 additions & 6 deletions resources/settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@
</category>
<category label="32107">
<setting label="32114" type="lsep"/>
<setting id="handling_video" label="32108" type="enum" lvalues="32115|32117|32118" default="0"/>
<setting id="handling_audio" label="32109" type="enum" lvalues="32115|32117|32118" default="0"/>
<setting id="handling_image" label="32110" type="enum" lvalues="32116|32117|32118" default="0"/>
<setting id="handling_note" label="32111" type="enum" lvalues="32116|32117|32118" default="0"/>
<setting id="handling_list" label="32112" type="enum" lvalues="32116|32117|32118" default="0"/>
<setting id="handling_address" label="32113" type="enum" lvalues="32116|32117|32118" default="0"/>
<setting id="handling_video" label="32108" type="enum" lvalues="32115|32117|32118" default="1"/>
<setting id="handling_audio" label="32109" type="enum" lvalues="32115|32117|32118" default="1"/>
<setting id="handling_image" label="32110" type="enum" lvalues="32116|32117|32118" default="1"/>
<setting id="handling_note" label="32111" type="enum" lvalues="32116|32117|32118" default="1"/>
<setting id="handling_list" label="32112" type="enum" lvalues="32116|32117|32118" default="1"/>
<setting id="handling_address" label="32113" type="enum" lvalues="32116|32117|32118" default="1"/>
<setting id="interrupt_media" label="32119" type="bool" default="false"/>
</category>
<category label="30001">
Expand Down
3 changes: 1 addition & 2 deletions service.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,7 @@ def run(self):
self.pushbullet = Pushbullet( access_token=self.stg_pbAccessToken,
ping_timeout=6,
last_modified=getSetting('last_modified',0),
last_modified_callback=self.setLastModified
)
last_modified_callback=self.setLastModified)

# get device info (also if edited by user on Pushbullet panel)
self._getDevice()
Expand Down

4 comments on commit c4784ae

@ruuk
Copy link
Collaborator Author

@ruuk ruuk commented on c4784ae Oct 31, 2014

Choose a reason for hiding this comment

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

Not exactly sure why this causes an issue, but apparently having 2 instances of xbmcaddon.Addon() causes problems. Until I merge the code from util into common, I just used the Addon instance from util.

As you can see I also made notifications the default instead of instant playing/showing, which seems more sensible. Let me know if you feel differently. ursli from the forum mentioned he was expecting notifiactions when I was helping him on IRC with this auth/connect issue and I agreed that made sense. I hadn't really thought about it when I added the settings.

@ruuk
Copy link
Collaborator Author

@ruuk ruuk commented on c4784ae Oct 31, 2014

Choose a reason for hiding this comment

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

I'm going to post this to my addon repository. If we don't find any new issues like this in the next few days then maybe I can push to the official repo.

@elbowz
Copy link
Owner

@elbowz elbowz commented on c4784ae Oct 31, 2014

Choose a reason for hiding this comment

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

Good catch!

For the default values If I understand well how it works, I prefer this settings:

<setting id="handling_video"   label="32108" type="enum" lvalues="32115|32117|32118" default="0"/>
<setting id="handling_audio"   label="32109" type="enum" lvalues="32115|32117|32118" default="0"/>
<setting id="handling_image"   label="32110" type="enum" lvalues="32116|32117|32118" default="0"/>
<setting id="handling_note"    label="32111" type="enum" lvalues="32116|32117|32118" default="1"/>
<setting id="handling_list"    label="32112" type="enum" lvalues="32116|32117|32118" default="1"/>
<setting id="handling_address" label="32113" type="enum" lvalues="32116|32117|32118" default="1"/>

With this settings, all I want send to stream to Xbmc (video, image, audio) are instantly showed/playbacked.
note/list/address I think are "message" from others people.

all of this...if I well understand. But you can set how do you prefer, this are the settings that I'll use :)

I hope the important bugs are ended!

@ruuk
Copy link
Collaborator Author

@ruuk ruuk commented on c4784ae Nov 1, 2014

Choose a reason for hiding this comment

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

With this settings, all I want send to stream to Xbmc (video, image, audio) are instantly showed/playbacked.
note/list/address I think are "message" from others people.

Perhaps I will change it to this. This is probably better.

I hope the important bugs are ended!

Me too.
I think we've fixed the major ones. Everything seems to be working well to me :)

Please sign in to comment.