rework settings page

pull/702/head
Luke Pulverenti 9 years ago
parent 713a9e779b
commit d95057f13b

@ -1124,6 +1124,11 @@ namespace MediaBrowser.Controller.Entities
rating = OfficialRatingForComparison;
}
if (string.IsNullOrWhiteSpace(rating))
{
return null;
}
return LocalizationManager.GetRatingLevel(rating);
}

@ -1,6 +1,6 @@
using System.Collections.Generic;
using MediaBrowser.Model.Entities;
using MediaBrowser.Model.Entities;
using System;
using System.Collections.Generic;
namespace MediaBrowser.Controller.Entities
{

@ -227,5 +227,19 @@ namespace MediaBrowser.Controller.LiveTv
info.IsMovie = IsMovie;
return info;
}
public override bool SupportsPeople
{
get
{
// Optimization
if (IsNews || IsSports)
{
return false;
}
return base.SupportsPeople;
}
}
}
}

@ -7,24 +7,6 @@ namespace MediaBrowser.Controller.MediaEncoding
{
public interface ISubtitleEncoder
{
/// <summary>
/// Converts the subtitles.
/// </summary>
/// <param name="stream">The stream.</param>
/// <param name="inputFormat">The input format.</param>
/// <param name="outputFormat">The output format.</param>
/// <param name="startTimeTicks">The start time ticks.</param>
/// <param name="endTimeTicks">The end time ticks.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>Task{Stream}.</returns>
Task<Stream> ConvertSubtitles(
Stream stream,
string inputFormat,
string outputFormat,
long startTimeTicks,
long? endTimeTicks,
CancellationToken cancellationToken);
/// <summary>
/// Gets the subtitles.
/// </summary>

@ -53,7 +53,7 @@ namespace MediaBrowser.MediaEncoding.Subtitles
}
}
public async Task<Stream> ConvertSubtitles(Stream stream,
private async Task<Stream> ConvertSubtitles(Stream stream,
string inputFormat,
string outputFormat,
long startTimeTicks,
@ -64,7 +64,9 @@ namespace MediaBrowser.MediaEncoding.Subtitles
try
{
var trackInfo = await GetTrackInfo(stream, inputFormat, cancellationToken).ConfigureAwait(false);
var reader = GetReader(inputFormat, true);
var trackInfo = reader.Parse(stream, cancellationToken);
FilterEvents(trackInfo, startTimeTicks, endTimeTicks, false);
@ -190,7 +192,7 @@ namespace MediaBrowser.MediaEncoding.Subtitles
{
throw new ArgumentNullException("charset");
}
try
{
return Encoding.GetEncoding(charset);
@ -257,15 +259,6 @@ namespace MediaBrowser.MediaEncoding.Subtitles
return new Tuple<string, MediaProtocol, string, bool>(subtitleStream.Path, protocol, currentFormat, true);
}
private async Task<SubtitleTrackInfo> GetTrackInfo(Stream stream,
string inputFormat,
CancellationToken cancellationToken)
{
var reader = GetReader(inputFormat, true);
return reader.Parse(stream, cancellationToken);
}
private ISubtitleParser GetReader(string format, bool throwIfMissing)
{
if (string.IsNullOrEmpty(format))

@ -1,4 +1,5 @@
using MediaBrowser.Common.IO;
using System.ComponentModel;
using MediaBrowser.Common.IO;
using MediaBrowser.Common.ScheduledTasks;
using MediaBrowser.Controller.Configuration;
using MediaBrowser.Controller.Entities;
@ -338,7 +339,7 @@ namespace MediaBrowser.Server.Implementations.IO
}
catch
{
}
finally
{
@ -370,6 +371,17 @@ namespace MediaBrowser.Server.Implementations.IO
Logger.ErrorException("Error in Directory watcher for: " + dw.Path, ex);
DisposeWatcher(dw);
if (ex is Win32Exception)
{
Logger.Info("Disabling realtime monitor to prevent future instability");
if (ConfigurationManager.Configuration.EnableLibraryMonitor == AutoOnOff.Auto)
{
ConfigurationManager.Configuration.EnableLibraryMonitor = AutoOnOff.Disabled;
Stop();
}
}
}
/// <summary>

@ -2071,14 +2071,17 @@ namespace MediaBrowser.Server.Implementations.Library
public List<PersonInfo> GetPeople(BaseItem item)
{
var people = GetPeople(new InternalPeopleQuery
if (item.SupportsPeople)
{
ItemId = item.Id
});
var people = GetPeople(new InternalPeopleQuery
{
ItemId = item.Id
});
if (people.Count > 0)
{
return people;
if (people.Count > 0)
{
return people;
}
}
return item.People ?? new List<PersonInfo>();

@ -173,7 +173,5 @@
"HeaderProducer": "Producers",
"HeaderWriter": "Writers",
"HeaderParentalRatings": "Parental Ratings",
"HeaderCommunityRatings": "Community ratings",
"HeaderCommunityRatings": "Community ratings"
}

@ -204,6 +204,7 @@
<Content Include="dashboard-ui\mypreferenceshome.html">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="dashboard-ui\mypreferencesmenu.html" />
<Content Include="dashboard-ui\scripts\actionsheet.js">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>

Loading…
Cancel
Save