Merge pull request #2382 from MediaBrowser/dev

update music artists
This commit is contained in:
Luke 2017-01-05 23:38:26 -05:00 committed by GitHub
commit 9f5562bcbc
10 changed files with 84 additions and 15 deletions

View File

@ -260,7 +260,7 @@ namespace Emby.Dlna.ContentDirectory
{
totalCount = 1;
if (item.IsFolder || serverItem.StubType.HasValue)
if (item.IsDisplayedAsFolder || serverItem.StubType.HasValue)
{
var childrenResult = (await GetUserItems(item, serverItem.StubType, user, sortCriteria, start, requestedCount).ConfigureAwait(false));
@ -285,7 +285,7 @@ namespace Emby.Dlna.ContentDirectory
var childItem = i.Item;
var displayStubType = i.StubType;
if (childItem.IsFolder || displayStubType.HasValue)
if (childItem.IsDisplayedAsFolder || displayStubType.HasValue)
{
var childCount = (await GetUserItems(childItem, displayStubType, user, sortCriteria, null, 0).ConfigureAwait(false))
.TotalRecordCount;
@ -381,7 +381,7 @@ namespace Emby.Dlna.ContentDirectory
foreach (var i in childrenResult.Items)
{
if (i.IsFolder)
if (i.IsDisplayedAsFolder)
{
var childCount = (await GetChildrenSorted(i, user, searchCriteria, sortCriteria, null, 0).ConfigureAwait(false))
.TotalRecordCount;

View File

@ -686,7 +686,7 @@ namespace Emby.Dlna.Didl
writer.WriteStartElement("upnp", "class", NS_UPNP);
if (item.IsFolder || stubType.HasValue)
if (item.IsDisplayedAsFolder || stubType.HasValue)
{
string classType = null;

View File

@ -2710,7 +2710,12 @@ namespace MediaBrowser.Api.Playback
{
if (!string.IsNullOrWhiteSpace(stream.Codec) && stream.Index != -1)
{
inputModifier += " -codec:" + stream.Index.ToString(UsCulture) + " " + stream.Codec;
var decoder = GetDecoderFromCodec(stream.Codec);
if (!string.IsNullOrWhiteSpace(decoder))
{
inputModifier += " -codec:" + stream.Index.ToString(UsCulture) + " " + decoder;
}
}
}
}
@ -2730,6 +2735,16 @@ namespace MediaBrowser.Api.Playback
return inputModifier;
}
private string GetDecoderFromCodec(string codec)
{
if (string.Equals(codec, "mp2", StringComparison.OrdinalIgnoreCase))
{
return null;
}
return codec;
}
/// <summary>
/// Infers the audio codec based on the url
/// </summary>

View File

@ -44,6 +44,15 @@ namespace MediaBrowser.Controller.Entities.Audio
}
}
[IgnoreDataMember]
public override bool IsDisplayedAsFolder
{
get
{
return true;
}
}
[IgnoreDataMember]
public override bool SupportsAddingToPlaylist
{

View File

@ -40,6 +40,15 @@ namespace MediaBrowser.Controller.Entities.Audio
}
}
[IgnoreDataMember]
public override bool IsDisplayedAsFolder
{
get
{
return true;
}
}
/// <summary>
/// Returns the folder containing the item.
/// If the item is a folder, it returns the folder itself

View File

@ -1631,6 +1631,15 @@ namespace MediaBrowser.Controller.Entities
}
}
[IgnoreDataMember]
public virtual bool IsDisplayedAsFolder
{
get
{
return false;
}
}
public virtual string GetClientTypeName()
{
if (IsFolder && SourceType == SourceType.Channel && !(this is Channel))

View File

@ -85,6 +85,15 @@ namespace MediaBrowser.Controller.Entities
}
}
[IgnoreDataMember]
public override bool IsDisplayedAsFolder
{
get
{
return true;
}
}
[IgnoreDataMember]
public virtual bool SupportsCumulativeRunTimeTicks
{

View File

@ -40,6 +40,15 @@ namespace MediaBrowser.Controller.Entities
}
}
[IgnoreDataMember]
public override bool IsDisplayedAsFolder
{
get
{
return true;
}
}
[IgnoreDataMember]
public override bool SupportsAncestors
{

View File

@ -39,6 +39,15 @@ namespace MediaBrowser.Controller.Entities
}
}
[IgnoreDataMember]
public override bool IsDisplayedAsFolder
{
get
{
return true;
}
}
[IgnoreDataMember]
public override bool SupportsAncestors
{

View File

@ -921,19 +921,19 @@ namespace MediaBrowser.Providers.Manager
{
await item.RefreshMetadata(options, CancellationToken.None).ConfigureAwait(false);
if (item.IsFolder)
// Collection folders don't validate their children so we'll have to simulate that here
var collectionFolder = item as CollectionFolder;
if (collectionFolder != null)
{
// Collection folders don't validate their children so we'll have to simulate that here
var collectionFolder = item as CollectionFolder;
await RefreshCollectionFolderChildren(options, collectionFolder).ConfigureAwait(false);
}
else
{
var folder = item as Folder;
if (collectionFolder != null)
if (folder != null)
{
await RefreshCollectionFolderChildren(options, collectionFolder).ConfigureAwait(false);
}
else
{
var folder = (Folder)item;
await folder.ValidateChildren(new Progress<double>(), cancellationToken, options).ConfigureAwait(false);
}
}