aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Controller
diff options
context:
space:
mode:
authorShadowghost <Ghost_of_Stone@web.de>2026-01-30 21:58:24 +0100
committerShadowghost <Ghost_of_Stone@web.de>2026-01-31 19:21:36 +0100
commit694db80d4c8e83ff381af56d2a3dde29e0855c3d (patch)
tree4e23899944d4be1389f6f92d3bb98b400bb92a74 /MediaBrowser.Controller
parenta650148dfd9920986e11d414a71df5b1a7f604e8 (diff)
Reroute on version removal
Diffstat (limited to 'MediaBrowser.Controller')
-rw-r--r--MediaBrowser.Controller/Library/ILibraryManager.cs9
-rw-r--r--MediaBrowser.Controller/Persistence/IItemRepository.cs17
2 files changed, 26 insertions, 0 deletions
diff --git a/MediaBrowser.Controller/Library/ILibraryManager.cs b/MediaBrowser.Controller/Library/ILibraryManager.cs
index c19d15d85f..48859de04b 100644
--- a/MediaBrowser.Controller/Library/ILibraryManager.cs
+++ b/MediaBrowser.Controller/Library/ILibraryManager.cs
@@ -714,5 +714,14 @@ namespace MediaBrowser.Controller.Library
/// <param name="virtualFolderPath">The path to the virtualfolder.</param>
/// <param name="pathInfo">The new virtualfolder.</param>
public void CreateShortcut(string virtualFolderPath, MediaPathInfo pathInfo);
+
+ /// <summary>
+ /// Re-routes LinkedChildren references from one child to another.
+ /// Used when video versions change to maintain playlist/BoxSet integrity.
+ /// </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);
}
}
diff --git a/MediaBrowser.Controller/Persistence/IItemRepository.cs b/MediaBrowser.Controller/Persistence/IItemRepository.cs
index f7ed39730e..504adff86c 100644
--- a/MediaBrowser.Controller/Persistence/IItemRepository.cs
+++ b/MediaBrowser.Controller/Persistence/IItemRepository.cs
@@ -210,4 +210,21 @@ public interface IItemRepository
/// <param name="userId">The user ID for access filtering.</param>
/// <returns>Dictionary mapping parent ID to child count.</returns>
Dictionary<Guid, int> GetChildCountBatch(IReadOnlyList<Guid> parentIds, Guid? userId);
+
+ /// <summary>
+ /// Gets parent IDs (Playlists/BoxSets) that reference the specified child with LinkedChildType.Manual.
+ /// </summary>
+ /// <param name="childId">The child item ID.</param>
+ /// <returns>List of parent IDs that reference the child.</returns>
+ IReadOnlyList<Guid> GetManualLinkedParentIds(Guid childId);
+
+ /// <summary>
+ /// Updates LinkedChildren references from one child to another, preserving SortOrder.
+ /// Handles duplicates: if parent already references toChildId, removes the old reference instead.
+ /// Used when video versions change to maintain collection integrity.
+ /// </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);
}