Summary
The /api/plex endpoints were replaced by the media-server abstraction layer (/api/media-server) in #2266 (commit 78e8ddca). A backward-compatible legacy controller (plex-api-legacy.controller.ts) was intentionally kept to give external integrations time to migrate. All 19 legacy endpoints already return deprecation headers (X-Deprecated, Deprecation, Link) pointing consumers to the new endpoints.
Current state
- The UI has zero references to
/api/plex — it fully uses /api/media-server
- The legacy controller is self-contained in a single file (340 lines) and delegates entirely to
MediaServerFactory
PlexApiService (the raw Plex HTTP client) is not part of this deprecation — it is still used internally by PlexAdapterService
Steps to remove
- Delete
apps/server/src/modules/api/plex-api/plex-api-legacy.controller.ts
- Edit
apps/server/src/modules/api/plex-api/plex-api.module.ts:
- Remove
PlexApiLegacyController from the controllers array (leave it as controllers: [] or omit entirely)
- Remove the
forwardRef(() => MediaServerModule) import — it is only needed by the legacy controller
- Update/remove the
@deprecated JSDoc comment on the module
- Do NOT delete the following files — they are also used by
PlexApiService:
apps/server/src/modules/api/plex-api/dto/collection-hub-settings.dto.ts
apps/server/src/modules/api/plex-api/interfaces/collection.interface.ts
Bonus: Removing the MediaServerModule import also eliminates a circular dependency between PlexApiModule and MediaServerModule (both currently use forwardRef to reference each other).
Endpoint mapping reference
Legacy (/api/plex/...) |
New (/api/media-server/...) |
GET / |
GET / |
GET /libraries |
GET /libraries |
GET /library/:id/content/:page?amount=N |
GET /library/:id/content?page=N&limit=N |
GET /library/:id/content/search/:query |
GET /library/:id/content/search/:query |
GET /meta/:id |
GET /meta/:id |
GET /meta/:id/seen |
GET /meta/:id/seen |
GET /meta/:id/children |
GET /meta/:id/children |
GET /users |
GET /users |
GET /library/:id/recent |
GET /library/:id/recent |
GET /library/:id/collections |
GET /library/:id/collections |
GET /library/collection/:collectionId |
GET /collection/:id |
GET /library/collection/:collectionId/children |
GET /collection/:id/children |
GET /search/:input |
GET /search/:query |
PUT /library/collection/:collectionId/child/:childId |
PUT /collection/:collectionId/item/:itemId |
DELETE /library/collection/:collectionId/child/:childId |
DELETE /collection/:collectionId/item/:itemId |
PUT /library/collection/update |
PUT /collection |
POST /library/collection/create |
POST /collection |
DELETE /library/collection/:collectionId |
DELETE /collection/:id |
PUT /library/collection/settings |
PUT /collection/visibility |
Acceptance criteria
Summary
The
/api/plexendpoints were replaced by the media-server abstraction layer (/api/media-server) in #2266 (commit78e8ddca). A backward-compatible legacy controller (plex-api-legacy.controller.ts) was intentionally kept to give external integrations time to migrate. All 19 legacy endpoints already return deprecation headers (X-Deprecated,Deprecation,Link) pointing consumers to the new endpoints.Current state
/api/plex— it fully uses/api/media-serverMediaServerFactoryPlexApiService(the raw Plex HTTP client) is not part of this deprecation — it is still used internally byPlexAdapterServiceSteps to remove
apps/server/src/modules/api/plex-api/plex-api-legacy.controller.tsapps/server/src/modules/api/plex-api/plex-api.module.ts:PlexApiLegacyControllerfrom thecontrollersarray (leave it ascontrollers: []or omit entirely)forwardRef(() => MediaServerModule)import — it is only needed by the legacy controller@deprecatedJSDoc comment on the modulePlexApiService:apps/server/src/modules/api/plex-api/dto/collection-hub-settings.dto.tsapps/server/src/modules/api/plex-api/interfaces/collection.interface.tsEndpoint mapping reference
/api/plex/...)/api/media-server/...)GET /GET /GET /librariesGET /librariesGET /library/:id/content/:page?amount=NGET /library/:id/content?page=N&limit=NGET /library/:id/content/search/:queryGET /library/:id/content/search/:queryGET /meta/:idGET /meta/:idGET /meta/:id/seenGET /meta/:id/seenGET /meta/:id/childrenGET /meta/:id/childrenGET /usersGET /usersGET /library/:id/recentGET /library/:id/recentGET /library/:id/collectionsGET /library/:id/collectionsGET /library/collection/:collectionIdGET /collection/:idGET /library/collection/:collectionId/childrenGET /collection/:id/childrenGET /search/:inputGET /search/:queryPUT /library/collection/:collectionId/child/:childIdPUT /collection/:collectionId/item/:itemIdDELETE /library/collection/:collectionId/child/:childIdDELETE /collection/:collectionId/item/:itemIdPUT /library/collection/updatePUT /collectionPOST /library/collection/createPOST /collectionDELETE /library/collection/:collectionIdDELETE /collection/:idPUT /library/collection/settingsPUT /collection/visibilityAcceptance criteria
/api/plex/*routes return 404PlexApiServicestill works for internal Plex adapter usage/api/media-serverendpointsforwardRefbetweenPlexApiModuleandMediaServerModuleis eliminated