move reattaching user data to own function and call it only after fetching metadata for the first time

This commit is contained in:
MarcoCoreDuo
2025-12-30 20:09:53 +01:00
parent 78e3702cb0
commit e4b82025b8
7 changed files with 49 additions and 17 deletions

View File

@@ -2053,6 +2053,8 @@ namespace MediaBrowser.Controller.Entities
public virtual async Task UpdateToRepositoryAsync(ItemUpdateType updateReason, CancellationToken cancellationToken)
=> await LibraryManager.UpdateItemAsync(this, GetParent(), updateReason, cancellationToken).ConfigureAwait(false);
public void ReattachUserData(CancellationToken cancellationToken) => LibraryManager.ReattachUserData(this, cancellationToken);
/// <summary>
/// Validates that images within the item are still on the filesystem.
/// </summary>

View File

@@ -281,6 +281,13 @@ namespace MediaBrowser.Controller.Library
/// <returns>Returns a Task that can be awaited.</returns>
Task UpdateItemAsync(BaseItem item, BaseItem parent, ItemUpdateType updateReason, CancellationToken cancellationToken);
/// <summary>
/// Reattaches the user data to the item.
/// </summary>
/// <param name="item">The item.</param>
/// <param name="cancellationToken">The cancellation token.</param>
void ReattachUserData(BaseItem item, CancellationToken cancellationToken);
/// <summary>
/// Retrieves the item.
/// </summary>

View File

@@ -35,6 +35,13 @@ public interface IItemRepository
void SaveImages(BaseItem item);
/// <summary>
/// Reattaches the user data to the item.
/// </summary>
/// <param name="item">The item.</param>
/// <param name="cancellationToken">The cancellation token.</param>
void ReattachUserData(BaseItem item, CancellationToken cancellationToken);
/// <summary>
/// Retrieves the item.
/// </summary>