def add_program_vod(self, listcontainersort): for program in var.ChannelsDataJsonSeriesKids['resultObj'][ 'containers']: try: #Load program basics ProgramName = metadatainfo.programtitle_from_json_metadata( program) #Check if there are search results if var.SearchFilterTerm != '': searchMatch = func.search_filter_string(ProgramName) searchResultFound = var.SearchFilterTerm in searchMatch if searchResultFound == False: continue #Load program details PictureUrl = metadatainfo.pictureUrl_from_json_metadata( program) ProgramId = metadatainfo.contentId_from_json_metadata(program) ProgramYear = metadatainfo.programyear_from_json_metadata( program) ProgramStarRating = metadatainfo.programstarrating_from_json_metadata( program) ProgramAgeRating = metadatainfo.programagerating_from_json_metadata( program) #Combine program details stringJoin = [ProgramYear, ProgramStarRating, ProgramAgeRating] ProgramDetails = ' '.join(filter(None, stringJoin)) if func.string_isnullorempty(ProgramDetails): ProgramDetails = '(?)' ProgramDetails = '[COLOR gray]' + ProgramDetails + '[/COLOR]' #Add vod program listitem = xbmcgui.ListItem() listitem.setProperty('Action', 'load_episodes_vod') listitem.setProperty('PictureUrl', PictureUrl) listitem.setProperty('ProgramId', ProgramId) listitem.setProperty("ProgramName", ProgramName) listitem.setProperty('ProgramDetails', ProgramDetails) listitem.setInfo('video', { 'Genre': 'Series', 'Plot': ProgramDetails }) iconProgramType = "common/series.png" iconStreamType = "common/vod.png" iconProgram = path.icon_vod(PictureUrl) listitem.setArt({ 'thumb': iconProgram, 'icon': iconProgram, 'image1': iconStreamType, 'image2': iconProgramType }) listcontainersort.append(listitem) except: continue
def add_movies_vod(self, listcontainersort): for program in var.ChannelsDataJsonMovies['resultObj']['containers']: try: #Load program basics ProgramName = metadatainfo.programtitle_from_json_metadata( program) TechnicalPackageIds = metadatainfo.technicalPackageIds_from_json_metadata( program) #Check if there are search results if var.SearchFilterTerm != '': searchMatch = func.search_filter_string(ProgramName) searchResultFound = var.SearchFilterTerm in searchMatch if searchResultFound == False: continue #Check if content is pay to play if metadatainfo.program_check_paytoplay(TechnicalPackageIds): continue #Load program details PictureUrl = metadatainfo.pictureUrl_from_json_metadata( program) ProgramId = metadatainfo.contentId_from_json_metadata(program) ProgramYear = metadatainfo.programyear_from_json_metadata( program) ProgramSeason = metadatainfo.programseason_from_json_metadata( program) ProgramStarRating = metadatainfo.programstarrating_from_json_metadata( program) ProgramAgeRating = metadatainfo.programagerating_from_json_metadata( program) ProgramDuration = metadatainfo.programdurationstring_from_json_metadata( program) ProgramDescription = metadatainfo.programdescription_from_json_metadata( program) ProgramAvailability = metadatainfo.vod_ondemand_available_time( program) #Combine program details stringJoin = [ ProgramYear, ProgramSeason, ProgramStarRating, ProgramAgeRating, ProgramDuration ] ProgramDetails = ' '.join(filter(None, stringJoin)) if func.string_isnullorempty(ProgramDetails): ProgramDetails = '(?)' ProgramDetails = '[COLOR gray]' + ProgramDetails + '[/COLOR]' #Add vod program listitem = xbmcgui.ListItem() listitem.setProperty('Action', 'play_stream_vod') listitem.setProperty('ProgramId', ProgramId) listitem.setProperty("ProgramName", ProgramName) listitem.setProperty("ProgramDetails", ProgramDetails) listitem.setProperty("ProgramAvailability", ProgramAvailability) listitem.setProperty('ProgramDescription', ProgramDescription) listitem.setInfo('video', { 'Genre': 'Films', 'Plot': ProgramDescription }) iconStreamType = "common/vod.png" iconProgram = path.icon_vod(PictureUrl) listitem.setArt({ 'thumb': iconProgram, 'icon': iconProgram, 'image1': iconStreamType }) listcontainersort.append(listitem) except: continue
def load_episodes_vod(self, listItem, selectList=False): #Get the selected parentid selectedParentId = listItem.getProperty('ProgramId') selectedSeriesName = listItem.getProperty('ProgramName') selectedPictureUrl = listItem.getProperty('PictureUrl') #Get and check the list container listcontainer = self.getControl(1002) listcontainer.reset() #Update the episodes status func.updateLabelText(self, 2, 'Afleveringen downloaden') #Download the series episodes seasonDownloaded = download.download_series_season(selectedParentId) if seasonDownloaded == None: func.updateLabelText(self, 2, 'Afleveringen niet beschikbaar') return False #Update the episodes status func.updateLabelText(self, 2, 'Afleveringen laden') #Process all the episodes for program in seasonDownloaded["resultObj"]["containers"]: try: #Load program basics TechnicalPackageIds = metadatainfo.technicalPackageIds_from_json_metadata( program) #Check if content is pay to play if metadatainfo.program_check_paytoplay(TechnicalPackageIds): continue #Load program details ProgramId = metadatainfo.contentId_from_json_metadata(program) ProgramName = metadatainfo.programtitle_from_json_metadata( program) ProgramYear = metadatainfo.programyear_from_json_metadata( program) ProgramSeason = metadatainfo.programseason_from_json_metadata( program) ProgramEpisode = metadatainfo.episodenumber_from_json_metadata( program) ProgramDuration = metadatainfo.programdurationstring_from_json_metadata( program) ProgramDescription = metadatainfo.programdescription_from_json_metadata( program) ProgramAvailability = metadatainfo.vod_ondemand_available_time( program) #Combine program details stringJoin = [ ProgramYear, ProgramSeason, ProgramEpisode, ProgramDuration ] ProgramDetails = ' '.join(filter(None, stringJoin)) if func.string_isnullorempty(ProgramDetails): ProgramDetails = '(?)' ProgramDetails = '[COLOR gray]' + ProgramDetails + '[/COLOR]' #Add vod program listitem = xbmcgui.ListItem() listitem.setProperty('Action', 'play_episode_vod') listitem.setProperty('ProgramId', ProgramId) listitem.setProperty("ProgramName", ProgramName) listitem.setProperty('ProgramDetails', ProgramDetails) listitem.setProperty("ProgramAvailability", ProgramAvailability) listitem.setProperty('ProgramDescription', ProgramDescription) listitem.setInfo('video', { 'Genre': selectedSeriesName, 'Plot': ProgramDescription }) listitem.setArt({ 'thumb': path.icon_vod(selectedPictureUrl), 'icon': path.icon_vod(selectedPictureUrl) }) listcontainer.addItem(listitem) except: continue #Update the episodes status func.updateLabelText( self, 2, selectedSeriesName + ' (' + str(listcontainer.size()) + ' afleveringen)') #Select the list container if selectList == True and listcontainer.size() > 0: self.setFocus(listcontainer) xbmc.sleep(100) listcontainer.selectItem(0) xbmc.sleep(100)