artist mode functional (?)

This commit is contained in:
boyska 2016-08-07 15:20:03 +02:00
parent a51e15fd0b
commit 90ea90cf37
2 changed files with 3 additions and 1 deletions

View file

@ -45,6 +45,8 @@ def get_mode(url):
return 'track' return 'track'
if path.startswith('/album/'): if path.startswith('/album/'):
return 'album' return 'album'
if path == '/':
return 'artist'
raise ValueError('unsupported url: "{}"'.format(path)) raise ValueError('unsupported url: "{}"'.format(path))

View file

@ -42,7 +42,7 @@ def visit_artist(b, url):
b.find_by_css('.square a') b.find_by_css('.square a')
if link['href'] and '/album/' in link['href']] if link['href'] and '/album/' in link['href']]
nonalbumtrack_urls = [link['href'] for link in nonalbumtrack_urls = [link['href'] for link in
b.find_by_css('.square a') b.find_by_css('.track_row_view a')
if link['href'] and '/track/' in link['href']] if link['href'] and '/track/' in link['href']]
log.debug('Found %d album + %d non-album tracks' % (len(album_urls), log.debug('Found %d album + %d non-album tracks' % (len(album_urls),
len(nonalbumtrack_urls) len(nonalbumtrack_urls)