From 46240fb7d111c58b8742eb853dcefe79604337ae Mon Sep 17 00:00:00 2001 From: Ade Date: Sat, 30 Aug 2014 22:17:30 +1200 Subject: [PATCH] Add Demo to Extras - fix up songkick location breaking artist page - add description and link for songkick metro area filter --- data/interfaces/default/artist.html | 12 ++++++------ data/interfaces/default/config.html | 7 ++++--- headphones/mb.py | 2 +- headphones/webserve.py | 12 ++++++------ lib/musicbrainzngs/musicbrainz.py | 2 +- 5 files changed, 18 insertions(+), 17 deletions(-) diff --git a/data/interfaces/default/artist.html b/data/interfaces/default/artist.html index 4617f7eb..b4c8342d 100644 --- a/data/interfaces/default/artist.html +++ b/data/interfaces/default/artist.html @@ -167,7 +167,7 @@ songkick_filter_enabled = "true" else: songkick_filter_enabled = "false" - + if not headphones.SONGKICK_LOCATION: songkick_location = "none" else: @@ -190,11 +190,11 @@ function(data){ if (data['resultsPage'].totalEntries >= 1) { - if( ${songkick_filter_enabled} ) { - data.resultsPage.results.event = $.grep(data.resultsPage.results.event, function(element,index){ - return element.venue.metroArea.id == ${songkick_location}; - }); - } + if( ${songkick_filter_enabled} ) { + data.resultsPage.results.event = $.grep(data.resultsPage.results.event, function(element,index){ + return element.venue.metroArea.id == ${songkick_location}; + }); + } var tourDate; diff --git a/data/interfaces/default/config.html b/data/interfaces/default/config.html index d5df9e61..cb3aa513 100644 --- a/data/interfaces/default/config.html +++ b/data/interfaces/default/config.html @@ -1193,12 +1193,13 @@
- +
- - + + + Find Area ID
diff --git a/headphones/mb.py b/headphones/mb.py index c8a4dd06..79ff7bf4 100644 --- a/headphones/mb.py +++ b/headphones/mb.py @@ -276,7 +276,7 @@ def getArtist(artistid, extrasonly=False): extras = map(int, db_artist['Extras'].split(',')) else: extras = [] - extras_list = ["single", "ep", "compilation", "soundtrack", "live", "remix", "spokenword", "audiobook", "other", "dj-mix", "mixtape/street", "broadcast", "interview"] + extras_list = ["single", "ep", "compilation", "soundtrack", "live", "remix", "spokenword", "audiobook", "other", "dj-mix", "mixtape/street", "broadcast", "interview", "demo"] includes = [] diff --git a/headphones/webserve.py b/headphones/webserve.py index 41a4cc07..a8dfbf21 100644 --- a/headphones/webserve.py +++ b/headphones/webserve.py @@ -86,7 +86,7 @@ class WebInterface(object): raise cherrypy.HTTPRedirect("home") # Serve the extras up as a dict to make things easier for new templates (append new extras to the end) - extras_list = ["single", "ep", "compilation", "soundtrack", "live", "remix", "spokenword", "audiobook", "other", "djmix", "mixtape_street", "broadcast", "interview"] + extras_list = ["single", "ep", "compilation", "soundtrack", "live", "remix", "spokenword", "audiobook", "other", "djmix", "mixtape_street", "broadcast", "interview", "demo"] if artist['Extras']: artist_extras = map(int, artist['Extras'].split(',')) else: @@ -157,12 +157,12 @@ class WebInterface(object): # # If they are, we need to convert kwargs to string format if not newstyle: - extras = "1,2,3,4,5,6,7,8,9,10,11,12,13" + extras = "1,2,3,4,5,6,7,8,9,10,11,12,13,14" else: temp_extras_list = [] # TODO: Put these extras as a global variable i = 1 - for extra in ["single", "ep", "compilation", "soundtrack", "live", "remix", "spokenword", "audiobook", "other", "djmix", "mixtape_street", "broadcast", "interview"]: + for extra in ["single", "ep", "compilation", "soundtrack", "live", "remix", "spokenword", "audiobook", "other", "djmix", "mixtape_street", "broadcast", "interview", "demo"]: if extra in kwargs: temp_extras_list.append(i) i += 1 @@ -1152,7 +1152,7 @@ class WebInterface(object): } # Need to convert EXTRAS to a dictionary we can pass to the config: it'll come in as a string like 2,5,6,8 (append new extras to the end) - extras_list = ["single", "ep", "compilation", "soundtrack", "live", "remix", "spokenword", "audiobook", "other", "djmix", "mixtape_street", "broadcast", "interview"] + extras_list = ["single", "ep", "compilation", "soundtrack", "live", "remix", "spokenword", "audiobook", "other", "djmix", "mixtape_street", "broadcast", "interview", "demo"] if headphones.EXTRAS: extras = map(int, headphones.EXTRAS.split(',')) else: @@ -1181,7 +1181,7 @@ class WebInterface(object): preferred_words=None, required_words=None, ignored_words=None, preferred_quality=0, preferred_bitrate=None, detect_bitrate=0, move_files=0, torrentblackhole_dir=None, download_torrent_dir=None, numberofseeders=None, use_piratebay=0, piratebay_proxy_url=None, piratebay_ratio=None, use_kat=0, kat_proxy_url=None, kat_ratio=None, use_mininova=0, mininova_ratio=None, waffles=0, waffles_uid=None, waffles_passkey=None, waffles_ratio=None, whatcd=0, whatcd_username=None, whatcd_password=None, whatcd_ratio=None, rutracker=0, rutracker_user=None, rutracker_password=None, rutracker_ratio=None, rename_files=0, correct_metadata=0, cleanup_files=0, keep_nfo=0, add_album_art=0, album_art_format=None, embed_album_art=0, embed_lyrics=0, replace_existing_folders=False, - destination_dir=None, lossless_destination_dir=None, folder_format=None, file_format=None, file_underscores=0, include_extras=0, single=0, ep=0, compilation=0, soundtrack=0, live=0, remix=0, spokenword=0, audiobook=0, other=0, djmix=0, mixtape_street=0, broadcast=0, interview=0, + destination_dir=None, lossless_destination_dir=None, folder_format=None, file_format=None, file_underscores=0, include_extras=0, single=0, ep=0, compilation=0, soundtrack=0, live=0, remix=0, spokenword=0, audiobook=0, other=0, djmix=0, mixtape_street=0, broadcast=0, interview=0, demo=0, autowant_upcoming=False, autowant_all=False, keep_torrent_files=False, prefer_torrents=0, open_magnet_links=0, interface=None, log_dir=None, cache_dir=None, music_encoder=0, encoder=None, xldprofile=None, bitrate=None, samplingfrequency=None, encoderfolder=None, advancedencoder=None, encoderoutputformat=None, encodervbrcbr=None, encoderquality=None, encoderlossless=0, delete_lossless_files=0, growl_enabled=0, growl_onsnatch=0, growl_host=None, growl_password=None, prowl_enabled=0, prowl_onsnatch=0, prowl_keys=None, prowl_priority=0, xbmc_enabled=0, xbmc_host=None, xbmc_username=None, xbmc_password=None, @@ -1397,7 +1397,7 @@ class WebInterface(object): # Convert the extras to list then string. Coming in as 0 or 1 (append new extras to the end) temp_extras_list = [] - extras_list = [single, ep, compilation, soundtrack, live, remix, spokenword, audiobook, other, djmix, mixtape_street, broadcast, interview] + extras_list = [single, ep, compilation, soundtrack, live, remix, spokenword, audiobook, other, djmix, mixtape_street, broadcast, interview, demo] i = 1 for extra in extras_list: diff --git a/lib/musicbrainzngs/musicbrainz.py b/lib/musicbrainzngs/musicbrainz.py index 16492087..875eff6f 100644 --- a/lib/musicbrainzngs/musicbrainz.py +++ b/lib/musicbrainzngs/musicbrainz.py @@ -93,7 +93,7 @@ VALID_RELEASE_TYPES = [ "nat", "album", "single", "ep", "broadcast", "other", # primary types "compilation", "soundtrack", "spokenword", "interview", "audiobook", - "live", "remix", "dj-mix", "mixtape/street", # secondary types + "live", "remix", "dj-mix", "mixtape/street", "demo", # secondary types ] #: These can be used to filter whenever releases or release-groups are involved VALID_RELEASE_STATUSES = ["official", "promotion", "bootleg", "pseudo-release"]