diff --git a/Emby.Dlna/ContentDirectory/ControlHandler.cs b/Emby.Dlna/ContentDirectory/ControlHandler.cs
index 5718cbd09f..2251a8f58c 100644
--- a/Emby.Dlna/ContentDirectory/ControlHandler.cs
+++ b/Emby.Dlna/ContentDirectory/ControlHandler.cs
@@ -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;
diff --git a/Emby.Dlna/Didl/DidlBuilder.cs b/Emby.Dlna/Didl/DidlBuilder.cs
index 8771681ad7..ca4c3b9122 100644
--- a/Emby.Dlna/Didl/DidlBuilder.cs
+++ b/Emby.Dlna/Didl/DidlBuilder.cs
@@ -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;
diff --git a/MediaBrowser.Api/Playback/BaseStreamingService.cs b/MediaBrowser.Api/Playback/BaseStreamingService.cs
index 1ad4720386..0e0a22c392 100644
--- a/MediaBrowser.Api/Playback/BaseStreamingService.cs
+++ b/MediaBrowser.Api/Playback/BaseStreamingService.cs
@@ -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;
+ }
+
///
/// Infers the audio codec based on the url
///
diff --git a/MediaBrowser.Controller/Entities/Audio/MusicArtist.cs b/MediaBrowser.Controller/Entities/Audio/MusicArtist.cs
index 1d2716b64a..37631bbe8a 100644
--- a/MediaBrowser.Controller/Entities/Audio/MusicArtist.cs
+++ b/MediaBrowser.Controller/Entities/Audio/MusicArtist.cs
@@ -44,6 +44,15 @@ namespace MediaBrowser.Controller.Entities.Audio
}
}
+ [IgnoreDataMember]
+ public override bool IsDisplayedAsFolder
+ {
+ get
+ {
+ return true;
+ }
+ }
+
[IgnoreDataMember]
public override bool SupportsAddingToPlaylist
{
diff --git a/MediaBrowser.Controller/Entities/Audio/MusicGenre.cs b/MediaBrowser.Controller/Entities/Audio/MusicGenre.cs
index d75b31f6ae..bbe1a54a49 100644
--- a/MediaBrowser.Controller/Entities/Audio/MusicGenre.cs
+++ b/MediaBrowser.Controller/Entities/Audio/MusicGenre.cs
@@ -40,6 +40,15 @@ namespace MediaBrowser.Controller.Entities.Audio
}
}
+ [IgnoreDataMember]
+ public override bool IsDisplayedAsFolder
+ {
+ get
+ {
+ return true;
+ }
+ }
+
///
/// Returns the folder containing the item.
/// If the item is a folder, it returns the folder itself
diff --git a/MediaBrowser.Controller/Entities/BaseItem.cs b/MediaBrowser.Controller/Entities/BaseItem.cs
index 2aa53d6515..9e32fd1991 100644
--- a/MediaBrowser.Controller/Entities/BaseItem.cs
+++ b/MediaBrowser.Controller/Entities/BaseItem.cs
@@ -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))
diff --git a/MediaBrowser.Controller/Entities/Folder.cs b/MediaBrowser.Controller/Entities/Folder.cs
index 943c9d8822..b5d07b933a 100644
--- a/MediaBrowser.Controller/Entities/Folder.cs
+++ b/MediaBrowser.Controller/Entities/Folder.cs
@@ -85,6 +85,15 @@ namespace MediaBrowser.Controller.Entities
}
}
+ [IgnoreDataMember]
+ public override bool IsDisplayedAsFolder
+ {
+ get
+ {
+ return true;
+ }
+ }
+
[IgnoreDataMember]
public virtual bool SupportsCumulativeRunTimeTicks
{
diff --git a/MediaBrowser.Controller/Entities/Genre.cs b/MediaBrowser.Controller/Entities/Genre.cs
index da4ee352fa..1b746ae517 100644
--- a/MediaBrowser.Controller/Entities/Genre.cs
+++ b/MediaBrowser.Controller/Entities/Genre.cs
@@ -40,6 +40,15 @@ namespace MediaBrowser.Controller.Entities
}
}
+ [IgnoreDataMember]
+ public override bool IsDisplayedAsFolder
+ {
+ get
+ {
+ return true;
+ }
+ }
+
[IgnoreDataMember]
public override bool SupportsAncestors
{
diff --git a/MediaBrowser.Controller/Entities/Studio.cs b/MediaBrowser.Controller/Entities/Studio.cs
index c14dd70bf8..dbd9d1cef4 100644
--- a/MediaBrowser.Controller/Entities/Studio.cs
+++ b/MediaBrowser.Controller/Entities/Studio.cs
@@ -39,6 +39,15 @@ namespace MediaBrowser.Controller.Entities
}
}
+ [IgnoreDataMember]
+ public override bool IsDisplayedAsFolder
+ {
+ get
+ {
+ return true;
+ }
+ }
+
[IgnoreDataMember]
public override bool SupportsAncestors
{
diff --git a/MediaBrowser.Providers/Manager/ProviderManager.cs b/MediaBrowser.Providers/Manager/ProviderManager.cs
index a645ab55f9..4eab20e7ec 100644
--- a/MediaBrowser.Providers/Manager/ProviderManager.cs
+++ b/MediaBrowser.Providers/Manager/ProviderManager.cs
@@ -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(), cancellationToken, options).ConfigureAwait(false);
}
}