mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-07-16 05:43:54 +03:00
[PR #14156] [CLOSED] feat: Add backend API for media uploads #13863
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/jellyfin/jellyfin/pull/14156
Author: @sajjaddevel
Created: 5/22/2025
Status: ❌ Closed
Base:
master← Head:feature/media-upload-backend📝 Commits (2)
07fb4a6feat: Add backend API for media uploadsee7725ffeat: Add backend API for media uploads📊 Changes
4 files changed (+860 additions, -0 deletions)
View changed files
📝
Emby.Server.Implementations/Library/LibraryManager.cs(+131 -0)➕
Jellyfin.Api/Controllers/MediaUploadController.cs(+86 -0)➕
tests/Jellyfin.Api.Tests/Controllers/MediaUploadControllerTests.cs(+186 -0)➕
tests/Jellyfin.Server.Implementations.Tests/Library/LibraryManagerUploadTests.cs(+457 -0)📄 Description
This commit introduces the backend functionality required for you to upload movies and TV shows directly through the UI.
Key changes include:
New API Endpoint:
MediaUploadController.csinJellyfin.Api/Controllers.POST /Media/Uploadendpoint that acceptsIFormFile, an optionallibraryId(Guid), and an optionalcollectionType(string).File Handling Logic in LibraryManager:
AddUploadedMediaFiletoEmby.Server.Implementations/Library/LibraryManager.cs.libraryId,collectionType, or a default library.LibraryMonitor.ReportFileSystemChange) for the new file.ProviderManager.QueueRefresh) for the target library.Unit Tests:
tests/Jellyfin.Api.Tests/Controllers/MediaUploadControllerTests.cswith tests for the API endpoint, covering successful uploads, invalid inputs, and error conditions.tests/Jellyfin.Server.Implementations.Tests/Library/LibraryManagerUploadTests.cswith tests for theAddUploadedMediaFilemethod, covering various scenarios like different ways of specifying the target library, file saving, error handling, and interactions with mocked dependencies (FileSystem, LibraryMonitor, ProviderManager).This implementation provides the necessary backend support for the media upload feature. Frontend changes will be handled separately in the jellyfin-web repository.
Changes
Issues
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.