[PR #3871] [MERGED] Allow plugins to define their own api endpoints #9741

Closed
opened 2026-02-07 06:07:39 +03:00 by OVERLORD · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/jellyfin/jellyfin/pull/3871
Author: @daullmer
Created: 8/10/2020
Status: Merged
Merged: 8/31/2020
Merged by: @Bond-009

Base: masterHead: plugins-api


📝 Commits (6)

  • 98d1d23 Prepare plugin Api migration
  • 9e95fe8 Add plugin assemblies to mvc builder
  • d296a1f Add logging, cleanup
  • 025ee21 Change log message, load assembly only once
  • 7f79f2e Use .Distinct on assembly
  • b37cc7b Don't evaluate twice

📊 Changes

4 files changed (+41 additions, -7 deletions)

View changed files

📝 Emby.Server.Implementations/ApplicationHost.cs (+15 -1)
📝 Jellyfin.Server/Extensions/ApiServiceCollectionExtensions.cs (+12 -4)
📝 Jellyfin.Server/Startup.cs (+7 -2)
📝 MediaBrowser.Common/IApplicationHost.cs (+7 -0)

📄 Description

Changes
To allow plugins to register their own ASP.NET Web Api endpoints, we need to register each assembly in the MvcBuilder.
However, this is currently not possible, as applicationHost.Plugins doesn't contain the plugins. They get loaded after Startup.ConfigureServices ran.
Can we load the plugins earlier? I tried to move some things around (calling this line before calling this line) but InitializeServices needs the appHost.ServiceProvider which we get from the WebHostBuilder.


🔄 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/3871 **Author:** [@daullmer](https://github.com/daullmer) **Created:** 8/10/2020 **Status:** ✅ Merged **Merged:** 8/31/2020 **Merged by:** [@Bond-009](https://github.com/Bond-009) **Base:** `master` ← **Head:** `plugins-api` --- ### 📝 Commits (6) - [`98d1d23`](https://github.com/jellyfin/jellyfin/commit/98d1d2325d515ef0e6bd0a59c961967e9b5224be) Prepare plugin Api migration - [`9e95fe8`](https://github.com/jellyfin/jellyfin/commit/9e95fe8f9d402ec178024be962115abd6033fb51) Add plugin assemblies to mvc builder - [`d296a1f`](https://github.com/jellyfin/jellyfin/commit/d296a1f6d0ee8cb48c2234aa9666d01035cd18b5) Add logging, cleanup - [`025ee21`](https://github.com/jellyfin/jellyfin/commit/025ee2163ffea826083fdea6a084090733ab8fff) Change log message, load assembly only once - [`7f79f2e`](https://github.com/jellyfin/jellyfin/commit/7f79f2ee0e1fe3b5f0edb22677df9f9235d883fa) Use .Distinct on assembly - [`b37cc7b`](https://github.com/jellyfin/jellyfin/commit/b37cc7bfaf51bd205d2251daf984b35bfaad98b2) Don't evaluate twice ### 📊 Changes **4 files changed** (+41 additions, -7 deletions) <details> <summary>View changed files</summary> 📝 `Emby.Server.Implementations/ApplicationHost.cs` (+15 -1) 📝 `Jellyfin.Server/Extensions/ApiServiceCollectionExtensions.cs` (+12 -4) 📝 `Jellyfin.Server/Startup.cs` (+7 -2) 📝 `MediaBrowser.Common/IApplicationHost.cs` (+7 -0) </details> ### 📄 Description **Changes** To allow plugins to register their own ASP.NET Web Api endpoints, we need to register each assembly in the `MvcBuilder`. ~~However, this is currently not possible, as `applicationHost.Plugins` doesn't contain the plugins. They get loaded after `Startup.ConfigureServices` ran. Can we load the plugins earlier? I tried to move some things around (calling [this line](https://github.com/Ullmie02/jellyfin/blob/98d1d2325d515ef0e6bd0a59c961967e9b5224be/Jellyfin.Server/Program.cs#L188) before calling [this line](https://github.com/Ullmie02/jellyfin/blob/98d1d2325d515ef0e6bd0a59c961967e9b5224be/Jellyfin.Server/Program.cs#L184)) but `InitializeServices` needs the `appHost.ServiceProvider` which we get from the WebHostBuilder.~~ --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
OVERLORD added the pull-request label 2026-02-07 06:07:39 +03:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/jellyfin#9741