diff --git a/data/interfaces/default/manageartists.html b/data/interfaces/default/manageartists.html index d0d6d30d..d1762cb2 100644 --- a/data/interfaces/default/manageartists.html +++ b/data/interfaces/default/manageartists.html @@ -1,14 +1,18 @@ <%inherit file="base.html" /> -<%! - import headphones -%> + <%def name="body()">
-

Manage New Artists

+

Manage Artists

-
+

- Add selected artists + + selected artists

@@ -16,13 +20,23 @@ + - %for artist in headphones.NEW_ARTISTS: - + %for artist in artists: + <% + if artist['Status'] == 'Paused': + grade = 'X' + elif artist['Status'] == 'Loading': + grade = 'C' + else: + grade = 'Z' + %> + + %endfor @@ -44,6 +58,7 @@ "aoColumns": [ null, { "sType": "title-string"}, + null ], "bStateSave": true, "bPaginate": false diff --git a/headphones/__init__.py b/headphones/__init__.py index 25631191..dadff537 100644 --- a/headphones/__init__.py +++ b/headphones/__init__.py @@ -201,7 +201,7 @@ def initialize(): PREFERRED_QUALITY = check_setting_int(CFG, 'General', 'preferred_quality', 0) PREFERRED_BITRATE = check_setting_int(CFG, 'General', 'preferred_bitrate', '') DETECT_BITRATE = bool(check_setting_int(CFG, 'General', 'detect_bitrate', 0)) - ADD_ARTISTS = bool(check_setting_int(CFG, 'General', 'add_artists', 1)) + ADD_ARTISTS = bool(check_setting_int(CFG, 'General', 'auto_add_artists', 1)) CORRECT_METADATA = bool(check_setting_int(CFG, 'General', 'correct_metadata', 0)) MOVE_FILES = bool(check_setting_int(CFG, 'General', 'move_files', 0)) RENAME_FILES = bool(check_setting_int(CFG, 'General', 'rename_files', 0)) @@ -366,7 +366,7 @@ def config_write(): new_config['General']['preferred_quality'] = PREFERRED_QUALITY new_config['General']['preferred_bitrate'] = PREFERRED_BITRATE new_config['General']['detect_bitrate'] = int(DETECT_BITRATE) - new_config['General']['add_artists'] = int(ADD_ARTISTS) + new_config['General']['auto_add_artists'] = int(ADD_ARTISTS) new_config['General']['correct_metadata'] = int(CORRECT_METADATA) new_config['General']['move_files'] = int(MOVE_FILES) new_config['General']['rename_files'] = int(RENAME_FILES) diff --git a/headphones/importer.py b/headphones/importer.py index 08334af0..c0cb0e60 100644 --- a/headphones/importer.py +++ b/headphones/importer.py @@ -22,10 +22,13 @@ def is_exists(artistid): return False -def artistlist_to_mbids(artistlist): +def artistlist_to_mbids(artistlist, forced=False): for artist in artistlist: - + + if forced: + artist = unicode(artist, 'utf-8') + results = mb.findArtist(artist, limit=1) if not results: diff --git a/headphones/webserve.py b/headphones/webserve.py index 8c2ee10d..295ff6b6 100644 --- a/headphones/webserve.py +++ b/headphones/webserve.py @@ -150,7 +150,7 @@ class WebInterface(object): markAlbums.exposed = True def addArtists(self, **args): - threading.Thread(target=importer.artistlist_to_mbids, args=[args]).start() + threading.Thread(target=importer.artistlist_to_mbids, args=[args, True]).start() time.sleep(5) raise cherrypy.HTTPRedirect("home") addArtists.exposed = True
Artist NameStatus
${artist['ArtistName']}${artist['Status']}