mirror of
https://github.com/jellyfin/jellyfin.git
synced 2024-09-06 11:34:57 +02:00
commit
9f5562bcbc
10 changed files with 84 additions and 15 deletions
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -44,6 +44,15 @@ namespace MediaBrowser.Controller.Entities.Audio
|
|||
}
|
||||
}
|
||||
|
||||
[IgnoreDataMember]
|
||||
public override bool IsDisplayedAsFolder
|
||||
{
|
||||
get
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
[IgnoreDataMember]
|
||||
public override bool SupportsAddingToPlaylist
|
||||
{
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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))
|
||||
|
|
|
@ -85,6 +85,15 @@ namespace MediaBrowser.Controller.Entities
|
|||
}
|
||||
}
|
||||
|
||||
[IgnoreDataMember]
|
||||
public override bool IsDisplayedAsFolder
|
||||
{
|
||||
get
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
[IgnoreDataMember]
|
||||
public virtual bool SupportsCumulativeRunTimeTicks
|
||||
{
|
||||
|
|
|
@ -40,6 +40,15 @@ namespace MediaBrowser.Controller.Entities
|
|||
}
|
||||
}
|
||||
|
||||
[IgnoreDataMember]
|
||||
public override bool IsDisplayedAsFolder
|
||||
{
|
||||
get
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
[IgnoreDataMember]
|
||||
public override bool SupportsAncestors
|
||||
{
|
||||
|
|
|
@ -39,6 +39,15 @@ namespace MediaBrowser.Controller.Entities
|
|||
}
|
||||
}
|
||||
|
||||
[IgnoreDataMember]
|
||||
public override bool IsDisplayedAsFolder
|
||||
{
|
||||
get
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
[IgnoreDataMember]
|
||||
public override bool SupportsAncestors
|
||||
{
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue