Example #1
0
    def update_tag(self, tag_name):
        key = Remotes.TAG_KEY_FORMAT % tag_name

        if cache.needs_update(key, age=Remotes.TAG_AGE):
            cache.keep(key)

            try:
                cherrypy.engine.bgtask.put_unique(self._fetch_tag, 5, tag_name)
            except NonUniqueQueueError:
                pass
Example #2
0
    def update_artist(self, artist):
        key = Remotes.ARTIST_KEY_FORMAT % artist.id

        if cache.needs_update(key, age=Remotes.ARTIST_AGE):
            cache.keep(key)

            try:
                cherrypy.engine.bgtask.put_unique(self._fetch_artist, 12, artist.id)
            except NonUniqueQueueError:
                pass
Example #3
0
    def update_album(self, album):
        key = Remotes.ALBUM_KEY_FORMAT % album.id

        if cache.needs_update(key, age=Remotes.ALBUM_AGE):
            cache.keep(key)

            try:
                cherrypy.engine.bgtask.put_unique(self._fetch_album, 11, album.id)
            except NonUniqueQueueError:
                pass
Example #4
0
    def update_track(self, track):
        key = Remotes.TRACK_KEY_FORMAT % track.id

        if cache.needs_update(key, age=Remotes.TRACK_AGE):
            cache.keep(key)

            try:
                cherrypy.engine.bgtask.put_unique(self._fetch_track, 10, track.id)
            except NonUniqueQueueError:
                pass
Example #5
0
    def update_user_tracks(self, user):
        key = Remotes.USER_TRACKS_KEY_FORMAT % user.id

        if cache.needs_update(key, age=Remotes.USER_TRACKS_AGE):
            cache.keep(key)

            try:
                cherrypy.engine.bgtask.put_unique(self._add_listened_tracks, 10, user.id, user.lastfm_user,
                                                  user.lastfm_session_key)
            except NonUniqueQueueError:
                pass
Example #6
0
 def run(self):
     if deluge.connect():
         deluge.update_torrents()
         cache.keep(DelugeBackgroundTaskCron.UPDATE_TORRENTS_KEY_DONE)