use correct library name (#301)
Co-authored-by: rlauu <46294892+rlauu@users.noreply.github.com>
This commit is contained in:
parent
9f72647591
commit
e829f52acc
@ -302,8 +302,14 @@ public class VisualizationController(ILogger<VisualizationController> logger) :
|
|||||||
|
|
||||||
private static string GetLibraryName(Guid seriesId)
|
private static string GetLibraryName(Guid seriesId)
|
||||||
{
|
{
|
||||||
return seriesId == Guid.Empty
|
if (seriesId == Guid.Empty)
|
||||||
? "Unknown"
|
{
|
||||||
: Plugin.Instance?.GetItem(seriesId)?.GetTopParent()?.Name ?? "Unknown";
|
return "Unknown";
|
||||||
|
}
|
||||||
|
|
||||||
|
var collectionFolders = Plugin.Instance?.GetCollectionFolders(seriesId);
|
||||||
|
return collectionFolders?.Count > 0
|
||||||
|
? string.Join(", ", collectionFolders.Select(folder => folder.Name))
|
||||||
|
: "Unknown";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -358,6 +358,12 @@ public partial class Plugin : BasePlugin<PluginConfiguration>, IHasWebPages
|
|||||||
return _libraryManager.GetItemById(id);
|
return _libraryManager.GetItemById(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
internal List<Folder> GetCollectionFolders(Guid id)
|
||||||
|
{
|
||||||
|
var item = GetItem(id);
|
||||||
|
return item is not null ? _libraryManager.GetCollectionFolders(item) : [];
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the full path for an item.
|
/// Gets the full path for an item.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user