Beispiel #1
0
 def _createViewedFile(self, hashData):
     if hashData != None and mkdirs(
             GetFavouritesDir('IPTVWatched') + ('/%s/' % hashData[0])):
         flagFilePath = GetFavouritesDir('IPTVWatched/%s/.%s.iptvhash' %
                                         hashData)
         if touch(flagFilePath):
             return True
     return False
Beispiel #2
0
 def isItemWatched(self, index, displayItem):
     ret = self.getItemHashData(index, displayItem)
     if ret != None:
         return fileExists(
             GetFavouritesDir('IPTVWatched/%s/.%s.iptvhash' % ret))
     else:
         return False
 def onStart(self):
     self.onShown.remove(self.onStart)
     if None == self.favourites:
         self.favourites = IPTVFavourites(GetFavouritesDir())
         sts = self.favourites.load(groupsOnly=True)
         if not sts:
             self.session.openWithCallback(self.iptvDoFinish,
                                           MessageBox,
                                           self.favourites.getLastError(),
                                           type=MessageBox.TYPE_ERROR,
                                           timeout=10)
             return
     options = []
     groups = self.favourites.getGroups()
     for item in groups:
         if item['group_id'] in self.ignoredGroups: continue
         options.append((item['title'], item['group_id']))
     if self.canAddNewGroup:
         options.append((_("Add new group of favourites"), None))
     if len(options):
         self.session.openWithCallback(self.addFavouriteToGroup,
                                       ChoiceBox,
                                       title=_("Select favourite group"),
                                       list=options)
     else:
         self.session.openWithCallback(
             self.iptvDoFinish,
             MessageBox,
             _("There are no other favourite groups"),
             type=MessageBox.TYPE_INFO,
             timeout=10)
Beispiel #4
0
 def __init__(self):
     printDBG("Favourites.__init__")
     CBaseHostClass.__init__(self)
     self.helper = IPTVFavourites(GetFavouritesDir())
     self.host = None
     self.hostName = ''
     self.guestMode = False  # main or guest
     self.DEFAULT_ICON_URL = 'http://sarah-bauer.weebly.com/uploads/4/2/2/3/42234635/1922500_orig.png'
 def onStart(self):
     self.onShown.remove(self.onStart)
     self.favourites = IPTVFavourites(GetFavouritesDir())
     sts = self.favourites.load(groupsOnly=True)
     if not sts:
         self.session.openWithCallback(self.iptvDoFinish, MessageBox, self.favourites.getLastError(), type=MessageBox.TYPE_ERROR, timeout=10)
         return
     self.displayList()
Beispiel #6
0
 def __init__(self):
     printDBG("Favourites.__init__")
     CBaseHostClass.__init__(self)
     self.helper = IPTVFavourites(GetFavouritesDir())
     self.host = None
     self.hostName = ''
     self.guestMode = False # main or guest
     self.DEFAULT_ICON_URL = 'https://www.iconninja.com/files/637/891/649/512-favorites-icon.png'
 def performCustomAction(self, privateData):
     retCode = RetHost.ERROR
     retlist = []
     if self.useWatchedFlag:
         hashData = privateData['hash_data']
         Index = privateData['item_index']
         if privateData['action'] == 'unset_watched_flag':
             flagFilePath = GetFavouritesDir('IPTVWatched/%s/.%s.iptvhash' % hashData)
             if rm(flagFilePath):
                 self.cachedRet.value[Index].isWatched = False
                 retCode = RetHost.OK
         elif privateData['action'] == 'set_watched_flag':
             if self._createViewedFile(hashData):
                 self.cachedRet.value[Index].isWatched = True
                 retCode = RetHost.OK
         
         if retCode == RetHost.OK:
             self.refreshAfterWatchedFlagChange = True
             retlist = ['refresh']
     
     return RetHost(retCode, value=retlist)
Beispiel #8
0
 def __init__(self):
     printDBG("Favourites.__init__")
     CBaseHostClass.__init__(self)
     self.helper = IPTVFavourites(GetFavouritesDir())
     self.host = None
     self.hostName = ''