Skip to content

Commit

Permalink
option to auto upvote and refactor listener
Browse files Browse the repository at this point in the history
  • Loading branch information
siku2 committed Mar 4, 2020
1 parent 5553e73 commit 3ed4daa
Show file tree
Hide file tree
Showing 8 changed files with 383 additions and 301 deletions.
1 change: 1 addition & 0 deletions addon.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ Users submit when a sponsor happens and the add-on automatically skips sponsors
<disclaimer lang="en_GB">This is an unoffical port of the SponsorBlock browser extension</disclaimer>
<news>
[0.1.1]
- Added option to automatically upvote a sponsor segment
- Fix Kodi's player reporting an inaccurate time after seeking.
- Fix "Sponsor Skip Count Tracking" reporting

Expand Down
18 changes: 11 additions & 7 deletions resources/language/resource.language.en_gb/strings.po
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ msgstr ""
"Language: en\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"

# next number: 32012
# next number: 32013


# SETTINGS
Expand All @@ -30,29 +30,33 @@ msgctxt "#32011"
msgid "Enable Sponsor Skip Count Tracking"
msgstr ""

msgctxt "#32012"
msgid "Auto Upvote"
msgstr ""

# api category

msgctxt "#32007"
msgid "API"
msgstr ""

msgctxt "#32003"
msgid "User ID"
msgstr ""

msgctxt "#32002"
msgid "Server Domain"
msgstr ""

msgctxt "#32003"
msgid "User ID"
msgstr ""


# NOTIFICATIONS

msgctxt "#32004"
msgid "Failed to report sponsor segment"
msgid "Failed to submit vote"
msgstr ""

msgctxt "#32005"
msgid "Reported sponsor segment"
msgid "Submitted vote"
msgstr ""


Expand Down
8 changes: 6 additions & 2 deletions resources/lib/gui/sponsor_skipped.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,19 @@ class SponsorSkipped(xbmcgui.WindowXMLDialog):
def __init__(self, *args, **kwargs):
self._on_unskip = kwargs.pop("on_unskip") # type: Callable[[], None]
self._on_report = kwargs.pop("on_report") # type: Callable[[], None]
self._on_expire = kwargs.pop("on_expire") # type: Callable[[], None]

self.__closed = False
self.__close_in = AUTO_CLOSE_TIME

super(SponsorSkipped, self).__init__(*args, **kwargs)

@classmethod
def display(cls, on_unskip, on_report):
def display(cls, on_unskip, on_report, on_expire):
inst = cls("sponsor_skipped.xml", addon.ADDON_PATH, addon.DEFAULT_SKIN, addon.DEFAULT_SKIN_RESOLUTION,
on_unskip=on_unskip,
on_report=on_report)
on_report=on_report,
on_expire=on_expire)
inst.doModal()

@classmethod
Expand All @@ -47,6 +50,7 @@ def __closer(self):

logger.debug("automatically closing window")
self.close()
self._on_expire()

def onInit(self): # type: () -> None
self.__closer()
Expand Down
Loading

0 comments on commit 3ed4daa

Please sign in to comment.