diff --git a/data/interfaces/default/config.html b/data/interfaces/default/config.html index c6925195..4b5c5ff3 100644 --- a/data/interfaces/default/config.html +++ b/data/interfaces/default/config.html @@ -724,6 +724,12 @@ Results without these words in the title will be filtered out. You can use OR: 'flac OR lossless OR alac, vinyl' +
+ +
diff --git a/headphones/config.py b/headphones/config.py index b27d48da..d3e3e301 100644 --- a/headphones/config.py +++ b/headphones/config.py @@ -105,6 +105,7 @@ _CONFIG_DEFINITIONS = { 'HTTP_ROOT': (str, 'General', '/'), 'HTTP_USERNAME': (str, 'General', ''), 'IDTAG': (int, 'Beets', 0), + 'IGNORE_CLEAN_RELEASES': (int, 'General', 0), 'IGNORED_WORDS': (str, 'General', ''), 'IGNORED_FOLDERS': (list, 'Advanced', []), 'IGNORED_FILES': (list, 'Advanced', []), diff --git a/headphones/searcher.py b/headphones/searcher.py index 549e2e05..5f38905f 100644 --- a/headphones/searcher.py +++ b/headphones/searcher.py @@ -999,6 +999,13 @@ def verifyresult(title, artistterm, term, lossless): logger.info("Removed '%s' from results because it doesn't contain required word: '%s'", title, each_word) return False + if headphones.CONFIG.IGNORE_CLEAN_RELEASES: + for each_word in ['clean','edited','censored']: + logger.debug("Checking if '%s' is in search result: '%s'", each_word, title) + if each_word.lower() in title.lower() and each_word.lower() not in term.lower(): + logger.info("Removed '%s' from results because it contains clean album word: '%s'", title, each_word) + return False + tokens = re.split('\W', term, re.IGNORECASE | re.UNICODE) for token in tokens: diff --git a/headphones/webserve.py b/headphones/webserve.py index 26b6ac76..84420d4d 100644 --- a/headphones/webserve.py +++ b/headphones/webserve.py @@ -1005,6 +1005,7 @@ class WebInterface(object): "preferred_words": headphones.CONFIG.PREFERRED_WORDS, "ignored_words": headphones.CONFIG.IGNORED_WORDS, "required_words": headphones.CONFIG.REQUIRED_WORDS, + "ignore_clean_releases": checked(headphones.CONFIG.IGNORE_CLEAN_RELEASES), "torrentblackhole_dir": headphones.CONFIG.TORRENTBLACKHOLE_DIR, "download_torrent_dir": headphones.CONFIG.DOWNLOAD_TORRENT_DIR, "numberofseeders": headphones.CONFIG.NUMBEROFSEEDERS, @@ -1205,7 +1206,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_oldpiratebay", "use_mininova", "use_waffles", "use_rutracker", - "use_whatcd", "preferred_bitrate_allow_lossless", "detect_bitrate", "freeze_db", "cue_split", "move_files", "rename_files", + "use_whatcd", "preferred_bitrate_allow_lossless", "detect_bitrate", "ignore_clean_releases", "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",