mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-07-09 03:04:24 -04:00
show library folder images
This commit is contained in:
parent
f4ad65196a
commit
8f1899906b
@ -32,5 +32,11 @@ namespace MediaBrowser.Model.Entities
|
|||||||
{
|
{
|
||||||
Locations = new List<string>();
|
Locations = new List<string>();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the primary image item identifier.
|
||||||
|
/// </summary>
|
||||||
|
/// <value>The primary image item identifier.</value>
|
||||||
|
public string PrimaryImageItemId { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1171,8 +1171,15 @@ namespace MediaBrowser.Server.Implementations.Library
|
|||||||
/// <returns>IEnumerable{VirtualFolderInfo}.</returns>
|
/// <returns>IEnumerable{VirtualFolderInfo}.</returns>
|
||||||
private IEnumerable<VirtualFolderInfo> GetView(string path)
|
private IEnumerable<VirtualFolderInfo> GetView(string path)
|
||||||
{
|
{
|
||||||
|
var topLibraryFolders = GetUserRootFolder().Children.ToList();
|
||||||
|
|
||||||
return _fileSystem.GetDirectoryPaths(path)
|
return _fileSystem.GetDirectoryPaths(path)
|
||||||
.Select(dir => new VirtualFolderInfo
|
.Select(dir => GetVirtualFolderInfo(dir, topLibraryFolders));
|
||||||
|
}
|
||||||
|
|
||||||
|
private VirtualFolderInfo GetVirtualFolderInfo(string dir, List<BaseItem> collectionFolders)
|
||||||
|
{
|
||||||
|
var info = new VirtualFolderInfo
|
||||||
{
|
{
|
||||||
Name = Path.GetFileName(dir),
|
Name = Path.GetFileName(dir),
|
||||||
|
|
||||||
@ -1182,7 +1189,16 @@ namespace MediaBrowser.Server.Implementations.Library
|
|||||||
.ToList(),
|
.ToList(),
|
||||||
|
|
||||||
CollectionType = GetCollectionType(dir)
|
CollectionType = GetCollectionType(dir)
|
||||||
});
|
};
|
||||||
|
|
||||||
|
var libraryFolder = collectionFolders.FirstOrDefault(i => string.Equals(i.Path, dir, StringComparison.OrdinalIgnoreCase));
|
||||||
|
|
||||||
|
if (libraryFolder != null && libraryFolder.HasImage(ImageType.Primary))
|
||||||
|
{
|
||||||
|
info.PrimaryImageItemId = libraryFolder.Id.ToString("N");
|
||||||
|
}
|
||||||
|
|
||||||
|
return info;
|
||||||
}
|
}
|
||||||
|
|
||||||
private string GetCollectionType(string path)
|
private string GetCollectionType(string path)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user