metabaron / Gomiso-XBMC

Gomiso integration within XBMC
GNU General Public License v2.0
5 stars 2 forks source link

Movie info can´t be checked in #8

Closed dariusve closed 12 years ago

dariusve commented 12 years ago

when I watch a movie, the information can´t be checked in on Miso due an script error.

I fixed the error.

just put the the marked lines (->) on the default.py before line 212:

elif len(xbmc.getInfoLabel("VideoPlayer.Title")) >= 1:

Retrieve movie information

                    #movieName = xbmc.getInfoLabel("VideoPlayer.Title")
                    movieName = unicode(xbmc.getInfoLabel("VideoPlayer.Title"), errors="ignore")
                    movieName = movieName.replace(",", '')
                ->  season = ''
                                    ->    episode = ''
                    #Retrieve only one entry but would be good to have a threshold level like if more than 20 entries, no submit
                    json_result = json.loads(letsGo.findMedia(movieName, 'movie', 1))
                    if len(json_result) != 0:
                        letsGo.checking(json_result[0]['media']['id'], season, episode, 'watched on XBMC with gomiso addon')
                        if verboseScreen:
                            xbmc.executebuiltin("XBMC.Notification(%s, %s, %i, %s)"  % ('Gomiso', movieName + ' ' + **language**(30918), 5000, **settings**.getAddonInfo("icon")))
                    else:
                        if verboseScreen:
                            xbmc.executebuiltin("XBMC.Notification(%s, %s, %i, %s)"  % ('Gomiso', movieName + ' ' + **language**(30917), 5000, **settings**.getAddonInfo("icon")))
                    checkedTitle = currentTitle
metabaron commented 12 years ago

You are right and I don;t know how I missed this one. The code is updated and will be part of the next release.

The best would be to change the XBMC Python lib itself, will try to do it before the submit to XBMC.

bionicdude commented 12 years ago

by making those two values "" (empty string) i think you trip up the submssion. Your other module (that you use as a base) checks to see if episode and season are not 0 and will then add them in the submission if this is the case: if episode_num != 0 and season_num !=0: arguments += '&season_num=' + str(season_num) + '&episode_num=' + str(episode_num)

instead, making them 0, should mean that everything works (it seems to on my local modified version).

4nd commented 11 years ago

This still seems to be broken, script crashes when watching movie, the line 218 still says: letsGo.checking(json_result[0]['media']['id'], season, episode, 'watched on XBMC with gomiso addon') in the condition that a movie was found. Consequently we see the following error when in a movie: File "/root/.xbmc/addons/script.gomiso/default.py", line 218, in letsGo.checking(json_result[0]['media']['id'], season, episode, 'watched on XBMC with gomiso addon') NameError: name 'season' is not defined

Is there an easy fix for this?

metabaron commented 11 years ago

Just asked XBMC team to deploy the new version with the bug fixed