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
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
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)
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)
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)
def exists(self): be = FileOps(self.hostname, db = self.parent._db) return be.fileExists(unicode(self), self.imagetype)
def update(self, *args, **keywords): wait = keywords.get('wait',False) DBDataWrite.update(self, *args, **keywords) FileOps(db=self._db).reschedule(self.recordid, wait)
def delete(self, wait=False): DBDataWrite.delete(self) FileOps(db=self._db).reschedule(self.recordid, wait)
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