Merge branch 'develop'

This commit is contained in:
piejanssens
2014-08-05 23:05:32 +02:00
5 changed files with 43 additions and 37 deletions

View File

@@ -1,10 +1,17 @@
#![preview thumb](https://github.com/rembo10/headphones/raw/master/data/images/headphoneslogo.png)Headphones
###Support & Discuss
You are free to join the HP support community on IRC where you can ask questions, hang around and discuss anything related to HP.
1. Use any IRC client and connect to the Freenode server.
2. Join #headphones
###Installation and Notes
[Read our Wiki](../../wiki) on how to install and use HeadPhones properly.
**Issues** can be reported on the GitHub issue tracker considering these two rules:
**Issues** can be reported on the GitHub issue tracker considering these rules:
1. Analyze your log, you just might find the solution yourself!
2. You read the wiki and searched existing issues, but this is not solving your problem.
@@ -16,7 +23,10 @@
1. Search for similar existing 'issues', feature requests can be recognized by the label 'Request'.
2. If a similar Request exists, post a comment (+1, or add a new idea to the existing request), otherwise you can create a new one.
If you **comply with these rules** you can [post your issue](http://github.com/rembo10/headphones/issues).
If you **comply with these rules** you can [post your request/issue](http://github.com/rembo10/headphones/issues).
**Support** the project by implementing new features, solving support tickets and provide bug fixes.
If you change something in the code always make a PR to the developer branch instead of the master branch.
###Screenshots

View File

@@ -265,7 +265,7 @@ def getArtist(artistid, extrasonly=False):
# Need to convert extras string from something like '2,5.6' to ['ep','live','remix']
extras = db_artist['Extras']
extras_list = ["single", "ep", "compilation", "soundtrack", "live", "remix", "spokenword", "audiobook", "other"]
extras_list = ["single", "ep", "compilation", "soundtrack", "live", "remix", "dj-mix", "mixtape/street", "spokenword", "audiobook", "broadcast", "interview", "other"]
includes = []
i = 1

View File

@@ -848,11 +848,11 @@ def embedLyrics(downloaded_track_list):
# TODO: If adding lyrics for flac & lossy, only fetch the lyrics once
# and apply it to both files
for downloaded_track in downloaded_track_list:
track_title = downloaded_track.decode(headphones.SYS_ENCODING, 'replace')
try:
f = MediaFile(downloaded_track)
except:
logger.error('Could not read %s. Not checking lyrics', downloaded_track.decode(headphones.SYS_ENCODING, 'replace'))
logger.error('Could not read %s. Not checking lyrics', track_title)
continue
if f.albumartist and f.title:
@@ -860,17 +860,20 @@ def embedLyrics(downloaded_track_list):
elif f.artist and f.title:
metalyrics = lyrics.getLyrics(f.artist, f.title)
else:
logger.info('No artist/track metadata found for track: %s. Not fetching lyrics', downloaded_track.decode(headphones.SYS_ENCODING, 'replace'))
logger.info('No artist/track metadata found for track: %s. Not fetching lyrics', track_title)
metalyrics = None
if lyrics:
logger.debug('Adding lyrics to: %s', downloaded_track.decode(headphones.SYS_ENCODING, 'replace'))
if metalyrics:
logger.debug('Adding lyrics to: %s', track_title)
f.lyrics = metalyrics
try:
f.save()
except:
logger.error('Cannot save lyrics to: %s. Skipping', downloaded_track.decode(headphones.SYS_ENCODING, 'replace'))
logger.error('Cannot save lyrics to: %s. Skipping', track_title)
continue
else:
logger.debug('No lyrics found for track: %s', track_title)
def renameFiles(albumpath, downloaded_track_list, release):
logger.info('Renaming files')

View File

@@ -895,23 +895,24 @@ def searchTorrent(album, new=False, losslessOnly=False, albumlength=None):
pre_sorted_results = False
minimumseeders = int(headphones.NUMBEROFSEEDERS) - 1
def set_proxy(proxy_url):
if not proxy_url.startswith('http'):
proxy_url = 'http://' + proxy_url
if proxy_url.endswith('/'):
proxy_url = proxy_url[:-1]
return proxy_url
if headphones.KAT:
provider = "Kick Ass Torrents"
if headphones.KAT_PROXY_URL:
#Might need to clean up the user submitted url
kat_proxy = headphones.KAT_PROXY_URL
if not kat_proxy.startswith('http'):
kat_proxy = 'http://' + kat_proxy
if kat_proxy.endswith('/'):
kat_proxy = kat_proxy[:-1]
providerurl = url_fix(kat_proxy + "/usearch/" + term)
proxy_url = set_proxy(headphones.KAT_PROXY_URL)
providerurl = url_fix(proxy_url + "/usearch/" + term)
else:
providerurl = url_fix("http://kickass.to/usearch/" + term)
if headphones.PREFERRED_QUALITY == 3 or losslessOnly:
categories = "7" #music
format = "2" #flac
@@ -1156,16 +1157,8 @@ def searchTorrent(album, new=False, losslessOnly=False, albumlength=None):
if headphones.PIRATEBAY:
provider = "The Pirate Bay"
if headphones.PIRATEBAY_PROXY_URL:
#Might need to clean up the user submitted url
pirate_proxy = headphones.PIRATEBAY_PROXY_URL
if not pirate_proxy.startswith('http'):
pirate_proxy = 'http://' + pirate_proxy
if pirate_proxy.endswith('/'):
pirate_proxy = pirate_proxy[:-1]
providerurl = url_fix(pirate_proxy + "/search/" + term + "/0/99/")
proxy_url = set_proxy(headphones.PIRATEBAY_PROXY_URL)
providerurl = url_fix(proxy_url + "/search/" + term + "/0/99/")
else:
providerurl = url_fix("http://thepiratebay.se/search/" + term + "/0/99/")

View File

@@ -85,7 +85,7 @@ class WebInterface(object):
raise cherrypy.HTTPRedirect("home")
# Serve the extras up as a dict to make things easier for new templates
extras_list = ["single", "ep", "compilation", "soundtrack", "live", "remix", "spokenword", "audiobook", "other"]
extras_list = ["single", "ep", "compilation", "soundtrack", "live", "remix", "djmix", "mixtape_street", "spokenword", "audiobook", "broadcast", "interview", "other"]
extras_dict = {}
if not artist['Extras']:
@@ -156,12 +156,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"
extras = "1,2,3,4,5,6,7,8,9,10,11,12,13"
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"]:
for extra in ["single", "ep", "compilation", "soundtrack", "live", "remix", "djmix", "mixtape_street", "spokenword", "audiobook", "broadcast", "interview", "other"]:
if extra in kwargs:
temp_extras_list.append(i)
i += 1
@@ -1136,7 +1136,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
extras_list = ["single", "ep", "compilation", "soundtrack", "live", "remix", "spokenword", "audiobook", "other"]
extras_list = ["single", "ep", "compilation", "soundtrack", "live", "remix", "dj-mix", "mixtape/street", "spokenword", "audiobook", "broadcast", "interview", "other"]
extras_dict = {}
i = 1
@@ -1161,7 +1161,7 @@ class WebInterface(object):
numberofseeders=None, use_piratebay=0, piratebay_proxy_url=None, use_kat=0, kat_proxy_url=None, use_mininova=0, waffles=0, waffles_uid=None, waffles_passkey=None, whatcd=0, whatcd_username=None, whatcd_password=None,
rutracker=0, rutracker_user=None, rutracker_password=None, rename_files=0, correct_metadata=0, cleanup_files=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, 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,
remix=0, djmix=0, mixtape_street=0, broadcast=0, interview=0, spokenword=0, audiobook=0, other=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,
xbmc_update=0, xbmc_notify=0, nma_enabled=False, nma_apikey=None, nma_priority=0, nma_onsnatch=0, pushalot_enabled=False, pushalot_apikey=None, pushalot_onsnatch=0, synoindex_enabled=False, lms_enabled=0, lms_host=None,
@@ -1368,7 +1368,7 @@ class WebInterface(object):
# Convert the extras to list then string. Coming in as 0 or 1
temp_extras_list = []
extras_list = [single, ep, compilation, soundtrack, live, remix, spokenword, audiobook, other]
extras_list = [single, ep, compilation, soundtrack, live, remix, djmix, mixtape_street, spokenword, audiobook, broadcast, interview, other]
i = 1
for extra in extras_list: