Exemplo n.º 1
0
 def getHash(self):
     """Video.getHash() -> file hash"""
     if self.host is None:
         return None
     be = FileOps(db=self._db)
     hash = be.getHash(self.filename, 'Videos', self.host)
     return hash
Exemplo n.º 2
0
 def getRecStatus(self):
     be = FileOps(db=self._db)
     for prog in be._getPrograms('QUERY_GETALLPENDING', header=1):
         if (prog.chanid == self.chanid) and \
                 (prog.starttime == self.starttime):
             return prog.recstatus
     return 0
Exemplo n.º 3
0
 def getHash(self):
     """Video.getHash() -> file hash"""
     if self.host is None:
         return None
     be = FileOps(db=self._db)
     hash = be.getHash(self.filename, 'Videos', self.host)
     return hash
Exemplo n.º 4
0
 def getRecStatus(self):
     be = FileOps(db=self._db)
     for prog in be._getPrograms('QUERY_GETALLPENDING', header=1):
         if (prog.chanid == self.chanid) and \
                 (prog.starttime == self.starttime):
             return prog.recstatus
     return 0
Exemplo n.º 5
0
 def getUpcoming(self, deactivated=False):
     recstatus = None
     if not deactivated:
         recstatus = Program.rsWillRecord
     return FileOps(db=self._db)._getSortedPrograms('QUERY_GETALLPENDING',
                                                    header=1,
                                                    recordid=self.recordid,
                                                    recstatus=recstatus)
Exemplo n.º 6
0
 def setDuplicate(self, record=False):
     """
     OldRecorded.setDuplicate(record=False) -> None
             Toggles re-recordability
     """
     with self._db.cursor(self._log) as cursor:
         cursor.execute("""UPDATE oldrecorded SET duplicate=%%s
                           WHERE %s""" % self._where, \
                     tuple([record]+list(self._wheredat)))
     FileOps(db=self._db).reschedule(0)
Exemplo n.º 7
0
 def downloadFrom(self, url):
     if self.parent is None:
         raise RuntimeError("Artwork.downloadFrom must be called from "+\
                            "object, not class.")
     be = FileOps(self.hostname, db=self.parent._db)
     be.downloadTo(url, self.imagetype, self)
Exemplo n.º 8
0
 def exists(self):
     be = FileOps(self.hostname, db = self.parent._db)
     return be.fileExists(unicode(self), self.imagetype)
Exemplo n.º 9
0
 def downloadFrom(self, url):
     if self.parent is None:
         raise RuntimeError("Artwork.downloadFrom must be called from "+\
                            "object, not class.")
     be = FileOps(self.hostname, db=self.parent._db)
     be.downloadTo(url, self.imagetype, self)
Exemplo n.º 10
0
 def exists(self):
     be = FileOps(self.hostname, db = self.parent._db)
     return be.fileExists(unicode(self), self.imagetype)
Exemplo n.º 11
0
 def update(self, *args, **keywords):
     wait = keywords.get('wait',False)
     DBDataWrite.update(self, *args, **keywords)
     FileOps(db=self._db).reschedule(self.recordid, wait)
Exemplo n.º 12
0
 def delete(self, wait=False):
     DBDataWrite.delete(self)
     FileOps(db=self._db).reschedule(self.recordid, wait)
Exemplo n.º 13
0
 def create(self, data=None, wait=False):
     """Record.create(data=None) -> Record object"""
     DBDataWrite._create_autoincrement(self, data)
     FileOps(db=self._db).reschedule(self.recordid, wait)
     return self