-
Notifications
You must be signed in to change notification settings - Fork 447
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[plugin.video.mlbtv@matrix] 2020.10.8+matrix.1 #3157
Conversation
Travis tests were successfulHey @eracknaphobia, |
|
||
#Settings | ||
settings = xbmcaddon.Addon(id='plugin.video.mlbtv') | ||
USERNAME = str(settings.getSetting(id="username")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just for future reference, the preference is to use the newer settings calls (like getSettingString(id), getSettingBool(id), getSettingInt(id), and getSettingNumber(id)). More info at:
https://codedocs.xyz/xbmc/xbmc/group__python__xbmcaddon.html
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it, will add it now so it's ready for the next pr. Thanks for the review @pkscout!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since the pr is already merged please take these comments into account for the next version
if game_day != '': | ||
msg = "The date entered is not in the format required." | ||
dialog = xbmcgui.Dialog() | ||
dialog.ok('Invalid Date', msg) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Localisation needed
account = Account() | ||
account.logout() | ||
dialog = xbmcgui.Dialog() | ||
title = "Logout Successful" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Localisation needed
username = '' | ||
password = '' | ||
session_key = '' | ||
icon = os.path.join(addon.getAddonInfo('path'), 'icon.png') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can get "icon" from getAddonInfo directly
# Check if username and password are provided | ||
if self.username == '': | ||
dialog = xbmcgui.Dialog() | ||
self.username = dialog.input('Please enter your username', type=xbmcgui.INPUT_ALPHANUM) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Localisation needed
if self.password == '': | ||
dialog = xbmcgui.Dialog() | ||
self.password = dialog.input('Please enter your password', type=xbmcgui.INPUT_ALPHANUM, | ||
option=xbmcgui.ALPHANUM_HIDE_INPUT) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same
|
||
|
||
class Util: | ||
addon_path = xbmc.translatePath(xbmcaddon.Addon().getAddonInfo('profile')) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Xbmcvfs for matrix ++
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In order to take advantage of cross compatibility between python 2 and 3 wouldn't it make more sense to keep this as is so that I only have to keep one master branch that can work on both versions kodi?
Same with using str(settings.getSetting(id="username"))
instead of settings.getSettingStrinng(id="username")
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+/-, the problem here is that we warn in matrix if you use the xbmc method
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for translatePath, I've went with
try:
xbmc.translatePath = xbmcvfs.translatePath
except AttributeError:
pass
after the imports to make xbmc.translatePath() compatible
ADDON = xbmcaddon.Addon() | ||
ADDON_ID = ADDON.getAddonInfo('id') | ||
ADDON_VERSION = ADDON.getAddonInfo('version') | ||
ADDON_PATH_PROFILE = xbmc.translatePath(ADDON.getAddonInfo('profile')) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Vfs
|
||
def createGameIcon(home,away,image_path): | ||
#bg = Image.new('RGB', (400,225), (0,0,0)) | ||
bg = Image.new('RGB', (500,250), (0,0,0)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As far as I can see you never close the file handlers
# All past games should have highlights | ||
if len(stream_title) == 0: | ||
# and stream_date > localToEastern(): | ||
msg = "No playable streams found." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Localize
# and stream_date > localToEastern(): | ||
msg = "No playable streams found." | ||
dialog = xbmcgui.Dialog() | ||
dialog.notification('Streams Not Found', msg, ICON, 5000, False) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same
Add-on details:
General
Code location
Watch every out-of-market regular season game in the office or on the go. The #1 LIVE
Streaming Sports Service
Description of changes:
Checklist: