~wattazoum/xbmc/mangas-tv-plugin

« back to all changes in this revision

Viewing changes to plugin.video.mangastv/resources/lib/main_mangastv.py

  • Committer: Oumar Aziz OUATTARA
  • Date: 2011-01-06 20:43:32 UTC
  • Revision ID: aouattara@octo.com-20110106204332-xqgocsbneepmpupr
Tags: 1.0.4
Add genres to animes

Show diffs side-by-side

added added

removed removed

Lines of Context:
123
123
                                image = __site_url__ + articleManga.find('img', attrs={'class': 'articleMangaImage'})['src']
124
124
                                desc = articleManga.find('p', attrs={'class': 'articleMangaDescription'}).find(text=True).strip()
125
125
                                stats = articleManga.find("div", attrs={"class": "optionDetailManga"}).findAll('b')
126
 
                                infoLabels = { "name":title, "plot":desc, "genre": "TODO"}
 
126
                                
 
127
                                # get genre
 
128
                                genreList = articleManga.find("td", attrs={"class": "articleMangaContenu"}).find('table').findAll('td')
 
129
                                
 
130
                                genre = ""
 
131
                                prevGVotes = 0
 
132
                                for genreTd in genreList:
 
133
                                        genreCandidate = genreTd.find("br").nextSibling.strip()
 
134
                                        gVotes = int(genreTd.find("b").string)  
 
135
                                        if prevGVotes > 0 :
 
136
                                                genre = genre + ', ' + genreCandidate
 
137
                                        else :
 
138
                                                genre = genreCandidate
 
139
                                        prevGVotes = gVotes
 
140
                                
 
141
                                infoLabels = { "name": title, "plot": desc, "genre": genre}
127
142
                                rating, votes, views = stats[1].find(text=True),stats[2].find(text=True),stats[3].find(text=True)
128
143
                                if rating is not None and is_number(rating):
129
144
                                        infoLabels['rating'] =  float(rating)
220
235
                #create list item
221
236
                li = xbmcgui.ListItem(label=unescapeHTMLchar(info['Title']), iconImage=info['Thumb'], thumbnailImage=info['Thumb'])
222
237
                if extrainfo != None:
223
 
                        li.setInfo(type="Video", infoLabels={ "Title":unescapeHTMLchar(extrainfo['name']), "Plot":unescapeHTMLchar(extrainfo['plot']), "Genre":extrainfo['genre'], 'Rating':extrainfo['rating']})       
 
238
                        li.setInfo(type="Video", infoLabels={ "Title":unescapeHTMLchar(extrainfo['name']), "Plot":unescapeHTMLchar(extrainfo['plot']), "Genre":unescapeHTMLchar(extrainfo['genre']), 'Rating':extrainfo['rating']})     
224
239
                #for videos, replace context menu with queue and add to favorites
225
240
                if not isFolder:
226
241
                        li.setProperty("IsPlayable", "true")#let xbmc know this can be played, unlike a folder.