Merge pull request #1823 from MediaBrowser/dev

Dev
This commit is contained in:
Luke 2016-06-06 22:12:31 -04:00
commit afa2424739
11 changed files with 96 additions and 29 deletions

View File

@ -419,11 +419,6 @@ namespace MediaBrowser.Api
series.Status = request.SeriesStatus; series.Status = request.SeriesStatus;
series.AirDays = request.AirDays; series.AirDays = request.AirDays;
series.AirTime = request.AirTime; series.AirTime = request.AirTime;
if (request.DisplaySpecialsWithSeasons.HasValue)
{
series.DisplaySpecialsWithSeasons = request.DisplaySpecialsWithSeasons.Value;
}
} }
} }

View File

@ -221,7 +221,7 @@ namespace MediaBrowser.Api.Subtitles
if (string.Equals(request.Format, "vtt", StringComparison.OrdinalIgnoreCase) && request.AddVttTimeMap) if (string.Equals(request.Format, "vtt", StringComparison.OrdinalIgnoreCase) && request.AddVttTimeMap)
{ {
//text = text.Replace("WEBVTT", "WEBVTT\nX-TIMESTAMP-MAP=MPEGTS:900000,LOCAL:00:00:00.000"); text = text.Replace("WEBVTT", "WEBVTT\nX-TIMESTAMP-MAP=MPEGTS:900000,LOCAL:00:00:00.000");
} }
return ResultFactory.GetResult(text, MimeTypes.GetMimeType("file." + request.Format)); return ResultFactory.GetResult(text, MimeTypes.GetMimeType("file." + request.Format));

View File

@ -31,7 +31,6 @@ namespace MediaBrowser.Controller.Entities.TV
RemoteTrailers = new List<MediaUrl>(); RemoteTrailers = new List<MediaUrl>();
LocalTrailerIds = new List<Guid>(); LocalTrailerIds = new List<Guid>();
RemoteTrailerIds = new List<Guid>(); RemoteTrailerIds = new List<Guid>();
DisplaySpecialsWithSeasons = true;
} }
[IgnoreDataMember] [IgnoreDataMember]
@ -58,8 +57,6 @@ namespace MediaBrowser.Controller.Entities.TV
} }
} }
public bool DisplaySpecialsWithSeasons { get; set; }
public List<Guid> LocalTrailerIds { get; set; } public List<Guid> LocalTrailerIds { get; set; }
public List<Guid> RemoteTrailerIds { get; set; } public List<Guid> RemoteTrailerIds { get; set; }
@ -357,7 +354,7 @@ namespace MediaBrowser.Controller.Entities.TV
return GetEpisodes(user, parentSeason, includeMissingEpisodes, includeVirtualUnairedEpisodes); return GetEpisodes(user, parentSeason, includeMissingEpisodes, includeVirtualUnairedEpisodes);
} }
var episodes = FilterEpisodesBySeason(allSeriesEpisodes, parentSeason, DisplaySpecialsWithSeasons); var episodes = FilterEpisodesBySeason(allSeriesEpisodes, parentSeason, ConfigurationManager.Configuration.DisplaySpecialsWithinSeasons);
if (!includeMissingEpisodes) if (!includeMissingEpisodes)
{ {

View File

@ -408,7 +408,9 @@ namespace MediaBrowser.MediaEncoding.Probing
Level = streamInfo.level, Level = streamInfo.level,
Index = streamInfo.index, Index = streamInfo.index,
PixelFormat = streamInfo.pix_fmt, PixelFormat = streamInfo.pix_fmt,
NalLengthSize = streamInfo.nal_length_size NalLengthSize = streamInfo.nal_length_size,
TimeBase = streamInfo.time_base,
CodecTimeBase = streamInfo.codec_time_base
}; };
if (string.Equals(streamInfo.is_avc, "true", StringComparison.OrdinalIgnoreCase) || if (string.Equals(streamInfo.is_avc, "true", StringComparison.OrdinalIgnoreCase) ||

View File

@ -200,6 +200,7 @@ namespace MediaBrowser.Model.Configuration
public bool EnableLocalizedGuids { get; set; } public bool EnableLocalizedGuids { get; set; }
public bool EnableFolderView { get; set; } public bool EnableFolderView { get; set; }
public bool EnableGroupingIntoCollections { get; set; } public bool EnableGroupingIntoCollections { get; set; }
public bool DisplaySpecialsWithinSeasons { get; set; }
/// <summary> /// <summary>
/// Initializes a new instance of the <see cref="ServerConfiguration" /> class. /// Initializes a new instance of the <see cref="ServerConfiguration" /> class.
@ -210,6 +211,7 @@ namespace MediaBrowser.Model.Configuration
EnableCustomPathSubFolders = true; EnableCustomPathSubFolders = true;
EnableLocalizedGuids = true; EnableLocalizedGuids = true;
DisplaySpecialsWithinSeasons = true;
ImageSavingConvention = ImageSavingConvention.Compatible; ImageSavingConvention = ImageSavingConvention.Compatible;
PublicPort = 8096; PublicPort = 8096;

View File

@ -36,6 +36,9 @@ namespace MediaBrowser.Model.Entities
/// <value>The comment.</value> /// <value>The comment.</value>
public string Comment { get; set; } public string Comment { get; set; }
public string TimeBase { get; set; }
public string CodecTimeBase { get; set; }
public string Title { get; set; } public string Title { get; set; }
public string DisplayTitle public string DisplayTitle

View File

@ -76,11 +76,6 @@ namespace MediaBrowser.Providers.TV
{ {
targetItem.AirDays = sourceItem.AirDays; targetItem.AirDays = sourceItem.AirDays;
} }
if (mergeMetadataSettings)
{
targetItem.DisplaySpecialsWithSeasons = sourceItem.DisplaySpecialsWithSeasons;
}
} }
} }
} }

View File

@ -1466,11 +1466,6 @@ namespace MediaBrowser.Server.Implementations.Dto
dto.AirTime = series.AirTime; dto.AirTime = series.AirTime;
dto.SeriesStatus = series.Status; dto.SeriesStatus = series.Status;
if (fields.Contains(ItemFields.Settings))
{
dto.DisplaySpecialsWithSeasons = series.DisplaySpecialsWithSeasons;
}
dto.AnimeSeriesIndex = series.AnimeSeriesIndex; dto.AnimeSeriesIndex = series.AnimeSeriesIndex;
} }

View File

@ -41,9 +41,8 @@ namespace MediaBrowser.Server.Implementations.LiveTv.Listings
public Task<IEnumerable<ProgramInfo>> GetProgramsAsync(ListingsProviderInfo info, string channelNumber, string channelName, DateTime startDateUtc, DateTime endDateUtc, CancellationToken cancellationToken) public Task<IEnumerable<ProgramInfo>> GetProgramsAsync(ListingsProviderInfo info, string channelNumber, string channelName, DateTime startDateUtc, DateTime endDateUtc, CancellationToken cancellationToken)
{ {
var reader = new XmlTvReader(info.Path, GetLanguage(), null); var reader = new XmlTvReader(info.Path, GetLanguage(), null);
string mappedChannel = channelNumber;
var results = reader.GetProgrammes(mappedChannel, startDateUtc, endDateUtc, cancellationToken); var results = reader.GetProgrammes(channelNumber, startDateUtc, endDateUtc, cancellationToken);
return Task.FromResult(results.Select(p => new ProgramInfo() return Task.FromResult(results.Select(p => new ProgramInfo()
{ {
ChannelId = p.ChannelId, ChannelId = p.ChannelId,
@ -61,10 +60,10 @@ namespace MediaBrowser.Server.Implementations.LiveTv.Listings
IsSeries = p.IsSeries, IsSeries = p.IsSeries,
IsRepeat = p.IsRepeat, IsRepeat = p.IsRepeat,
// IsPremiere = !p.PreviouslyShown.HasValue, // IsPremiere = !p.PreviouslyShown.HasValue,
IsKids = p.Categories.Any(info.KidsCategories.Contains), IsKids = p.Categories.Any(c => info.KidsCategories.Contains(c, StringComparer.InvariantCultureIgnoreCase)),
IsMovie = p.Categories.Any(info.MovieCategories.Contains), IsMovie = p.Categories.Any(c => info.MovieCategories.Contains(c, StringComparer.InvariantCultureIgnoreCase)),
IsNews = p.Categories.Any(info.NewsCategories.Contains), IsNews = p.Categories.Any(c => info.NewsCategories.Contains(c, StringComparer.InvariantCultureIgnoreCase)),
IsSports = p.Categories.Any(info.SportsCategories.Contains), IsSports = p.Categories.Any(c => info.SportsCategories.Contains(c, StringComparer.InvariantCultureIgnoreCase)),
ImageUrl = p.Icon != null && !String.IsNullOrEmpty(p.Icon.Source) ? p.Icon.Source : null, ImageUrl = p.Icon != null && !String.IsNullOrEmpty(p.Icon.Source) ? p.Icon.Source : null,
HasImage = p.Icon != null && !String.IsNullOrEmpty(p.Icon.Source), HasImage = p.Icon != null && !String.IsNullOrEmpty(p.Icon.Source),
OfficialRating = p.Rating != null && !String.IsNullOrEmpty(p.Rating.Value) ? p.Rating.Value : null, OfficialRating = p.Rating != null && !String.IsNullOrEmpty(p.Rating.Value) ? p.Rating.Value : null,

View File

@ -28,6 +28,8 @@ namespace MediaBrowser.Server.Implementations.Persistence
AddNalColumn(); AddNalColumn();
AddIsAvcColumn(); AddIsAvcColumn();
AddTitleColumn(); AddTitleColumn();
AddTimeBaseColumn();
AddCodecTimeBaseColumn();
} }
private void AddIsAvcColumn() private void AddIsAvcColumn()
@ -61,6 +63,68 @@ namespace MediaBrowser.Server.Implementations.Persistence
_connection.RunQueries(new[] { builder.ToString() }, _logger); _connection.RunQueries(new[] { builder.ToString() }, _logger);
} }
private void AddTimeBaseColumn()
{
using (var cmd = _connection.CreateCommand())
{
cmd.CommandText = "PRAGMA table_info(mediastreams)";
using (var reader = cmd.ExecuteReader(CommandBehavior.SequentialAccess | CommandBehavior.SingleResult))
{
while (reader.Read())
{
if (!reader.IsDBNull(1))
{
var name = reader.GetString(1);
if (string.Equals(name, "TimeBase", StringComparison.OrdinalIgnoreCase))
{
return;
}
}
}
}
}
var builder = new StringBuilder();
builder.AppendLine("alter table mediastreams");
builder.AppendLine("add column TimeBase TEXT");
_connection.RunQueries(new[] { builder.ToString() }, _logger);
}
private void AddCodecTimeBaseColumn()
{
using (var cmd = _connection.CreateCommand())
{
cmd.CommandText = "PRAGMA table_info(mediastreams)";
using (var reader = cmd.ExecuteReader(CommandBehavior.SequentialAccess | CommandBehavior.SingleResult))
{
while (reader.Read())
{
if (!reader.IsDBNull(1))
{
var name = reader.GetString(1);
if (string.Equals(name, "CodecTimeBase", StringComparison.OrdinalIgnoreCase))
{
return;
}
}
}
}
}
var builder = new StringBuilder();
builder.AppendLine("alter table mediastreams");
builder.AppendLine("add column CodecTimeBase TEXT");
_connection.RunQueries(new[] { builder.ToString() }, _logger);
}
private void AddTitleColumn() private void AddTitleColumn()
{ {
using (var cmd = _connection.CreateCommand()) using (var cmd = _connection.CreateCommand())

View File

@ -130,7 +130,7 @@ namespace MediaBrowser.Server.Implementations.Persistence
_connection = await dbConnector.Connect(dbFile).ConfigureAwait(false); _connection = await dbConnector.Connect(dbFile).ConfigureAwait(false);
var createMediaStreamsTableCommand var createMediaStreamsTableCommand
= "create table if not exists mediastreams (ItemId GUID, StreamIndex INT, StreamType TEXT, Codec TEXT, Language TEXT, ChannelLayout TEXT, Profile TEXT, AspectRatio TEXT, Path TEXT, IsInterlaced BIT, BitRate INT NULL, Channels INT NULL, SampleRate INT NULL, IsDefault BIT, IsForced BIT, IsExternal BIT, Height INT NULL, Width INT NULL, AverageFrameRate FLOAT NULL, RealFrameRate FLOAT NULL, Level FLOAT NULL, PixelFormat TEXT, BitDepth INT NULL, IsAnamorphic BIT NULL, RefFrames INT NULL, CodecTag TEXT NULL, Comment TEXT NULL, NalLengthSize TEXT NULL, IsAvc BIT NULL, Title TEXT NULL, PRIMARY KEY (ItemId, StreamIndex))"; = "create table if not exists mediastreams (ItemId GUID, StreamIndex INT, StreamType TEXT, Codec TEXT, Language TEXT, ChannelLayout TEXT, Profile TEXT, AspectRatio TEXT, Path TEXT, IsInterlaced BIT, BitRate INT NULL, Channels INT NULL, SampleRate INT NULL, IsDefault BIT, IsForced BIT, IsExternal BIT, Height INT NULL, Width INT NULL, AverageFrameRate FLOAT NULL, RealFrameRate FLOAT NULL, Level FLOAT NULL, PixelFormat TEXT, BitDepth INT NULL, IsAnamorphic BIT NULL, RefFrames INT NULL, CodecTag TEXT NULL, Comment TEXT NULL, NalLengthSize TEXT NULL, IsAvc BIT NULL, Title TEXT NULL, TimeBase TEXT NULL, CodecTimeBase TEXT NULL, PRIMARY KEY (ItemId, StreamIndex))";
string[] queries = { string[] queries = {
@ -368,7 +368,9 @@ namespace MediaBrowser.Server.Implementations.Persistence
"Comment", "Comment",
"NalLengthSize", "NalLengthSize",
"IsAvc", "IsAvc",
"Title" "Title",
"TimeBase",
"CodecTimeBase"
}; };
/// <summary> /// <summary>
@ -3805,6 +3807,9 @@ namespace MediaBrowser.Server.Implementations.Persistence
_saveStreamCommand.GetParameter(index++).Value = stream.IsAVC; _saveStreamCommand.GetParameter(index++).Value = stream.IsAVC;
_saveStreamCommand.GetParameter(index++).Value = stream.Title; _saveStreamCommand.GetParameter(index++).Value = stream.Title;
_saveStreamCommand.GetParameter(index++).Value = stream.TimeBase;
_saveStreamCommand.GetParameter(index++).Value = stream.CodecTimeBase;
_saveStreamCommand.Transaction = transaction; _saveStreamCommand.Transaction = transaction;
_saveStreamCommand.ExecuteNonQuery(); _saveStreamCommand.ExecuteNonQuery();
} }
@ -3977,6 +3982,16 @@ namespace MediaBrowser.Server.Implementations.Persistence
item.Title = reader.GetString(29); item.Title = reader.GetString(29);
} }
if (!reader.IsDBNull(30))
{
item.TimeBase = reader.GetString(30);
}
if (!reader.IsDBNull(31))
{
item.CodecTimeBase = reader.GetString(31);
}
return item; return item;
} }