Skip to content
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

Merged
merged 1 commit into from
Oct 8, 2020
Merged

[plugin.video.mlbtv@matrix] 2020.10.8+matrix.1 #3157

merged 1 commit into from
Oct 8, 2020

Conversation

eracknaphobia
Copy link

Add-on details:

Watch every out-of-market regular season game in the office or on the go. The #1 LIVE
Streaming Sports Service

Description of changes:

        - Matrix compatibility updates
        - Code clean up

Checklist:

  • My code follows the add-on rules and piracy stance of this project.
  • I have read the CONTRIBUTING document
  • Each add-on submission should be a single commit with using the following style: [plugin.video.foo] v1.0.0

@TravisBuddy
Copy link

Travis tests were successful

Hey @eracknaphobia,
we found no major flaws with your code. Still you might want to look at this logfile, as we usually suggest some optional improvements.


#Settings
settings = xbmcaddon.Addon(id='plugin.video.mlbtv')
USERNAME = str(settings.getSetting(id="username"))
Copy link
Member

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

Copy link
Author

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!

@pkscout pkscout merged commit e3772c8 into xbmc:matrix Oct 8, 2020
Copy link
Member

@enen92 enen92 left a 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)
Copy link
Member

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"
Copy link
Member

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')
Copy link
Member

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)
Copy link
Member

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)
Copy link
Member

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'))
Copy link
Member

Choose a reason for hiding this comment

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

Xbmcvfs for matrix ++

Copy link
Author

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")

Copy link
Member

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

Copy link
Member

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'))
Copy link
Member

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))
Copy link
Member

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."
Copy link
Member

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)
Copy link
Member

Choose a reason for hiding this comment

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

Same

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.

5 participants