コード例 #1
0
ファイル: item.py プロジェクト: indera/PyTone
 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)
コード例 #2
0
ファイル: item.py プロジェクト: indera/PyTone
 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)
コード例 #3
0
 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)
コード例 #4
0
 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)
コード例 #5
0
ファイル: sqlite.py プロジェクト: indera/PyTone
    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))
コード例 #6
0
ファイル: item.py プロジェクト: indera/PyTone
 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)
コード例 #7
0
 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)