def getname(self): if self.nrsongs is None: self.nrsongs = hub.request(requests.getnumberofsongs(self.songdbid, filters=self.filters)) if self.basedir: return _("[Database: %s (%d)]") % (self.basedir, self.nrsongs) else: return _("%d databases (%d)") % (len(self.songdbids), self.nrsongs)
def getname(self): # XXX make this configurable (note that showing the numbers by default is rather costly) if 1: return "%s/" % self.description else: if self.nrsongs is None: self.nrsongs = hub.request(requests.getnumberofsongs(self.songdbid, filters=self.filters)) return "%s (%d)/" % (self.description, self.nrsongs)
def getname(self): if self.nrsongs is None: self.nrsongs = hub.request( requests.getnumberofsongs(self.songdbid, filters=self.filters)) if self.basedir: return _("[Database: %s (%d)]") % (self.basedir, self.nrsongs) else: return _("%d databases (%d)") % (len(self.songdbids), self.nrsongs)
def getname(self): # XXX make this configurable (note that showing the numbers by default is rather costly) if 1: return "%s/" % self.description else: if self.nrsongs is None: self.nrsongs = hub.request( requests.getnumberofsongs(self.songdbid, filters=self.filters)) return "%s (%d)/" % (self.description, self.nrsongs)
def autoregistersongs(self, event): if self.songdbid == event.songdbid: oldsongs = set(hub.request(requests.getsongs(self.songdbid))) log.info(_("database %r: scanning for songs in %r (currently %d songs registered)") % (self.songdbid, self.basedir, len(oldsongs))) # scan for all songs in the filesystem log.debug("database %r: searching for new songs" % self.songdbid) self.registerdirtree(self.basedir, oldsongs, event.force) # remove songs which have not yet been scanned and thus are not accesible anymore log.info(_("database %r: removing %d stale songs") % (self.songdbid, len(oldsongs))) for song in oldsongs: self._notify(events.delete_song(self.songdbid, song)) nrsongs = hub.request(requests.getnumberofsongs(self.songdbid)) log.info(_("database %r: rescan finished (%d songs registered)") % (self.songdbid, nrsongs))
def getname(self): if self.nrsongs is None: self.nrsongs = hub.request(requests.getnumberofsongs(self.songdbid, filters=self.filters)) return "[%s (%d)]/" % (self.name, self.nrsongs)
def getname(self): if self.nrsongs is None: self.nrsongs = hub.request( requests.getnumberofsongs(self.songdbid, filters=self.filters)) return "[%s (%d)]/" % (self.name, self.nrsongs)