[PR #13959] Add implementation for moving items #13601

Open
opened 2025-12-22 09:57:39 +01:00 by backuprepo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/jellyfin/jellyfin/pull/13959
Author: @geo-martino
Created: 4/21/2025
Status: 🔄 Open

Base: masterHead: feat/move-item


📝 Commits (9)

  • b0a06b4 initial implementation
  • 4ac2042 exclude makefile
  • ae7b3c0 add guard clauses for unexpected move operation
  • 3aa447f drop exception handling on LibraryManager + adjust recursive settings
  • fc33ebe reorder methods
  • ed6fbbc drop returns on Move methods + expand options
  • 3fe417e Merge branch 'master' into feat/move-item
  • 72ab9a5 move children only within same folder + drop user input logging + only support libraries
  • 5004cfd add back missing file

📊 Changes

19 files changed (+597 additions, -27 deletions)

View changed files

📝 CONTRIBUTORS.md (+2 -0)
📝 Emby.Server.Implementations/IO/ManagedFileSystem.cs (+93 -5)
📝 Emby.Server.Implementations/Library/LibraryManager.cs (+140 -21)
📝 Jellyfin.Api/Controllers/LibraryController.cs (+66 -0)
📝 Jellyfin.Data/UserEntityExtensions.cs (+1 -0)
📝 Jellyfin.Server.Implementations/Item/BaseItemRepository.cs (+59 -0)
📝 Jellyfin.Server.Implementations/Users/UserManager.cs (+5 -0)
📝 MediaBrowser.Controller/Channels/IChannelManager.cs (+4 -0)
MediaBrowser.Controller/Channels/ISupportsMove.cs (+15 -0)
📝 MediaBrowser.Controller/Entities/BaseItem.cs (+49 -0)
📝 MediaBrowser.Controller/Library/ILibraryManager.cs (+27 -0)
MediaBrowser.Controller/Library/MoveItemOptions.cs (+20 -0)
📝 MediaBrowser.Controller/Persistence/IItemRepository.cs (+8 -0)
📝 MediaBrowser.Model/IO/IFileSystem.cs (+43 -0)
MediaBrowser.Model/IO/MoveOptions.cs (+20 -0)
📝 MediaBrowser.Model/Users/UserPolicy.cs (+6 -0)
📝 src/Jellyfin.Database/Jellyfin.Database.Implementations/Enums/PermissionKind.cs (+5 -0)
📝 src/Jellyfin.Database/Jellyfin.Database.Implementations/Enums/PreferenceKind.cs (+6 -1)
📝 src/Jellyfin.LiveTv/Channels/ChannelManager.cs (+28 -0)

📄 Description

Changes

Adds API endpoint and implementation for moving items to new locations on the file system while updating the reference to this new location on the item in the repository. The implementation closely follows the same patterns used for DeleteItem including setting per-user permissions for moving which ultimately can be configured in the UI with later changes.

Also expands the functionality of the MoveDirectory method in ManagedFileSystem to better integrate with the new MoveFile method and related methods.

I have conducted regression tests on a development build for the API endpoint to confirm the changes work as expected. The major caveat being that the item is replaced in the database when the item is moved to a new location. Happy to either expand this PR or open a new PR to address the remapping of IDs on items if required. (I've added a more expanded explanation of this issue in the linked issue).

Issues

Partially addresses #13958


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/jellyfin/jellyfin/pull/13959 **Author:** [@geo-martino](https://github.com/geo-martino) **Created:** 4/21/2025 **Status:** 🔄 Open **Base:** `master` ← **Head:** `feat/move-item` --- ### 📝 Commits (9) - [`b0a06b4`](https://github.com/jellyfin/jellyfin/commit/b0a06b4d5af4f2578e38f0f62d75c789da6f4902) initial implementation - [`4ac2042`](https://github.com/jellyfin/jellyfin/commit/4ac2042ff391470cc714d96f3b47cc8b631265ee) exclude makefile - [`ae7b3c0`](https://github.com/jellyfin/jellyfin/commit/ae7b3c01f431d9a1dad2859fe0d570dca2fe6190) add guard clauses for unexpected move operation - [`3aa447f`](https://github.com/jellyfin/jellyfin/commit/3aa447f3cf2bd8a67570ff4a9a1054a7189e0251) drop exception handling on LibraryManager + adjust recursive settings - [`fc33ebe`](https://github.com/jellyfin/jellyfin/commit/fc33ebe6599c87f6feb0a96deb89661e10f21300) reorder methods - [`ed6fbbc`](https://github.com/jellyfin/jellyfin/commit/ed6fbbc3185b9a7cf4f53fd13cfff8c9d855b207) drop returns on Move methods + expand options - [`3fe417e`](https://github.com/jellyfin/jellyfin/commit/3fe417e4ebd51209e4d572c7dcaad82ca70645b0) Merge branch 'master' into feat/move-item - [`72ab9a5`](https://github.com/jellyfin/jellyfin/commit/72ab9a59d1673f58f8a5855a01704f424161d2f9) move children only within same folder + drop user input logging + only support libraries - [`5004cfd`](https://github.com/jellyfin/jellyfin/commit/5004cfd1b63a4de7acd3a849c7ef272338a2ce8a) add back missing file ### 📊 Changes **19 files changed** (+597 additions, -27 deletions) <details> <summary>View changed files</summary> 📝 `CONTRIBUTORS.md` (+2 -0) 📝 `Emby.Server.Implementations/IO/ManagedFileSystem.cs` (+93 -5) 📝 `Emby.Server.Implementations/Library/LibraryManager.cs` (+140 -21) 📝 `Jellyfin.Api/Controllers/LibraryController.cs` (+66 -0) 📝 `Jellyfin.Data/UserEntityExtensions.cs` (+1 -0) 📝 `Jellyfin.Server.Implementations/Item/BaseItemRepository.cs` (+59 -0) 📝 `Jellyfin.Server.Implementations/Users/UserManager.cs` (+5 -0) 📝 `MediaBrowser.Controller/Channels/IChannelManager.cs` (+4 -0) ➕ `MediaBrowser.Controller/Channels/ISupportsMove.cs` (+15 -0) 📝 `MediaBrowser.Controller/Entities/BaseItem.cs` (+49 -0) 📝 `MediaBrowser.Controller/Library/ILibraryManager.cs` (+27 -0) ➕ `MediaBrowser.Controller/Library/MoveItemOptions.cs` (+20 -0) 📝 `MediaBrowser.Controller/Persistence/IItemRepository.cs` (+8 -0) 📝 `MediaBrowser.Model/IO/IFileSystem.cs` (+43 -0) ➕ `MediaBrowser.Model/IO/MoveOptions.cs` (+20 -0) 📝 `MediaBrowser.Model/Users/UserPolicy.cs` (+6 -0) 📝 `src/Jellyfin.Database/Jellyfin.Database.Implementations/Enums/PermissionKind.cs` (+5 -0) 📝 `src/Jellyfin.Database/Jellyfin.Database.Implementations/Enums/PreferenceKind.cs` (+6 -1) 📝 `src/Jellyfin.LiveTv/Channels/ChannelManager.cs` (+28 -0) </details> ### 📄 Description <!-- Ensure your title is short, descriptive, and in the imperative mood (Fix X, Change Y, instead of Fixed X, Changed Y). For a good inspiration of what to write in commit messages and PRs please review https://chris.beams.io/posts/git-commit/ and our documentation. --> **Changes** <!-- Describe your changes here in 1-5 sentences. --> Adds API endpoint and implementation for moving items to new locations on the file system while updating the reference to this new location on the item in the repository. The implementation closely follows the same patterns used for `DeleteItem` including setting per-user permissions for moving which ultimately can be configured in the UI with later changes. Also expands the functionality of the `MoveDirectory` method in `ManagedFileSystem` to better integrate with the new `MoveFile` method and related methods. I have conducted regression tests on a development build for the API endpoint to confirm the changes work as expected. The major caveat being that the item is replaced in the database when the item is moved to a new location. Happy to either expand this PR or open a new PR to address the remapping of IDs on items if required. (I've added a more expanded explanation of this issue in the linked issue). **Issues** <!-- Tag any issues that this PR solves here. ex. Fixes # --> Partially addresses #13958 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
backuprepo added the
pull-request
label 2025-12-22 09:57:39 +01:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: starred/jellyfin#13601
No description provided.