Merge pull request #2687 from MediaBrowser/dev

Dev
This commit is contained in:
Luke 2017-06-03 03:37:25 -04:00 committed by GitHub
commit 69f00aef74
62 changed files with 467 additions and 591 deletions

View File

@ -32,7 +32,7 @@
</PropertyGroup>
<ItemGroup>
<Reference Include="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
<HintPath>..\packages\NLog.4.4.9\lib\net45\NLog.dll</HintPath>
<HintPath>..\packages\NLog.4.4.10\lib\net45\NLog.dll</HintPath>
</Reference>
<Reference Include="ServiceStack.Text, Version=4.5.8.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\ServiceStack.Text.4.5.8\lib\net45\ServiceStack.Text.dll</HintPath>

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="NLog" version="4.4.9" targetFramework="net46" />
<package id="NLog" version="4.4.10" targetFramework="net46" />
<package id="ServiceStack.Text" version="4.5.8" targetFramework="net462" />
<package id="SharpCompress" version="0.14.0" targetFramework="net462" />
<package id="SimpleInjector" version="4.0.7" targetFramework="net462" />

View File

@ -1378,12 +1378,6 @@ namespace Emby.Server.Implementations.Channels
item.SetImagePath(ImageType.Primary, info.ImageUrl);
}
if (item.SourceType != SourceType.Channel)
{
item.SourceType = SourceType.Channel;
forceUpdate = true;
}
if (isNew)
{
await _libraryManager.CreateItem(item, cancellationToken).ConfigureAwait(false);

View File

@ -199,10 +199,11 @@ namespace Emby.Server.Implementations.Data
AddColumn(db, "TypedBaseItems", "ParentId", "GUID", existingColumnNames);
AddColumn(db, "TypedBaseItems", "Genres", "Text", existingColumnNames);
AddColumn(db, "TypedBaseItems", "SortName", "Text", existingColumnNames);
AddColumn(db, "TypedBaseItems", "ForcedSortName", "Text", existingColumnNames);
AddColumn(db, "TypedBaseItems", "RunTimeTicks", "BIGINT", existingColumnNames);
AddColumn(db, "TypedBaseItems", "HomePageUrl", "Text", existingColumnNames);
AddColumn(db, "TypedBaseItems", "VoteCount", "INT", existingColumnNames);
AddColumn(db, "TypedBaseItems", "DisplayMediaType", "Text", existingColumnNames);
AddColumn(db, "TypedBaseItems", "DateCreated", "DATETIME", existingColumnNames);
AddColumn(db, "TypedBaseItems", "DateModified", "DATETIME", existingColumnNames);
@ -233,7 +234,6 @@ namespace Emby.Server.Implementations.Data
AddColumn(db, "TypedBaseItems", "UnratedType", "Text", existingColumnNames);
AddColumn(db, "TypedBaseItems", "TopParentId", "Text", existingColumnNames);
AddColumn(db, "TypedBaseItems", "IsItemByName", "BIT", existingColumnNames);
AddColumn(db, "TypedBaseItems", "SourceType", "Text", existingColumnNames);
AddColumn(db, "TypedBaseItems", "TrailerTypes", "Text", existingColumnNames);
AddColumn(db, "TypedBaseItems", "CriticRating", "Float", existingColumnNames);
AddColumn(db, "TypedBaseItems", "InheritedTags", "Text", existingColumnNames);
@ -424,9 +424,8 @@ namespace Emby.Server.Implementations.Data
"OfficialRating",
"HomePageUrl",
"DisplayMediaType",
"SortName",
"ForcedSortName",
"RunTimeTicks",
"VoteCount",
"DateCreated",
"DateModified",
"guid",
@ -439,7 +438,6 @@ namespace Emby.Server.Implementations.Data
"LockedFields",
"Studios",
"Tags",
"SourceType",
"TrailerTypes",
"OriginalTitle",
"PrimaryVersionId",
@ -541,9 +539,9 @@ namespace Emby.Server.Implementations.Data
"Genres",
"InheritedParentalRatingValue",
"SortName",
"ForcedSortName",
"RunTimeTicks",
"HomePageUrl",
"VoteCount",
"DisplayMediaType",
"DateCreated",
"DateModified",
@ -563,7 +561,6 @@ namespace Emby.Server.Implementations.Data
"UnratedType",
"TopParentId",
"IsItemByName",
"SourceType",
"TrailerTypes",
"CriticRating",
"InheritedTags",
@ -815,10 +812,12 @@ namespace Emby.Server.Implementations.Data
saveItemStatement.TryBind("@InheritedParentalRatingValue", item.InheritedParentalRatingValue);
saveItemStatement.TryBind("@SortName", item.SortName);
saveItemStatement.TryBind("@ForcedSortName", item.ForcedSortName);
saveItemStatement.TryBind("@RunTimeTicks", item.RunTimeTicks);
saveItemStatement.TryBind("@HomePageUrl", item.HomePageUrl);
saveItemStatement.TryBind("@VoteCount", item.VoteCount);
saveItemStatement.TryBind("@DisplayMediaType", item.DisplayMediaType);
saveItemStatement.TryBind("@DateCreated", item.DateCreated);
saveItemStatement.TryBind("@DateModified", item.DateModified);
@ -909,7 +908,6 @@ namespace Emby.Server.Implementations.Data
isByName = dualAccess == null || dualAccess.IsAccessedByName;
}
saveItemStatement.TryBind("@IsItemByName", isByName);
saveItemStatement.TryBind("@SourceType", item.SourceType.ToString());
var trailer = item as Trailer;
if (trailer != null && trailer.TrailerTypes.Count > 0)
@ -1624,7 +1622,7 @@ namespace Emby.Server.Implementations.Data
{
if (!reader.IsDBNull(index))
{
item.SortName = reader.GetString(index);
item.ForcedSortName = reader.GetString(index);
}
index++;
}
@ -1635,15 +1633,6 @@ namespace Emby.Server.Implementations.Data
}
index++;
if (HasField(query, ItemFields.VoteCount))
{
if (!reader.IsDBNull(index))
{
item.VoteCount = reader.GetInt32(index);
}
index++;
}
if (HasField(query, ItemFields.DateCreated))
{
if (!reader.IsDBNull(index))
@ -1733,12 +1722,6 @@ namespace Emby.Server.Implementations.Data
index++;
}
if (!reader.IsDBNull(index))
{
item.SourceType = (SourceType)Enum.Parse(typeof(SourceType), reader.GetString(index), true);
}
index++;
if (hasTrailerTypes)
{
var trailer = item as Trailer;
@ -2283,7 +2266,7 @@ namespace Emby.Server.Implementations.Data
}
if (field == ItemFields.SortName)
{
return new[] { "SortName" };
return new[] { "ForcedSortName" };
}
if (field == ItemFields.Taglines)
{
@ -2306,7 +2289,6 @@ namespace Emby.Server.Implementations.Data
case ItemFields.HomePageUrl:
case ItemFields.Keywords:
case ItemFields.DisplayMediaType:
case ItemFields.VoteCount:
case ItemFields.CustomRating:
case ItemFields.ProductionLocations:
case ItemFields.Settings:
@ -3872,34 +3854,6 @@ namespace Emby.Server.Implementations.Data
}
}
if (query.SourceTypes.Length == 1)
{
whereClauses.Add("SourceType=@SourceType");
if (statement != null)
{
statement.TryBind("@SourceType", query.SourceTypes[0].ToString());
}
}
else if (query.SourceTypes.Length > 1)
{
var inClause = string.Join(",", query.SourceTypes.Select(i => "'" + i + "'").ToArray());
whereClauses.Add(string.Format("SourceType in ({0})", inClause));
}
if (query.ExcludeSourceTypes.Length == 1)
{
whereClauses.Add("SourceType<>@ExcludeSourceTypes");
if (statement != null)
{
statement.TryBind("@ExcludeSourceTypes", query.ExcludeSourceTypes[0].ToString());
}
}
else if (query.ExcludeSourceTypes.Length > 1)
{
var inClause = string.Join(",", query.ExcludeSourceTypes.Select(i => "'" + i + "'").ToArray());
whereClauses.Add(string.Format("SourceType not in ({0})", inClause));
}
if (query.TrailerTypes.Length > 0)
{
var clauses = new List<string>();
@ -5017,14 +4971,6 @@ namespace Emby.Server.Implementations.Data
statement.TryBind("@NameContains", "%" + query.NameContains + "%");
}
}
if (query.SourceTypes.Length == 1)
{
whereClauses.Add("(select sourcetype from typedbaseitems where guid=ItemId) = @SourceTypes");
if (statement != null)
{
statement.TryBind("@SourceTypes", query.SourceTypes[0].ToString());
}
}
return whereClauses;
}

View File

@ -1058,11 +1058,6 @@ namespace Emby.Server.Implementations.Dto
dto.CommunityRating = item.CommunityRating;
}
if (fields.Contains(ItemFields.VoteCount))
{
dto.VoteCount = item.VoteCount;
}
//if (item.IsFolder)
//{
// var folder = (Folder)item;

View File

@ -31,6 +31,9 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Compile Include="..\SharedVersion.cs">
<Link>Properties\SharedVersion.cs</Link>
</Compile>
<Compile Include="Activity\ActivityLogEntryPoint.cs" />
<Compile Include="Activity\ActivityManager.cs" />
<Compile Include="Activity\ActivityRepository.cs" />

View File

@ -38,7 +38,10 @@ namespace Emby.Server.Implementations.Library
// Synology
"@eaDir",
"eaDir",
"#recycle"
"#recycle",
// Qnap
"@Recycle"
};

View File

@ -1292,7 +1292,7 @@ namespace Emby.Server.Implementations.Library
return item;
}
public IEnumerable<BaseItem> GetItemList(InternalItemsQuery query)
public IEnumerable<BaseItem> GetItemList(InternalItemsQuery query, bool allowExternalContent)
{
if (query.Recursive && query.ParentId.HasValue)
{
@ -1305,12 +1305,17 @@ namespace Emby.Server.Implementations.Library
if (query.User != null)
{
AddUserToQuery(query, query.User);
AddUserToQuery(query, query.User, allowExternalContent);
}
return ItemRepository.GetItemList(query);
}
public IEnumerable<BaseItem> GetItemList(InternalItemsQuery query)
{
return GetItemList(query, true);
}
public int GetCount(InternalItemsQuery query)
{
if (query.Recursive && query.ParentId.HasValue)
@ -1548,7 +1553,7 @@ namespace Emby.Server.Implementations.Library
query.Parent = null;
}
private void AddUserToQuery(InternalItemsQuery query, User user)
private void AddUserToQuery(InternalItemsQuery query, User user, bool allowExternalContent = true)
{
if (query.AncestorIds.Length == 0 &&
!query.ParentId.HasValue &&
@ -1561,7 +1566,8 @@ namespace Emby.Server.Implementations.Library
var userViews = _userviewManager().GetUserViews(new UserViewQuery
{
UserId = user.Id.ToString("N"),
IncludeHidden = true
IncludeHidden = true,
IncludeExternalContent = allowExternalContent
}, CancellationToken.None).Result.ToList();

View File

@ -280,7 +280,7 @@ namespace Emby.Server.Implementations.Library
} : new string[] { };
return _libraryManager.GetItemList(new InternalItemsQuery(user)
var query = new InternalItemsQuery(user)
{
IncludeItemTypes = includeItemTypes,
SortOrder = SortOrder.Descending,
@ -289,11 +289,16 @@ namespace Emby.Server.Implementations.Library
ExcludeItemTypes = excludeItemTypes,
IsVirtualItem = false,
Limit = limit * 5,
SourceTypes = parents.Count == 0 ? new[] { SourceType.Library } : new SourceType[] { },
IsPlayed = isPlayed,
DtoOptions = options
};
}, parents);
if (parents.Count == 0)
{
return _libraryManager.GetItemList(query, false);
}
return _libraryManager.GetItemList(query, parents);
}
}
}

View File

@ -2270,11 +2270,6 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV
writer.WriteElementString("studio", studio);
}
if (item.VoteCount.HasValue)
{
writer.WriteElementString("votes", item.VoteCount.Value.ToString(CultureInfo.InvariantCulture));
}
writer.WriteEndElement();
writer.WriteEndDocument();
}

View File

@ -16,7 +16,7 @@ namespace Emby.Server.Implementations.LiveTv
private readonly IMediaEncoder _mediaEncoder;
private readonly ILogger _logger;
const int AnalyzeDurationMs = 2000;
const int AnalyzeDurationMs = 1000;
public LiveStreamHelper(IMediaEncoder mediaEncoder, ILogger logger)
{

View File

@ -422,6 +422,8 @@ namespace Emby.Server.Implementations.LiveTv.TunerHosts.HdHomerun
SupportsTranscoding = true,
IsInfiniteStream = true,
IgnoreDts = true,
//SupportsProbing = false,
//AnalyzeDurationMs = 2000000
//IgnoreIndex = true,
//ReadAtNativeFramerate = true
};

View File

@ -117,7 +117,9 @@ namespace Emby.Server.Implementations.LiveTv.TunerHosts.HdHomerun
}
else
{
await _multicastStream.CopyUntilCancelled(response.Content, () => Resolve(openTaskCompletionSource), cancellationToken).ConfigureAwait(false);
Resolve(openTaskCompletionSource);
await _multicastStream.CopyUntilCancelled(response.Content, null, cancellationToken).ConfigureAwait(false);
}
}
}

View File

@ -26,5 +26,3 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

View File

@ -243,7 +243,6 @@ namespace MediaBrowser.Api
item.DisplayMediaType = request.DisplayMediaType;
item.CommunityRating = request.CommunityRating;
item.VoteCount = request.VoteCount;
item.HomePageUrl = request.HomePageUrl;
item.IndexNumber = request.IndexNumber;
item.ParentIndexNumber = request.ParentIndexNumber;

View File

@ -675,7 +675,6 @@ namespace MediaBrowser.Api.Library
Limit = 0,
Recursive = true,
IsVirtualItem = false,
SourceTypes = new[] { SourceType.Library },
IsFavorite = request.IsFavorite,
DtoOptions = new DtoOptions(false)
{

View File

@ -106,6 +106,13 @@ namespace MediaBrowser.Api.Playback
}
public async Task<object> Post(OpenMediaSource request)
{
var result = await OpenMediaSource(request).ConfigureAwait(false);
return ToOptimizedResult(result);
}
private async Task<LiveStreamResponse> OpenMediaSource(OpenMediaSource request)
{
var authInfo = _authContext.GetAuthorizationInfo(Request);
@ -137,7 +144,7 @@ namespace MediaBrowser.Api.Playback
}
}
return ToOptimizedResult(result);
return result;
}
public void Post(CloseMediaSource request)
@ -172,6 +179,34 @@ namespace MediaBrowser.Api.Playback
SetDeviceSpecificData(request.Id, info, profile, authInfo, request.MaxStreamingBitrate ?? profile.MaxStreamingBitrate, request.StartTimeTicks ?? 0, mediaSourceId, request.AudioStreamIndex, request.SubtitleStreamIndex, request.MaxAudioChannels, request.UserId, request.EnableDirectPlay, request.ForceDirectPlayRemoteMediaSource, request.EnableDirectStream, request.EnableTranscoding, request.AllowVideoStreamCopy, request.AllowAudioStreamCopy);
}
if (request.AutoOpenLiveStream)
{
var mediaSource = string.IsNullOrWhiteSpace(request.MediaSourceId) ? info.MediaSources.FirstOrDefault() : info.MediaSources.FirstOrDefault(i => string.Equals(i.Id, request.MediaSourceId, StringComparison.Ordinal));
if (mediaSource != null && mediaSource.RequiresOpening && string.IsNullOrWhiteSpace(mediaSource.LiveStreamId))
{
var openStreamResult = await OpenMediaSource(new OpenMediaSource
{
AudioStreamIndex = request.AudioStreamIndex,
DeviceProfile = request.DeviceProfile,
EnableDirectPlay = request.EnableDirectPlay,
EnableDirectStream = request.EnableDirectStream,
ForceDirectPlayRemoteMediaSource = request.ForceDirectPlayRemoteMediaSource,
ItemId = request.Id,
MaxAudioChannels = request.MaxAudioChannels,
MaxStreamingBitrate = request.MaxStreamingBitrate,
PlaySessionId = info.PlaySessionId,
StartTimeTicks = request.StartTimeTicks,
SubtitleStreamIndex = request.SubtitleStreamIndex,
UserId = request.UserId,
OpenToken = mediaSource.OpenToken
}).ConfigureAwait(false);
info.MediaSources = new List<MediaSourceInfo> { openStreamResult.MediaSource };
}
}
return info;
}

View File

@ -100,7 +100,6 @@ namespace MediaBrowser.Api
config.EnableSimpleArtistDetection = true;
config.EnableNormalizedItemByNameIds = true;
config.DisableLiveTvChannelUserDataName = true;
config.EnableSimpleSortNameHandling = true;
}
public void Post(UpdateStartupConfiguration request)

View File

@ -35,7 +35,6 @@ namespace MediaBrowser.Controller.Channels
public override SourceType SourceType
{
get { return SourceType.Channel; }
set { }
}
protected override QueryResult<BaseItem> GetItemsInternal(InternalItemsQuery query)

View File

@ -87,7 +87,7 @@ namespace MediaBrowser.Controller.Entities
private List<Guid> _childrenIds = null;
private readonly object _childIdsLock = new object();
protected override IEnumerable<BaseItem> LoadChildren()
protected override List<BaseItem> LoadChildren()
{
lock (_childIdsLock)
{

View File

@ -131,7 +131,7 @@ namespace MediaBrowser.Controller.Entities.Audio
/// Creates the name of the sort.
/// </summary>
/// <returns>System.String.</returns>
protected override string CreateSortNameInternal()
protected override string CreateSortName()
{
return (ParentIndexNumber != null ? ParentIndexNumber.Value.ToString("0000 - ") : "")
+ (IndexNumber != null ? IndexNumber.Value.ToString("0000 - ") : "") + Name;

View File

@ -90,7 +90,7 @@ namespace MediaBrowser.Controller.Entities.Audio
}
[IgnoreDataMember]
protected override IEnumerable<BaseItem> ActualChildren
public override IEnumerable<BaseItem> Children
{
get
{
@ -99,7 +99,7 @@ namespace MediaBrowser.Controller.Entities.Audio
return new List<BaseItem>();
}
return base.ActualChildren;
return base.Children;
}
}

View File

@ -54,7 +54,6 @@ namespace MediaBrowser.Controller.Entities
ImageInfos = new List<ItemImageInfo>();
InheritedTags = new List<string>();
ProductionLocations = new List<string>();
SourceType = SourceType.Library;
}
public static readonly char[] SlugReplaceChars = { '?', '/', '&' };
@ -187,15 +186,10 @@ namespace MediaBrowser.Controller.Entities
}
set
{
var isSortNameDefault = IsSortNameDefault(SortName);
_name = value;
if (isSortNameDefault)
{
// lazy load this again
SortName = null;
}
_sortName = null;
}
}
@ -279,7 +273,18 @@ namespace MediaBrowser.Controller.Entities
public virtual string Path { get; set; }
[IgnoreDataMember]
public virtual SourceType SourceType { get; set; }
public virtual SourceType SourceType
{
get
{
if (!string.IsNullOrWhiteSpace(ChannelId))
{
return SourceType.Channel;
}
return SourceType.Library;
}
}
/// <summary>
/// Returns the folder containing the item.
@ -586,6 +591,7 @@ namespace MediaBrowser.Controller.Entities
}
}
private string _forcedSortName;
/// <summary>
/// Gets or sets the name of the forced sort.
/// </summary>
@ -593,42 +599,8 @@ namespace MediaBrowser.Controller.Entities
[IgnoreDataMember]
public string ForcedSortName
{
get
{
var sortName = SortName;
if (string.IsNullOrWhiteSpace(sortName))
{
return null;
}
if (string.Equals(sortName, CreateSortName(), StringComparison.OrdinalIgnoreCase))
{
return null;
}
return sortName;
}
set
{
if (string.IsNullOrWhiteSpace(value))
{
SortName = null;
}
else
{
var newValue = CreateSortNameFromCustomValue(value);
if (string.Equals(newValue, CreateSortName(), StringComparison.OrdinalIgnoreCase))
{
SortName = null;
}
else
{
SortName = newValue;
}
}
}
get { return _forcedSortName; }
set { _forcedSortName = value; _sortName = null; }
}
private string _sortName;
@ -642,9 +614,17 @@ namespace MediaBrowser.Controller.Entities
get
{
if (_sortName == null)
{
if (!string.IsNullOrWhiteSpace(ForcedSortName))
{
// Need the ToLower because that's what CreateSortName does
_sortName = ModifySortChunks(ForcedSortName).ToLower();
}
else
{
_sortName = CreateSortName();
}
}
return _sortName;
}
set
@ -653,31 +633,6 @@ namespace MediaBrowser.Controller.Entities
}
}
private string CreateSortNameFromCustomValue(string value)
{
return string.IsNullOrWhiteSpace(value) ? null : NormalizeCustomSortName(value);
}
protected virtual string NormalizeCustomSortName(string value)
{
if (ConfigurationManager.Configuration.EnableSimpleSortNameHandling)
{
return value.RemoveDiacritics().ToLower();
}
return ModifySortChunks(value).ToLower();
}
public bool IsSortNameDefault(string value)
{
if (string.IsNullOrWhiteSpace(value))
{
return true;
}
return string.Equals(CreateSortNameFromCustomValue(value), CreateSortName(), StringComparison.OrdinalIgnoreCase);
}
public string GetInternalMetadataPath()
{
var basePath = ConfigurationManager.ApplicationPaths.InternalMetadataPath;
@ -699,22 +654,14 @@ namespace MediaBrowser.Controller.Entities
return System.IO.Path.Combine(basePath, idString.Substring(0, 2), idString);
}
protected string CreateSortName()
{
if (string.IsNullOrWhiteSpace(Name))
{
return null;
}
return CreateSortNameInternal();
}
/// <summary>
/// Creates the name of the sort.
/// </summary>
/// <returns>System.String.</returns>
protected virtual string CreateSortNameInternal()
protected virtual string CreateSortName()
{
if (Name == null) return null; //some items may not have name filled in properly
if (!EnableAlphaNumericSorting)
{
return Name.TrimStart();
@ -951,13 +898,6 @@ namespace MediaBrowser.Controller.Entities
[IgnoreDataMember]
public float? CommunityRating { get; set; }
/// <summary>
/// Gets or sets the community rating vote count.
/// </summary>
/// <value>The community rating vote count.</value>
[IgnoreDataMember]
public int? VoteCount { get; set; }
/// <summary>
/// Gets or sets the run time ticks.
/// </summary>
@ -1367,6 +1307,7 @@ namespace MediaBrowser.Controller.Entities
public void AfterMetadataRefresh()
{
_sortName = null;
}
/// <summary>
@ -2253,6 +2194,8 @@ namespace MediaBrowser.Controller.Entities
/// </summary>
public virtual bool BeforeMetadataRefresh()
{
_sortName = null;
var hasChanges = false;
if (string.IsNullOrEmpty(Name) && !string.IsNullOrEmpty(Path))

View File

@ -311,12 +311,12 @@ namespace MediaBrowser.Controller.Entities
/// </summary>
/// <value>The actual children.</value>
[IgnoreDataMember]
protected override IEnumerable<BaseItem> ActualChildren
public override IEnumerable<BaseItem> Children
{
get { return GetActualChildren(); }
}
private IEnumerable<BaseItem> GetActualChildren()
public IEnumerable<BaseItem> GetActualChildren()
{
return GetPhysicalFolders(true).SelectMany(c => c.Children);
}

View File

@ -185,7 +185,7 @@ namespace MediaBrowser.Controller.Entities
item.Id = LibraryManager.GetNewItemId(item.Path, item.GetType());
}
if (ActualChildren.Any(i => i.Id == item.Id))
if (Children.Any(i => i.Id == item.Id))
{
throw new ArgumentException(string.Format("A child with the Id {0} already exists.", item.Id));
}
@ -243,7 +243,7 @@ namespace MediaBrowser.Controller.Entities
/// </summary>
/// <value>The actual children.</value>
[IgnoreDataMember]
protected virtual IEnumerable<BaseItem> ActualChildren
public virtual IEnumerable<BaseItem> Children
{
get
{
@ -251,16 +251,6 @@ namespace MediaBrowser.Controller.Entities
}
}
/// <summary>
/// thread-safe access to the actual children of this folder - without regard to user
/// </summary>
/// <value>The children.</value>
[IgnoreDataMember]
public IEnumerable<BaseItem> Children
{
get { return ActualChildren.ToList(); }
}
/// <summary>
/// thread-safe access to all recursive children of this folder - without regard to user
/// </summary>
@ -301,7 +291,7 @@ namespace MediaBrowser.Controller.Entities
/// Loads our children. Validation will occur externally.
/// We want this sychronous.
/// </summary>
protected virtual IEnumerable<BaseItem> LoadChildren()
protected virtual List<BaseItem> LoadChildren()
{
//Logger.Debug("Loading children from {0} {1} {2}", GetType().Name, Id, Path);
//just load our children from the repo - the library will be validated and maintained in other processes
@ -330,7 +320,9 @@ namespace MediaBrowser.Controller.Entities
{
var dictionary = new Dictionary<Guid, BaseItem>();
foreach (var child in ActualChildren)
var childrenList = Children.ToList();
foreach (var child in childrenList)
{
var id = child.Id;
if (dictionary.ContainsKey(id))
@ -466,7 +458,7 @@ namespace MediaBrowser.Controller.Entities
if (recursive)
{
await ValidateSubFolders(ActualChildren.OfType<Folder>().ToList(), directoryService, progress, cancellationToken).ConfigureAwait(false);
await ValidateSubFolders(Children.ToList().OfType<Folder>().ToList(), directoryService, progress, cancellationToken).ConfigureAwait(false);
}
progress.Report(20);
@ -494,7 +486,7 @@ namespace MediaBrowser.Controller.Entities
private async Task RefreshMetadataRecursive(MetadataRefreshOptions refreshOptions, bool recursive, IProgress<double> progress, CancellationToken cancellationToken)
{
var children = ActualChildren.ToList();
var children = Children.ToList();
var percentages = new Dictionary<Guid, double>(children.Count);
var numComplete = 0;
@ -668,7 +660,7 @@ namespace MediaBrowser.Controller.Entities
/// Get our children from the repo - stubbed for now
/// </summary>
/// <returns>IEnumerable{BaseItem}.</returns>
protected IEnumerable<BaseItem> GetCachedChildren()
protected List<BaseItem> GetCachedChildren()
{
return ItemRepository.GetItemList(new InternalItemsQuery
{

View File

@ -26,7 +26,7 @@ namespace MediaBrowser.Controller.Entities
/// <value>The date last saved.</value>
DateTime DateLastSaved { get; set; }
SourceType SourceType { get; set; }
SourceType SourceType { get; }
/// <summary>
/// Gets or sets the date last refreshed.

View File

@ -148,8 +148,6 @@ namespace MediaBrowser.Controller.Entities
}
public string[] PresetViews { get; set; }
public SourceType[] SourceTypes { get; set; }
public SourceType[] ExcludeSourceTypes { get; set; }
public TrailerType[] TrailerTypes { get; set; }
public DayOfWeek[] AirDays { get; set; }
@ -215,8 +213,6 @@ namespace MediaBrowser.Controller.Entities
ExcludeTags = new string[] { };
ExcludeInheritedTags = new string[] { };
PresetViews = new string[] { };
SourceTypes = new SourceType[] { };
ExcludeSourceTypes = new SourceType[] { };
TrailerTypes = new TrailerType[] { };
AirDays = new DayOfWeek[] { };
SeriesStatuses = new SeriesStatus[] { };

View File

@ -11,13 +11,11 @@ namespace MediaBrowser.Controller.Entities
public int? MaxListOrder { get; set; }
public Guid AppearsInItemId { get; set; }
public string NameContains { get; set; }
public SourceType[] SourceTypes { get; set; }
public InternalPeopleQuery()
{
PersonTypes = new List<string>();
ExcludePersonTypes = new List<string>();
SourceTypes = new SourceType[] { };
}
}
}

View File

@ -79,7 +79,7 @@ namespace MediaBrowser.Controller.Entities.Movies
return new List<BaseItem>();
}
protected override IEnumerable<BaseItem> LoadChildren()
protected override List<BaseItem> LoadChildren()
{
if (IsLegacyBoxSet)
{

View File

@ -237,7 +237,7 @@ namespace MediaBrowser.Controller.Entities.TV
/// Creates the name of the sort.
/// </summary>
/// <returns>System.String.</returns>
protected override string CreateSortNameInternal()
protected override string CreateSortName()
{
return (ParentIndexNumber != null ? ParentIndexNumber.Value.ToString("000 - ") : "")
+ (IndexNumber != null ? IndexNumber.Value.ToString("0000 - ") : "") + Name;

View File

@ -145,7 +145,7 @@ namespace MediaBrowser.Controller.Entities.TV
/// Creates the name of the sort.
/// </summary>
/// <returns>System.String.</returns>
protected override string CreateSortNameInternal()
protected override string CreateSortName()
{
return IndexNumber != null ? IndexNumber.Value.ToString("0000") : Name;
}

View File

@ -18,7 +18,7 @@ namespace MediaBrowser.Controller.Entities
{
private List<Guid> _childrenIds = null;
private readonly object _childIdsLock = new object();
protected override IEnumerable<BaseItem> LoadChildren()
protected override List<BaseItem> LoadChildren()
{
lock (_childIdsLock)
{

View File

@ -527,6 +527,8 @@ namespace MediaBrowser.Controller.Library
/// <returns>QueryResult&lt;BaseItem&gt;.</returns>
IEnumerable<BaseItem> GetItemList(InternalItemsQuery query);
IEnumerable<BaseItem> GetItemList(InternalItemsQuery query, bool allowExternalContent);
/// <summary>
/// Gets the items.
/// </summary>

View File

@ -43,7 +43,6 @@ namespace MediaBrowser.Controller.LiveTv
public override SourceType SourceType
{
get { return SourceType.LiveTV; }
set { }
}
[IgnoreDataMember]

View File

@ -55,7 +55,6 @@ namespace MediaBrowser.Controller.LiveTv
public override SourceType SourceType
{
get { return SourceType.LiveTV; }
set { }
}
[IgnoreDataMember]
@ -89,7 +88,7 @@ namespace MediaBrowser.Controller.LiveTv
}
}
protected override string CreateSortNameInternal()
protected override string CreateSortName()
{
if (!string.IsNullOrEmpty(Number))
{

View File

@ -65,7 +65,6 @@ namespace MediaBrowser.Controller.LiveTv
public override SourceType SourceType
{
get { return SourceType.LiveTV; }
set { }
}
/// <summary>

View File

@ -42,7 +42,6 @@ namespace MediaBrowser.Controller.LiveTv
public override SourceType SourceType
{
get { return SourceType.LiveTV; }
set { }
}
[IgnoreDataMember]

View File

@ -30,7 +30,6 @@ namespace MediaBrowser.Controller.LiveTv
public override SourceType SourceType
{
get { return SourceType.LiveTV; }
set { }
}
}
}

View File

@ -1604,7 +1604,7 @@ namespace MediaBrowser.Controller.MediaEncoding
}
// Only do this for video files due to sometimes unpredictable codec names coming from BDInfo
if (state.RunTimeTicks.HasValue && state.VideoType == VideoType.VideoFile && string.IsNullOrWhiteSpace(encodingOptions.HardwareAccelerationType))
if (state.VideoType == VideoType.VideoFile && string.IsNullOrWhiteSpace(encodingOptions.HardwareAccelerationType))
{
foreach (var stream in state.MediaSource.MediaStreams)
{

View File

@ -74,7 +74,7 @@ namespace MediaBrowser.Controller.Playlists
return true;
}
protected override IEnumerable<BaseItem> LoadChildren()
protected override List<BaseItem> LoadChildren()
{
// Save a trip to the database
return new List<BaseItem>();

View File

@ -598,20 +598,6 @@ namespace MediaBrowser.LocalMetadata.Parsers
break;
}
case "VoteCount":
{
var val = reader.ReadElementContentAsString();
if (!string.IsNullOrWhiteSpace(val))
{
int num;
if (int.TryParse(val, NumberStyles.Integer, _usCulture, out num))
{
item.VoteCount = num;
}
}
break;
}
case "CollectionNumber":
var tmdbCollection = reader.ReadElementContentAsString();
if (!string.IsNullOrWhiteSpace(tmdbCollection))

View File

@ -109,7 +109,6 @@ namespace MediaBrowser.LocalMetadata.Savers
"TvDbId",
"Type",
"TVRageId",
"VoteCount",
"Website",
"Zap2ItId",
"CollectionItems",
@ -407,10 +406,6 @@ namespace MediaBrowser.LocalMetadata.Savers
{
writer.WriteElementString("Rating", item.CommunityRating.Value.ToString(UsCulture));
}
if (item.VoteCount.HasValue)
{
writer.WriteElementString("VoteCount", item.VoteCount.Value.ToString(UsCulture));
}
if (item.ProductionYear.HasValue && !(item is Person))
{

View File

@ -17,8 +17,6 @@ namespace MediaBrowser.Model.Configuration
/// <value><c>true</c> if [enable u pn p]; otherwise, <c>false</c>.</value>
public bool EnableUPnP { get; set; }
public bool EnableSimpleSortNameHandling { get; set; }
/// <summary>
/// Gets or sets the public mapped port.
/// </summary>

View File

@ -221,12 +221,6 @@ namespace MediaBrowser.Model.Dto
/// <value>The community rating.</value>
public float? CommunityRating { get; set; }
/// <summary>
/// Gets or sets the vote count.
/// </summary>
/// <value>The vote count.</value>
public int? VoteCount { get; set; }
/// <summary>
/// Gets or sets the cumulative run time ticks.
/// </summary>

View File

@ -30,6 +30,7 @@ namespace MediaBrowser.Model.MediaInfo
public bool ForceDirectPlayRemoteMediaSource { get; set; }
public bool AllowVideoStreamCopy { get; set; }
public bool AllowAudioStreamCopy { get; set; }
public bool AutoOpenLiveStream { get; set; }
public PlaybackInfoRequest()
{

View File

@ -206,11 +206,6 @@
/// </summary>
Tags,
/// <summary>
/// The vote count
/// </summary>
VoteCount,
/// <summary>
/// The trailer url of the item
/// </summary>

View File

@ -180,11 +180,6 @@ namespace MediaBrowser.Providers.Manager
}
}
if (replaceData || !target.VoteCount.HasValue)
{
target.VoteCount = source.VoteCount;
}
foreach (var id in source.ProviderIds)
{
var key = id.Key;
@ -200,6 +195,32 @@ namespace MediaBrowser.Providers.Manager
MergeCriticRating(source, target, lockedFields, replaceData);
MergeTrailers(source, target, lockedFields, replaceData);
MergeVideoInfo(source, target, lockedFields, replaceData);
MergeDisplayOrder(source, target, lockedFields, replaceData);
//if (!lockedFields.Contains(MetadataFields.SortName))
{
if (replaceData || string.IsNullOrEmpty(target.ForcedSortName))
{
var forcedSortName = source.ForcedSortName;
if (!string.IsNullOrWhiteSpace(forcedSortName))
{
target.ForcedSortName = forcedSortName;
}
}
}
//if (!lockedFields.Contains(MetadataFields.DisplayMediaType))
{
if (replaceData || string.IsNullOrEmpty(target.DisplayMediaType))
{
// Safeguard against incoming data having an emtpy name
if (!string.IsNullOrWhiteSpace(source.DisplayMediaType))
{
target.DisplayMediaType = source.DisplayMediaType;
}
}
}
if (mergeMetadataSettings)
{
@ -235,10 +256,8 @@ namespace MediaBrowser.Providers.Manager
public static void MergeMetadataSettings(BaseItem source,
BaseItem target)
{
target.ForcedSortName = source.ForcedSortName;
target.LockedFields = source.LockedFields;
target.IsLocked = source.IsLocked;
target.DisplayMediaType = source.DisplayMediaType;
// Grab the value if it's there, but if not then don't overwrite the default
if (source.DateCreated != default(DateTime))
@ -248,7 +267,10 @@ namespace MediaBrowser.Providers.Manager
target.PreferredMetadataCountryCode = source.PreferredMetadataCountryCode;
target.PreferredMetadataLanguage = source.PreferredMetadataLanguage;
}
private static void MergeDisplayOrder(BaseItem source, BaseItem target, List<MetadataFields> lockedFields, bool replaceData)
{
var sourceHasDisplayOrder = source as IHasDisplayOrder;
var targetHasDisplayOrder = target as IHasDisplayOrder;

View File

@ -173,7 +173,7 @@ namespace MediaBrowser.Providers.Movies
movie.CommunityRating = rating;
}
movie.VoteCount = movieData.vote_count;
//movie.VoteCount = movieData.vote_count;
//release date and certification are retrieved based on configured country and we fall back on US if not there and to minimun release date if still no match
if (movieData.releases != null && movieData.releases.countries != null)

View File

@ -78,7 +78,7 @@ namespace MediaBrowser.Providers.Omdb
&& int.TryParse(result.imdbVotes, NumberStyles.Number, _usCulture, out voteCount)
&& voteCount >= 0)
{
item.VoteCount = voteCount;
//item.VoteCount = voteCount;
}
float imdbRating;
@ -185,7 +185,7 @@ namespace MediaBrowser.Providers.Omdb
&& int.TryParse(result.imdbVotes, NumberStyles.Number, _usCulture, out voteCount)
&& voteCount >= 0)
{
item.VoteCount = voteCount;
//item.VoteCount = voteCount;
}
float imdbRating;

View File

@ -122,7 +122,7 @@ namespace MediaBrowser.Providers.TV
item.Overview = response.overview;
item.CommunityRating = (float)response.vote_average;
item.VoteCount = response.vote_count;
//item.VoteCount = response.vote_count;
if (response.videos != null && response.videos.results != null)
{

View File

@ -217,7 +217,7 @@ namespace MediaBrowser.Providers.TV
series.Name = seriesInfo.name;
series.SetProviderId(MetadataProviders.Tmdb, seriesInfo.id.ToString(_usCulture));
series.VoteCount = seriesInfo.vote_count;
//series.VoteCount = seriesInfo.vote_count;
string voteAvg = seriesInfo.vote_average.ToString(CultureInfo.InvariantCulture);
float rating;

View File

@ -680,7 +680,7 @@ namespace MediaBrowser.Providers.TV
// int.TryParse is local aware, so it can be probamatic, force us culture
if (int.TryParse(val, NumberStyles.Integer, _usCulture, out rval))
{
item.VoteCount = rval;
//item.VoteCount = rval;
}
}

View File

@ -1150,7 +1150,7 @@ namespace MediaBrowser.Providers.TV
// int.TryParse is local aware, so it can be probamatic, force us culture
if (int.TryParse(val, NumberStyles.Integer, _usCulture, out rval))
{
item.VoteCount = rval;
//item.VoteCount = rval;
}
}

View File

@ -50,7 +50,7 @@
<HintPath>..\packages\Mono.Posix.4.0.0.0\lib\net40\Mono.Posix.dll</HintPath>
</Reference>
<Reference Include="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
<HintPath>..\packages\NLog.4.4.9\lib\net45\NLog.dll</HintPath>
<HintPath>..\packages\NLog.4.4.10\lib\net45\NLog.dll</HintPath>
</Reference>
<Reference Include="ServiceStack.Text, Version=4.5.8.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\ServiceStack.Text.4.5.8\lib\net45\ServiceStack.Text.dll</HintPath>

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Mono.Posix" version="4.0.0.0" targetFramework="net45" />
<package id="NLog" version="4.4.9" targetFramework="net46" />
<package id="NLog" version="4.4.10" targetFramework="net46" />
<package id="ServiceStack.Text" version="4.5.8" targetFramework="net46" />
<package id="SharpCompress" version="0.14.0" targetFramework="net46" />
<package id="SimpleInjector" version="4.0.7" targetFramework="net46" />

View File

@ -78,7 +78,7 @@
<HintPath>..\packages\ImageMagickSharp.1.0.0.18\lib\net45\ImageMagickSharp.dll</HintPath>
</Reference>
<Reference Include="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
<HintPath>..\packages\NLog.4.4.9\lib\net45\NLog.dll</HintPath>
<HintPath>..\packages\NLog.4.4.10\lib\net45\NLog.dll</HintPath>
</Reference>
<Reference Include="ServiceStack.Text, Version=4.5.8.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\ServiceStack.Text.4.5.8\lib\net45\ServiceStack.Text.dll</HintPath>

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="ImageMagickSharp" version="1.0.0.18" targetFramework="net45" />
<package id="NLog" version="4.4.9" targetFramework="net462" />
<package id="NLog" version="4.4.10" targetFramework="net462" />
<package id="ServiceStack.Text" version="4.5.8" targetFramework="net462" />
<package id="SharpCompress" version="0.14.0" targetFramework="net462" />
<package id="SimpleInjector" version="4.0.7" targetFramework="net462" />

View File

@ -704,21 +704,6 @@ namespace MediaBrowser.XbmcMetadata.Parsers
break;
}
case "votes":
{
var val = reader.ReadElementContentAsString();
if (!string.IsNullOrWhiteSpace(val))
{
int num;
if (int.TryParse(val, NumberStyles.Integer, _usCulture, out num))
{
item.VoteCount = num;
}
}
break;
}
case "genre":
{
var val = reader.ReadElementContentAsString();

View File

@ -63,7 +63,6 @@ namespace MediaBrowser.XbmcMetadata.Savers
"releasedate",
"outline",
"id",
"votes",
"credits",
"originaltitle",
"watched",
@ -659,11 +658,6 @@ namespace MediaBrowser.XbmcMetadata.Savers
}
}
if (item.VoteCount.HasValue)
{
writer.WriteElementString("votes", item.VoteCount.Value.ToString(UsCulture));
}
// Use original runtime here, actual file runtime later in MediaInfo
var runTimeTicks = item.RunTimeTicks;

View File

@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
<metadata>
<id>MediaBrowser.Common</id>
<version>3.0.701</version>
<version>3.0.702</version>
<title>Emby.Common</title>
<authors>Emby Team</authors>
<owners>ebr,Luke,scottisafool</owners>

View File

@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata>
<id>MediaBrowser.Server.Core</id>
<version>3.0.701</version>
<version>3.0.702</version>
<title>Emby.Server.Core</title>
<authors>Emby Team</authors>
<owners>ebr,Luke,scottisafool</owners>
@ -12,7 +12,7 @@
<description>Contains core components required to build plugins for Emby Server.</description>
<copyright>Copyright © Emby 2013</copyright>
<dependencies>
<dependency id="MediaBrowser.Common" version="3.0.701" />
<dependency id="MediaBrowser.Common" version="3.0.702" />
</dependencies>
</metadata>
<files>

View File

@ -1,3 +1,3 @@
using System.Reflection;
[assembly: AssemblyVersion("3.2.18.3")]
[assembly: AssemblyVersion("3.2.19.2")]