From 65660e57cae49d7613aea0f6329482e61e3279fe Mon Sep 17 00:00:00 2001 From: Justin Evans Date: Sat, 10 Jan 2015 14:14:24 -0800 Subject: [PATCH] Active Artist Update can be launched via API --- API.md | 2 ++ headphones/api.py | 12 ++++++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/API.md b/API.md index cf69ef66..0fc0946d 100644 --- a/API.md +++ b/API.md @@ -68,6 +68,8 @@ Unmark album as wanted / i.e. mark as skipped force search for wanted albums - not launched in a separate thread so it may take a bit to complete ### forceProcess Force post process albums in download directory - also not launched in a separate thread +### forceActiveArtistsUpdate +force Active Artist Update - also not launched in a separate thread ### getVersion Returns some version information: git_path, install_type, current_version, installed_version, commits_behind diff --git a/headphones/api.py b/headphones/api.py index cb429ea6..7273c2ad 100644 --- a/headphones/api.py +++ b/headphones/api.py @@ -13,16 +13,17 @@ # You should have received a copy of the GNU General Public License # along with Headphones. If not, see . -from headphones import db, mb, importer, searcher, cache, postprocessor, versioncheck, logger +from headphones import db, mb, updater, importer, searcher, cache, postprocessor, versioncheck, logger import headphones import json cmd_list = ['getIndex', 'getArtist', 'getAlbum', 'getUpcoming', 'getWanted', 'getSimilar', 'getHistory', 'getLogs', 'findArtist', 'findAlbum', 'addArtist', 'delArtist', 'pauseArtist', 'resumeArtist', 'refreshArtist', - 'addAlbum', 'queueAlbum', 'unqueueAlbum', 'forceSearch', 'forceProcess', 'getVersion', 'checkGithub', - 'shutdown', 'restart', 'update', 'getArtistArt', 'getAlbumArt', 'getArtistInfo', 'getAlbumInfo', - 'getArtistThumb', 'getAlbumThumb', 'choose_specific_download', 'download_specific_release'] + 'addAlbum', 'queueAlbum', 'unqueueAlbum', 'forceSearch', 'forceProcess', 'forceActiveArtistsUpdate', + 'getVersion', 'checkGithub','shutdown', 'restart', 'update', 'getArtistArt', 'getAlbumArt', + 'getArtistInfo', 'getAlbumInfo', 'getArtistThumb', 'getAlbumThumb', + 'choose_specific_download', 'download_specific_release'] class Api(object): @@ -321,6 +322,9 @@ class Api(object): self.dir = kwargs['dir'] postprocessor.forcePostProcess(self.dir) + def _forceActiveArtistsUpdate(self, **kwargs): + updater.dbUpdate() + def _getVersion(self, **kwargs): self.data = { 'git_path': headphones.CONFIG.GIT_PATH,