Update saved metadata on primary change

This commit is contained in:
Shadowghost
2026-02-25 21:03:46 +01:00
parent 4bd9dbe910
commit 2d0d497961
6 changed files with 42 additions and 13 deletions

View File

@@ -590,7 +590,7 @@ namespace MediaBrowser.Controller.Entities
await oldPrimary.UpdateToRepositoryAsync(ItemUpdateType.MetadataEdit, cancellationToken).ConfigureAwait(false);
// Re-route playlist/collection references from old primary to new primary
LibraryManager.RerouteLinkedChildReferences(oldPrimary.Id, newPrimary.Id);
await LibraryManager.RerouteLinkedChildReferencesAsync(oldPrimary.Id, newPrimary.Id).ConfigureAwait(false);
}
// After removing items, reattach any detached user data to remaining children

View File

@@ -767,8 +767,8 @@ namespace MediaBrowser.Controller.Library
/// </summary>
/// <param name="fromChildId">The child ID to re-route from.</param>
/// <param name="toChildId">The child ID to re-route to.</param>
/// <returns>Number of references updated.</returns>
int RerouteLinkedChildReferences(Guid fromChildId, Guid toChildId);
/// <returns>A <see cref="Task"/> representing the asynchronous operation.</returns>
Task RerouteLinkedChildReferencesAsync(Guid fromChildId, Guid toChildId);
/// <summary>
/// Gets legacy query filters for filtering UI.

View File

@@ -254,8 +254,8 @@ public interface IItemRepository
/// </summary>
/// <param name="fromChildId">The child ID to re-route from.</param>
/// <param name="toChildId">The child ID to re-route to.</param>
/// <returns>Number of references updated.</returns>
int RerouteLinkedChildren(Guid fromChildId, Guid toChildId);
/// <returns>List of parent item IDs whose LinkedChildren were modified.</returns>
IReadOnlyList<Guid> RerouteLinkedChildren(Guid fromChildId, Guid toChildId);
/// <summary>
/// Creates or updates a LinkedChild entry linking a parent to a child item.