diff --git a/data/css/style.css b/data/css/style.css index 6cb1b6cc..2632ced6 100644 --- a/data/css/style.css +++ b/data/css/style.css @@ -90,6 +90,11 @@ h1{ font-size: 11px; margin-left: 45px; } +.smalltext3{ + font-size: 11px; + margin-left: 30px; + color: #867970; + } .mediumtext{ font-size: 16px; margin-left: 100px; @@ -139,6 +144,7 @@ a.externalred { div.progress-container { border: 1px solid #ccc; width: 100px; + height: 12px; margin: 2px 5px 2px 0; padding: 1px; float: left; diff --git a/headphones/importer.py b/headphones/importer.py index 4bba8f25..dbd4721f 100644 --- a/headphones/importer.py +++ b/headphones/importer.py @@ -102,7 +102,14 @@ def artistlist_to_mbids(artistlist): for artist in artistlist: results = mb.findArtist(artist, limit=1) - artistid = results[0]['id'] + + try: + artistid = results[0]['id'] + + except IndexError: + logger.info('MusicBrainz query turned up no matches for: %s' % artist) + continue + if artistid != various_artists_mbid and not is_exists(artistid): addArtisttoDB(artistid) diff --git a/headphones/searcher.py b/headphones/searcher.py index c3299283..d459dfcf 100644 --- a/headphones/searcher.py +++ b/headphones/searcher.py @@ -1,6 +1,7 @@ import urllib import string import lib.feedparser as feedparser +from xml.dom import minidom import os, re import headphones @@ -125,21 +126,34 @@ def searchNZB(albumid=None): searchURL = 'https://secure.nzbs.org/rss.php?' + urllib.urlencode(params) logger.info(u"Parsing results from "+searchURL) - d = feedparser.parse(searchURL) + d = minidom.parse(searchURL) + node = d.documentElement + items = d.getElementsByTagName("item") - for item in d.entries: - try: - url = item.link - title = item.title - size = int(item.report_size) + if len(items): + + for item in items: + + sizenode = item.getElementsByTagName("report:size")[0].childNodes + titlenode = item.getElementsByTagName("title")[0].childNodes + linknode = item.getElementsByTagName("link")[0].childNodes + + for node in sizenode: + size = int(node.data) + for node in titlenode: + title = node.data + for node in linknode: + url = node.data + if size < maxsize: resultlist.append((title, size, url)) logger.info('Found %s. Size: %s' % (title, helpers.bytes_to_mb(size))) else: logger.info('%s is larger than the maxsize for this category, skipping. (Size: %i bytes)' % (title, size)) - except Exception, e: - logger.info(u"No results found. %s" % e) + else: + + logger.info(u"Nothing found.") if len(resultlist): diff --git a/headphones/templates.py b/headphones/templates.py index 574ab901..0c04e371 100644 --- a/headphones/templates.py +++ b/headphones/templates.py @@ -16,7 +16,7 @@ _shutdownheader = ''' - +