feat(rebase): rebase

This commit is contained in:
Aiden Vigue
2021-02-15 11:07:36 -05:00
parent d81e7cdbab
commit 3743edab8d
4 changed files with 213 additions and 6 deletions

View File

@@ -55,6 +55,9 @@ components:
plexToken:
type: string
readOnly: true
jellyfinAuthToken:
type: string
readOnly: true
userType:
type: integer
example: 1
@@ -124,6 +127,9 @@ components:
localLogin:
type: boolean
example: true
mediaServerType:
type: string
example: 'PLEX | JELLYFIN'
defaultPermissions:
type: number
example: 32
@@ -292,6 +298,47 @@ components:
- provides
- owned
- connection
JellyfinLibrary:
type: object
properties:
id:
type: string
name:
type: string
example: Movies
enabled:
type: boolean
example: false
required:
- id
- name
- enabled
JellyfinSettings:
type: object
properties:
name:
type: string
example: 'Main Server'
readOnly: true
hostname:
type: string
example: 'http://my.jellyfin.host'
adminUser:
type: string
example: 'admin'
adminPass:
type: string
example: 'mypassword'
libraries:
type: array
readOnly: true
items:
$ref: '#/components/schemas/JellyfinLibrary'
serverID:
type: string
readOnly: true
required:
- hostname
RadarrSettings:
type: object
properties:
@@ -1630,6 +1677,136 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/MainSettings'
/settings/jellyfin:
get:
summary: Get Jellyfin settings
description: Retrieves current Jellyfin settings.
tags:
- settings
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/JellyfinSettings'
post:
summary: Update Jellyfin settings
description: Updates Jellyfin settings with the provided values.
tags:
- settings
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/JellyfinSettings'
responses:
'200':
description: 'Values were successfully updated'
content:
application/json:
schema:
$ref: '#/components/schemas/JellyfinSettings'
/settings/jellyfin/library:
get:
summary: Get Jellyfin libraries
description: Returns a list of Jellyfin libraries in a JSON array.
tags:
- settings
parameters:
- in: query
name: sync
description: Syncs the current libraries with the current Jellyfin server
schema:
type: string
nullable: true
- in: query
name: enable
explode: false
allowReserved: true
description: Comma separated list of libraries to enable. Any libraries not passed will be disabled!
schema:
type: string
nullable: true
responses:
'200':
description: 'Jellyfin libraries returned'
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/JellyfinLibrary'
/settings/jellyfin/sync:
get:
summary: Get status of full Jellyfin library sync
description: Returns sync progress in a JSON array.
tags:
- settings
responses:
'200':
description: Status of Jellyfin sync
content:
application/json:
schema:
type: object
properties:
running:
type: boolean
example: false
progress:
type: number
example: 0
total:
type: number
example: 100
currentLibrary:
$ref: '#/components/schemas/JellyfinLibrary'
libraries:
type: array
items:
$ref: '#/components/schemas/JellyfinLibrary'
post:
summary: Start full Jellyfin library sync
description: Runs a full Jellyfin library sync and returns the progress in a JSON array.
tags:
- settings
requestBody:
content:
application/json:
schema:
type: object
properties:
cancel:
type: boolean
example: false
start:
type: boolean
example: false
responses:
'200':
description: Status of Jellyfin sync
content:
application/json:
schema:
type: object
properties:
running:
type: boolean
example: false
progress:
type: number
example: 0
total:
type: number
example: 100
currentLibrary:
$ref: '#/components/schemas/JellyfinLibrary'
libraries:
type: array
items:
$ref: '#/components/schemas/JellyfinLibrary'
/settings/plex:
get:
summary: Get Plex settings
@@ -2638,6 +2815,36 @@ paths:
type: string
required:
- authToken
/auth/jellyfin:
post:
summary: Sign in using a Jellyfin username and password
description: Takes the user's username and password to log the user in. Generates a session cookie for use in further requests. If the user does not exist, and there are no other users, then a user will be created with full admin privileges. If a user logs in with access to the main Plex server, they will also have an account created, but without any permissions.
security: []
tags:
- auth
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/User'
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
username:
type: string
password:
type: string
hostname:
type: string
required:
- username
- password
/auth/local:
post:
summary: Sign in using a local account

View File

@@ -120,8 +120,7 @@ app
}).connect(sessionRespository) as Store,
})
);
//const apiDocs = YAML.load(API_SPEC_PATH);
/*
const apiDocs = YAML.load(API_SPEC_PATH);
server.use('/api-docs', swaggerUi.serve, swaggerUi.setup(apiDocs));
server.use(
OpenApiValidator.middleware({
@@ -134,7 +133,7 @@ app
* OpenAPI validator. Otherwise, they are treated as objects instead of strings
* and response validation will fail
*/
/*
server.use((_req, res, next) => {
const original = res.json;
res.json = function jsonp(json) {
@@ -142,7 +141,6 @@ app
};
next();
});
*/
server.use('/api/v1', routes);
server.get('*', (req, res) => handle(req, res));
server.use(

View File

@@ -127,7 +127,7 @@ class JobJellyfinSync {
(hasOtherResolution || (has4k && !this.enable4kMovie)) &&
existing.jellyfinMediaID !== metadata.Id
) {
existing.jellyfinMediaID !== metadata.Id;
existing.jellyfinMediaID = metadata.Id;
changedExisting = true;
}

View File

@@ -227,7 +227,9 @@ settingsRoutes.post('/plex/sync', (req, res) => {
settingsRoutes.get('/jellyfin', (_req, res) => {
const settings = getSettings();
res.status(200).json(settings.jellyfin);
//DO NOT RETURN ADMIN USER CREDENTIALS!!
res.status(200).json(omit(settings.jellyfin, ['adminUser', 'adminPass']));
});
settingsRoutes.post('/jellyfin', (req, res) => {