Merge pull request #2236 from MediaBrowser/dev

Dev
This commit is contained in:
Luke 2016-10-15 18:17:32 -04:00 committed by GitHub
commit 69f5c28bad
6 changed files with 31 additions and 15 deletions

View File

@ -182,7 +182,7 @@ namespace MediaBrowser.Controller.Entities
case ItemFields.HomePageUrl:
case ItemFields.VoteCount:
case ItemFields.DisplayMediaType:
case ItemFields.ServiceName:
//case ItemFields.ServiceName:
case ItemFields.Genres:
case ItemFields.Studios:
case ItemFields.Settings:

View File

@ -1,4 +1,5 @@
using System.Collections.Generic;
using System;
using System.Collections.Generic;
using MediaBrowser.Model.Dlna;
using MediaBrowser.Model.Extensions;
using System.Diagnostics;
@ -47,7 +48,7 @@ namespace MediaBrowser.Model.Entities
{
if (!string.IsNullOrEmpty(Title))
{
return Title;
return AddLanguageIfNeeded(Title);
}
if (Type == MediaStreamType.Audio)
@ -115,6 +116,16 @@ namespace MediaBrowser.Model.Entities
}
}
private string AddLanguageIfNeeded(string title)
{
if (!string.IsNullOrEmpty(Language) && title.IndexOf(Language, StringComparison.OrdinalIgnoreCase) == -1)
{
title = StringHelper.FirstToUpper(Language) + " " + title;
}
return title;
}
public string NalLengthSize { get; set; }
/// <summary>

View File

@ -360,6 +360,7 @@ namespace MediaBrowser.Server.Implementations.Library
public async Task<LiveStreamResponse> OpenLiveStream(LiveStreamRequest request, bool enableAutoClose, CancellationToken cancellationToken)
{
enableAutoClose = false;
await _liveStreamSemaphore.WaitAsync(cancellationToken).ConfigureAwait(false);
try

View File

@ -85,6 +85,12 @@ namespace MediaBrowser.Server.Implementations.Library.Resolvers.TV
{
if (args.ContainsFileSystemEntryByName("tvshow.nfo"))
{
if (args.Parent.IsRoot)
{
// For now, return null, but if we want to allow this in the future then add some additional checks to guard against a misplaced tvshow.nfo
return null;
}
return new Series
{
Path = args.Path,

View File

@ -1752,7 +1752,7 @@ namespace MediaBrowser.Server.Implementations.LiveTv
public async Task AddInfoToProgramDto(List<Tuple<BaseItem, BaseItemDto>> tuples, List<ItemFields> fields, User user = null)
{
var recordingTuples = new List<Tuple<BaseItemDto, string, string, string>>();
var programTuples = new List<Tuple<BaseItemDto, string, string, string>>();
foreach (var tuple in tuples)
{
@ -1812,18 +1812,17 @@ namespace MediaBrowser.Server.Implementations.LiveTv
}
}
var service = GetService(program);
var serviceName = service == null ? null : service.Name;
var serviceName = program.ServiceName;
if (fields.Contains(ItemFields.ServiceName))
{
dto.ServiceName = serviceName;
}
recordingTuples.Add(new Tuple<BaseItemDto, string, string, string>(dto, serviceName, program.ExternalId, program.ExternalSeriesIdLegacy));
programTuples.Add(new Tuple<BaseItemDto, string, string, string>(dto, serviceName, program.ExternalId, program.ExternalSeriesIdLegacy));
}
await AddRecordingInfo(recordingTuples, CancellationToken.None).ConfigureAwait(false);
await AddRecordingInfo(programTuples, CancellationToken.None).ConfigureAwait(false);
}
public void AddInfoToRecordingDto(BaseItem item, BaseItemDto dto, User user = null)

View File

@ -1188,7 +1188,7 @@ namespace MediaBrowser.Server.Implementations.Persistence
public ItemImageInfo ItemImageInfoFromValueString(string value)
{
var parts = value.Split(new[] { '*' }, StringSplitOptions.RemoveEmptyEntries);
var parts = value.Split(new[] { '*' }, StringSplitOptions.None);
var image = new ItemImageInfo();
@ -1633,14 +1633,13 @@ namespace MediaBrowser.Server.Implementations.Persistence
}
index++;
if (query.HasField(ItemFields.ServiceName))
// TODO: Even if not needed by apps, the server needs it internally
// But get this excluded from contexts where it is not needed
if (!reader.IsDBNull(index))
{
if (!reader.IsDBNull(index))
{
item.ServiceName = reader.GetString(index);
}
index++;
item.ServiceName = reader.GetString(index);
}
index++;
if (!reader.IsDBNull(index))
{