Skip to content

Commit

Permalink
3.0.5387 Beta
Browse files Browse the repository at this point in the history
  • Loading branch information
LukePulverenti committed Oct 2, 2014
1 parent b978ffa commit 5bbf58b
Show file tree
Hide file tree
Showing 4 changed files with 190 additions and 161 deletions.
21 changes: 19 additions & 2 deletions MediaBrowser.Server.Implementations/Intros/DefaultIntroProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public async Task<IEnumerable<IntroInfo>> GetIntros(BaseItem item, User user)
{
if (i is Movie)
{
return true;
return !IsDuplicate(item, i);
}
}
return false;
Expand Down Expand Up @@ -162,7 +162,7 @@ public async Task<IEnumerable<IntroInfo>> GetIntros(BaseItem item, User user)
{
return false;
}
return true;
return !IsDuplicate(item, i.Item);
})
.OrderByDescending(i => i.Score)
.ThenBy(i => Guid.NewGuid())
Expand All @@ -172,6 +172,23 @@ public async Task<IEnumerable<IntroInfo>> GetIntros(BaseItem item, User user)
.Concat(customIntros.Take(1));
}

private bool IsDuplicate(BaseItem playingContent, BaseItem test)
{
var id = playingContent.GetProviderId(MetadataProviders.Imdb);
if (!string.IsNullOrWhiteSpace(id) && string.Equals(id, test.GetProviderId(MetadataProviders.Imdb), StringComparison.OrdinalIgnoreCase))
{
return true;
}

id = playingContent.GetProviderId(MetadataProviders.Tmdb);
if (!string.IsNullOrWhiteSpace(id) && string.Equals(id, test.GetProviderId(MetadataProviders.Tmdb), StringComparison.OrdinalIgnoreCase))
{
return true;
}

return false;
}

private CinemaModeConfiguration GetOptions()
{
return _serverConfig.GetConfiguration<CinemaModeConfiguration>("cinemamode");
Expand Down
4 changes: 4 additions & 0 deletions MediaBrowser.Server.Implementations/Session/SessionManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1417,6 +1417,10 @@ private async Task SaveCapabilities(string deviceId, SessionCapabilities capabil
{
_jsonSerializer.SerializeToFile(capabilities, path);
}
catch (Exception ex)
{
_logger.ErrorException("Error saving to {0}", ex, path);
}
finally
{
_capabilitiesLock.Release();
Expand Down
92 changes: 47 additions & 45 deletions MediaBrowser.WebDashboard/dashboard-ui/mypreferenceslanguages.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,64 +14,66 @@

<br />
<form style="margin: 0 auto;" class="languagePreferencesForm">
<div class="detailSectionHeader">
<div class="detailSectionHeader" style="margin: 0 .5em;">
${HeaderLanguagePreferences}
</div>

<br />
<div>
<label for="selectAudioLanguage">${LabelAudioLanguagePreference}</label>
<select id="selectAudioLanguage" data-mini="true"></select>
</div><br />
<div>
<input type="checkbox" id="chkPlayDefaultAudioTrack" data-mini="true" />
<label for="chkPlayDefaultAudioTrack">${LabelPlayDefaultAudioTrack}</label>
</div><br />
<div>
<label for="selectSubtitleLanguage">${LabelSubtitleLanguagePreference}</label>
<select id="selectSubtitleLanguage" data-mini="true"></select>
</div><br />
<div>
<label for="selectSubtitlePlaybackMode">${LabelSubtitlePlaybackMode}</label>
<select id="selectSubtitlePlaybackMode" data-mini="true">
<option value="Default">${OptionDefaultSubtitles}</option>
<option value="OnlyForced">${OptionOnlyForcedSubtitles}</option>
<option value="Always">${OptionAlwaysPlaySubtitles}</option>
<option value="None">${OptionNoSubtitles}</option>
</select>
<div class="fieldDescription subtitlesDefaultHelp subtitlesHelp" style="display: none;">${OptionDefaultSubtitlesHelp}</div>
<div class="fieldDescription subtitlesAlwaysHelp subtitlesHelp" style="display: none;">${OptionAlwaysPlaySubtitlesHelp}</div>
<div class="fieldDescription subtitlesOnlyForcedHelp subtitlesHelp" style="display: none;">${OptionOnlyForcedSubtitlesHelp}</div>
<div class="fieldDescription subtitlesNoneHelp subtitlesHelp" style="display: none;">${OptionNoSubtitlesHelp}</div>
</div>

<br /><br />
<ul data-role="listview" class="ulForm">
<li>
<label for="selectAudioLanguage">${LabelAudioLanguagePreference}</label>
<select id="selectAudioLanguage" data-mini="true"></select>
</li>
<li>
<input type="checkbox" id="chkPlayDefaultAudioTrack" data-mini="true" />
<label for="chkPlayDefaultAudioTrack">${LabelPlayDefaultAudioTrack}</label>
</li>
<li>
<label for="selectSubtitleLanguage">${LabelSubtitleLanguagePreference}</label>
<select id="selectSubtitleLanguage" data-mini="true"></select>
</li>
<li>
<label for="selectSubtitlePlaybackMode">${LabelSubtitlePlaybackMode}</label>
<select id="selectSubtitlePlaybackMode" data-mini="true">
<option value="Default">${OptionDefaultSubtitles}</option>
<option value="OnlyForced">${OptionOnlyForcedSubtitles}</option>
<option value="Always">${OptionAlwaysPlaySubtitles}</option>
<option value="None">${OptionNoSubtitles}</option>
</select>
<div class="fieldDescription subtitlesDefaultHelp subtitlesHelp" style="display: none;">${OptionDefaultSubtitlesHelp}</div>
<div class="fieldDescription subtitlesAlwaysHelp subtitlesHelp" style="display: none;">${OptionAlwaysPlaySubtitlesHelp}</div>
<div class="fieldDescription subtitlesOnlyForcedHelp subtitlesHelp" style="display: none;">${OptionOnlyForcedSubtitlesHelp}</div>
<div class="fieldDescription subtitlesNoneHelp subtitlesHelp" style="display: none;">${OptionNoSubtitlesHelp}</div>
</li>
</ul>
<div class="cinemaModeOptions" style="display:none;">
<br />
<div class="detailSectionHeader">
<div class="detailSectionHeader" style="margin: 0 .5em;">
${HeaderCinemaMode}
</div>
<br />
<div>
<input type="checkbox" id="chkEnableCinemaMode" data-mini="true" />
<label for="chkEnableCinemaMode">${LabelEnableCinemaMode}</label>
<ul data-role="listview" class="ulForm">
<li>
<input type="checkbox" id="chkEnableCinemaMode" data-mini="true" />
<label for="chkEnableCinemaMode">${LabelEnableCinemaMode}</label>

<div class="fieldDescription">${CinemaModeConfigurationHelp}</div>
</div>
<br /><br />
</div>
<div>
<button type="submit" data-theme="a" data-icon="check" data-mini="true">
${ButtonOk}
</button>
<button type="button" onclick="history.back();" data-icon="delete" data-mini="true">
${ButtonCancel}
</button>
<div class="fieldDescription">${CinemaModeConfigurationHelp}</div>
</li>
</ul>
</div>
<ul data-role="listview" class="ulForm">
<li>
<button type="submit" data-theme="a" data-icon="check" data-mini="true">
${ButtonOk}
</button>
<button type="button" onclick="history.back();" data-icon="delete" data-mini="true">
${ButtonCancel}
</button>
</li>
</ul>
</form>
<script type="text/javascript">
$('.languagePreferencesForm').off('submit', LanguagePreferencesPage.onSubmit).on('submit', LanguagePreferencesPage.onSubmit);
</script>
</div>
</body>
</html>
</html>
Loading

0 comments on commit 5bbf58b

Please sign in to comment.