Merge remote-tracking branch 'upstream/develop' into feature/travis-ci

* upstream/develop:
  Cue split config option

Conflicts:
	headphones/cuesplit.py
	headphones/postprocessor.py
	headphones/webserve.py
This commit is contained in:
Jesse Mullan
2014-11-01 20:46:52 -07:00
5 changed files with 11 additions and 4 deletions

View File

@@ -709,6 +709,11 @@
<td>
<fieldset>
<legend>Post-Processing</legend>
<div class="row checkbox left clearfix">
<label title="Use associated .cue sheet to split single file albums into multiple tracks. Requires shntool with flac or xld cli (OS X) to be installed.">
Split single file albums into multiple tracks
<input type="checkbox" name="cue_split" id="cue_split" value="1" ${config['cue_split']} />
</label>
<div class="row checkbox left clearfix">
<label title="Freeze the database, so new artists won't be added automatically. Use this if Headphones adds artists because due to wrong snatches. This check is skipped when the folder name is appended with release group ID.">
Freeze database for adding new artist

View File

@@ -41,6 +41,7 @@ _CONFIG_DEFINITIONS = {
'CLEANUP_FILES': (int, 'General', 0),
'CONFIG_VERSION': (str, 'General', '0'),
'CORRECT_METADATA': (int, 'General', 0),
'CUE_SPLIT': (int, 'General', 1),
'CUSTOMHOST': (str, 'General', 'localhost'),
'CUSTOMPORT': (int, 'General', 5000),
'CUSTOMSLEEP': (int, 'General', 1),

View File

@@ -216,7 +216,7 @@ class Directory:
# TODO: not part of other value such as year
return n
list_dir = glob.glob(os.path.join(self.path, '*'))
list_dir = glob.glob1(self.path, '*')
# TODO: for some reason removes only one file
rem_list = []

View File

@@ -180,7 +180,7 @@ def verify(albumid, albumpath, Kind=None, forced=False):
return
# Split cue
if downloaded_cuecount and downloaded_cuecount >= len(downloaded_track_list):
if headphones.CONFIG.CUE_SPLIT and downloaded_cuecount and downloaded_cuecount >= len(downloaded_track_list):
if headphones.CONFIG.KEEP_TORRENT_FILES and Kind == "torrent":
albumpath = helpers.preserve_torrent_direcory(albumpath)
if albumpath and helpers.cue_split(albumpath):
@@ -1145,7 +1145,7 @@ def forcePostProcess(dir=None, expand_subfolders=True, album_dir=None):
name = album = None
# Check if there's a cue to split
if not name and not album and helpers.cue_split(folder):
if headphones.CONFIG.CUE_SPLIT and not name and not album and helpers.cue_split(folder):
try:
name, album, year = helpers.extract_metadata(folder)
except Exception:

View File

@@ -1028,6 +1028,7 @@ class WebInterface(object):
"lossless_bitrate_from": headphones.CONFIG.LOSSLESS_BITRATE_FROM,
"lossless_bitrate_to": headphones.CONFIG.LOSSLESS_BITRATE_TO,
"freeze_db": checked(headphones.CONFIG.FREEZE_DB),
"cue_split": checked(headphones.CONFIG.CUE_SPLIT),
"move_files": checked(headphones.CONFIG.MOVE_FILES),
"rename_files": checked(headphones.CONFIG.RENAME_FILES),
"correct_metadata": checked(headphones.CONFIG.CORRECT_METADATA),
@@ -1174,7 +1175,7 @@ class WebInterface(object):
checked_configs = [
"launch_browser", "enable_https", "api_enabled", "use_blackhole", "headphones_indexer", "use_newznab", "newznab_enabled",
"use_nzbsorg", "use_omgwtfnzbs", "use_kat", "use_piratebay", "use_mininova", "use_waffles", "use_rutracker", "use_whatcd",
"preferred_bitrate_allow_lossless", "detect_bitrate", "freeze_db", "move_files", "rename_files", "correct_metadata",
"preferred_bitrate_allow_lossless", "detect_bitrate", "freeze_db", "cue_split", "move_files", "rename_files", "correct_metadata",
"cleanup_files", "keep_nfo", "add_album_art", "embed_album_art", "embed_lyrics", "replace_existing_folders", "file_underscores",
"include_extras", "autowant_upcoming", "autowant_all", "autowant_manually_added", "keep_torrent_files", "music_encoder",
"encoderlossless", "encoder_multicore", "delete_lossless_files", "growl_enabled", "growl_onsnatch", "prowl_enabled",