Fix version names

This commit is contained in:
Shadowghost
2026-06-03 08:11:49 +02:00
parent f3ee1aa7e0
commit 40b4e4d1e5
3 changed files with 42 additions and 14 deletions

View File

@@ -408,6 +408,19 @@ namespace MediaBrowser.Controller.Entities
}
}
/// <summary>
/// Gets this video together with all of its alternate versions (local and linked and, when this
/// is itself an alternate, the primary and the primary's other versions), deduplicated.
/// </summary>
/// <returns>This video and every alternate version of it.</returns>
public IReadOnlyList<Video> GetAllVersions()
{
return GetAllItemsForMediaSources()
.Select(i => i.Item)
.OfType<Video>()
.ToList();
}
/// <summary>
/// Gets the alternate version of this video that matches the supplied item id.
/// </summary>
@@ -415,10 +428,7 @@ namespace MediaBrowser.Controller.Entities
/// <returns>The matching version, or <c>null</c> when the id is not a version of this video.</returns>
public Video GetAlternateVersion(Guid itemId)
{
return GetAllItemsForMediaSources()
.Select(i => i.Item)
.OfType<Video>()
.FirstOrDefault(i => i.Id.Equals(itemId));
return GetAllVersions().FirstOrDefault(i => i.Id.Equals(itemId));
}
public override string CreatePresentationUniqueKey()