Skip to content

Commit

Permalink
Add option to ignore unknown subbed releases (#411)
Browse files Browse the repository at this point in the history
* Add option to ignore unknown subbed releases

* Remove hardcoded 'dubbed'. User should use ignore_words
  • Loading branch information
fernandog committed Apr 19, 2016
1 parent 0b13ff3 commit b776d65
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 7 deletions.
11 changes: 11 additions & 0 deletions gui/slick/views/config_search.mako
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,17 @@
</label>
</div>
<div class="field-pair">
<label for="ignore_und_subs">
<span class="component-title">Ignore unknown subbed releases</span>
<span class="component-desc">
<input type="checkbox" name="ignore_und_subs" id="ignore_und_subs" ${('', 'checked="checked"')[bool(sickbeard.IGNORE_UND_SUBS)]}/>
Ignore subbed releases without language names <br>
Filter words: subbed, subpack, subbed, subs, etc.)
</span>
</label>
</div>
<div class="field-pair">
<label for="allow_high_priority">
<span class="component-title">Allow high priority</span>
Expand Down
7 changes: 5 additions & 2 deletions sickbeard/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -562,7 +562,7 @@

EXTRA_SCRIPTS = []

IGNORE_WORDS = "german,french,core2hd,dutch,swedish,reenc,MrLss"
IGNORE_WORDS = "german,french,core2hd,dutch,swedish,reenc,MrLss,dubbed"

PREFERRED_WORDS = ""

Expand All @@ -575,6 +575,7 @@

REQUIRE_WORDS = ""
IGNORED_SUBS_LIST = "dk,fin,heb,kor,nor,nordic,pl,swe"
IGNORE_UND_SUBS = False
SYNC_FILES = "!sync,lftp-pget-status,part,bts,!qb,!qB"

CALENDAR_UNPROTECTED = False
Expand Down Expand Up @@ -644,7 +645,7 @@ def initialize(consoleLogging=True): # pylint: disable=too-many-locals, too-man
NEWZBIN, NEWZBIN_USERNAME, NEWZBIN_PASSWORD, GIT_PATH, MOVE_ASSOCIATED_FILES, SYNC_FILES, POSTPONE_IF_SYNC_FILES, POSTPONE_IF_NO_SUBS, dailySearchScheduler, NFO_RENAME, \
GUI_NAME, HOME_LAYOUT, HISTORY_LAYOUT, DISPLAY_SHOW_SPECIALS, COMING_EPS_LAYOUT, COMING_EPS_SORT, COMING_EPS_DISPLAY_PAUSED, COMING_EPS_MISSED_RANGE, FUZZY_DATING, TRIM_ZERO, DATE_PRESET, TIME_PRESET, TIME_PRESET_W_SECONDS, THEME_NAME, \
POSTER_SORTBY, POSTER_SORTDIR, HISTORY_LIMIT, CREATE_MISSING_SHOW_DIRS, ADD_SHOWS_WO_DIR, \
METADATA_WDTV, METADATA_TIVO, METADATA_MEDE8ER, IGNORE_WORDS, PREFERRED_WORDS, UNDESIRED_WORDS, TRACKERS_LIST, IGNORED_SUBS_LIST, REQUIRE_WORDS, CALENDAR_UNPROTECTED, CALENDAR_ICONS, NO_RESTART, \
METADATA_WDTV, METADATA_TIVO, METADATA_MEDE8ER, IGNORE_WORDS, PREFERRED_WORDS, UNDESIRED_WORDS, TRACKERS_LIST, IGNORED_SUBS_LIST, REQUIRE_WORDS, CALENDAR_UNPROTECTED, CALENDAR_ICONS, NO_RESTART, IGNORE_UND_SUBS, \
USE_SUBTITLES, SUBTITLES_LANGUAGES, SUBTITLES_DIR, SUBTITLES_SERVICES_LIST, SUBTITLES_SERVICES_ENABLED, SUBTITLES_HISTORY, SUBTITLES_FINDER_FREQUENCY, SUBTITLES_MULTI, SUBTITLES_DOWNLOAD_IN_PP, SUBTITLES_KEEP_ONLY_WANTED, EMBEDDED_SUBTITLES_ALL, SUBTITLES_EXTRA_SCRIPTS, SUBTITLES_PRE_SCRIPTS, SUBTITLES_PERFECT_MATCH, subtitlesFinderScheduler, \
SUBTITLES_HEARING_IMPAIRED, ADDIC7ED_USER, ADDIC7ED_PASS, ITASA_USER, ITASA_PASS, LEGENDASTV_USER, LEGENDASTV_PASS, OPENSUBTITLES_USER, OPENSUBTITLES_PASS, \
USE_FAILED_DOWNLOADS, DELETE_FAILED, ANON_REDIRECT, LOCALHOST_IP, DEBUG, DBDEBUG, DEFAULT_PAGE, SEEDERS_LEECHERS_IN_NOTIFY, PROXY_SETTING, PROXY_INDEXERS, \
Expand Down Expand Up @@ -1230,6 +1231,7 @@ def path_leaf(path):
TRACKERS_LIST = check_setting_str(CFG, 'General', 'trackers_list', TRACKERS_LIST)
REQUIRE_WORDS = check_setting_str(CFG, 'General', 'require_words', REQUIRE_WORDS)
IGNORED_SUBS_LIST = check_setting_str(CFG, 'General', 'ignored_subs_list', IGNORED_SUBS_LIST)
IGNORE_UND_SUBS = bool(check_setting_int(CFG, 'General', 'ignore_und_subs', IGNORE_UND_SUBS))

CALENDAR_UNPROTECTED = bool(check_setting_int(CFG, 'General', 'calendar_unprotected', 0))
CALENDAR_ICONS = bool(check_setting_int(CFG, 'General', 'calendar_icons', 0))
Expand Down Expand Up @@ -1803,6 +1805,7 @@ def save_config(): # pylint: disable=too-many-statements, too-many-branches
new_config['General']['trackers_list'] = TRACKERS_LIST
new_config['General']['require_words'] = REQUIRE_WORDS
new_config['General']['ignored_subs_list'] = IGNORED_SUBS_LIST
new_config['General']['ignore_und_subs'] = IGNORE_UND_SUBS
new_config['General']['calendar_unprotected'] = int(CALENDAR_UNPROTECTED)
new_config['General']['calendar_icons'] = int(CALENDAR_ICONS)
new_config['General']['no_restart'] = int(NO_RESTART)
Expand Down
5 changes: 3 additions & 2 deletions sickbeard/show_name_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,14 @@
from collections import namedtuple

resultFilters = [
"sub(bed|ed|pack|s)",
"(dir|sub|nfo)fix",
"(?<!shomin.)sample",
"(dvd)?extras",
"dub(bed)?"
]

if hasattr('General', 'ignore_und_subs') and sickbeard.IGNORE_UND_SUBS:
resultFilters.append("sub(bed|ed|pack|s)")

if hasattr('General', 'ignored_subs_list') and sickbeard.IGNORED_SUBS_LIST:
resultFilters.append("(" + sickbeard.IGNORED_SUBS_LIST.replace(",", "|") + ")sub(bed|ed|s)?")

Expand Down
3 changes: 2 additions & 1 deletion sickbeard/webserve.py
Original file line number Diff line number Diff line change
Expand Up @@ -4276,7 +4276,7 @@ def saveSearch(self, use_nzbs=None, use_torrents=None, nzb_dir=None, sab_usernam
torrent_dir=None, torrent_username=None, torrent_password=None, torrent_host=None,
torrent_label=None, torrent_label_anime=None, torrent_path=None, torrent_verify_cert=None,
torrent_seed_time=None, torrent_paused=None, torrent_high_bandwidth=None,
torrent_rpcurl=None, torrent_auth_type=None, ignore_words=None, preferred_words=None, undesired_words=None, trackers_list=None, require_words=None, ignored_subs_list=None):
torrent_rpcurl=None, torrent_auth_type=None, ignore_words=None, preferred_words=None, undesired_words=None, trackers_list=None, require_words=None, ignored_subs_list=None, ignore_und_subs=None):

results = []

Expand Down Expand Up @@ -4304,6 +4304,7 @@ def saveSearch(self, use_nzbs=None, use_torrents=None, nzb_dir=None, sab_usernam
sickbeard.TRACKERS_LIST = trackers_list if trackers_list else ""
sickbeard.REQUIRE_WORDS = require_words if require_words else ""
sickbeard.IGNORED_SUBS_LIST = ignored_subs_list if ignored_subs_list else ""
sickbeard.IGNORE_UND_SUBS = config.checkbox_to_value(ignore_und_subs)

sickbeard.RANDOMIZE_PROVIDERS = config.checkbox_to_value(randomize_providers)

Expand Down
3 changes: 1 addition & 2 deletions tests/scene_helpers_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,7 @@ def test_filter_bad_releases(self):
"""
Test filtering of bad releases
"""
self._test_filter_bad_releases('Show.S02.SUBBED', False)
self._test_filter_bad_releases('Show.S02.DUBBED', False)
self._test_filter_bad_releases('Show.S02.SAMPLE', False)
self._test_filter_bad_releases('Show.S02', True)
self._test_filter_bad_releases('Show.S02.DVDEXTRAS', False)

Expand Down

0 comments on commit b776d65

Please sign in to comment.