Private GIT

Skip to content
Snippets Groups Projects
Commit b0b5980f authored by Dario's avatar Dario
Browse files

Merge pull request #424 from medariox/develop

Fixes many subtitles related issues
parents 45bac0f9 f086893e
No related branches found
No related tags found
Loading
......@@ -100,6 +100,10 @@ $('#subtitles_dir').fileBrowser({ title: 'Select Subtitles Download Directory' }
<p>Append language codes to subtitle filenames?</p>
</span>
</label>
<label>
<span class="component-title">&nbsp;</span>
<span class="component-desc"><b>NOTE:</b> This option is required if you use multiple subtitle languages.</span>
</label>
</div>
<div class="field-pair">
<label class="clearfix" for="subtitles_download_in_pp">
......
......@@ -519,9 +519,11 @@
<a class="epSearch" id="${str(show.indexerid)}x${str(epResult["season"])}x${str(epResult["episode"])}" name="${str(show.indexerid)}x${str(epResult["season"])}x${str(epResult["episode"])}" href="searchEpisode?show=${show.indexerid}&amp;season=${epResult["season"]}&amp;episode=${epResult["episode"]}"><img src="${srRoot}/images/search16.png" width="16" height="16" alt="search" title="Manual Search" /></a>
% endif
% endif
% if sickbeard.USE_SUBTITLES and show.subtitles and epResult["location"] and (len(epResult["subtitles"]) == 0 or subtitles.needs_subtitles(epResult['subtitles'])):
% if sickbeard.USE_SUBTITLES and show.subtitles and epResult["location"]:
% if (sickbeard.SUBTITLES_MULTI and subtitles.needs_subtitles(epResult["subtitles"])) or (not sickbeard.SUBTITLES_MULTI and len(subtitles.wanted_languages()) > 0 and "und" not in epResult["subtitles"] and list(subtitles.wanted_languages())[0] not in epResult["subtitles"]):
<a class="epSubtitlesSearch" href="searchEpisodeSubtitles?show=${show.indexerid}&amp;season=${epResult["season"]}&amp;episode=${epResult["episode"]}"><img src="${srRoot}/images/closed_captioning.png" height="16" alt="search subtitles" title="Search Subtitles" /></a>
% endif
% endif
</td>
</tr>
% endfor
......
......@@ -22,13 +22,25 @@
% endif
<form action="${srRoot}/manage/subtitleMissed" method="get">
% if sickbeard.SUBTITLES_MULTI:
Manage episodes without <select name="whichSubs" class="form-control form-control-inline input-sm">
<option value="all">All</option>
% for sub_code in subtitles.wanted_languages():
<option value="${sub_code}">${subtitles.name_from_code(sub_code)}</option>
% endfor
% else:
Manage episodes without <select name="whichSubs" class="form-control form-control-inline input-sm">
% if not subtitles.wanted_languages():
<option value="all">All</option>
% else:
% for index, sub_code in enumerate(subtitles.wanted_languages()):
% if index == 0:
<option value="und">${subtitles.name_from_code(sub_code)}</option>
% endif
% endfor
% endif
</select>
% endif
<input class="btn" type="submit" value="Manage" />
</form>
......@@ -36,7 +48,15 @@
##Strange that this is used by js but is an input outside of any form?
<input type="hidden" id="selectSubLang" name="selectSubLang" value="${whichSubs}" />
<form action="${srRoot}/manage/downloadSubtitleMissed" method="post">
% if sickbeard.SUBTITLES_MULTI:
<h2>Episodes without ${subsLanguage} subtitles.</h2>
% else:
% for index, sub_code in enumerate(subtitles.wanted_languages()):
% if index == 0:
<h2>Episodes without ${subtitles.name_from_code(sub_code)} (undefined) subtitles.</h2>
% endif
% endfor
% endif
<br>
Download missed subtitles for selected episodes <input class="btn btn-inline" type="submit" value="Go" />
<div>
......
......@@ -123,13 +123,13 @@ def subtitle_code_filter():
def needs_subtitles(subtitles):
if isinstance(subtitles, basestring):
if isinstance(subtitles, basestring) and sickbeard.SUBTITLES_MULTI:
subtitles = {subtitle.strip() for subtitle in subtitles.split(',')}
if sickbeard.SUBTITLES_MULTI:
return len(wanted_languages().difference(subtitles)) > 0
else:
return len(subtitles) == 0
elif 'und' not in subtitles:
return True
# Hack around this for now.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment