Plex and Jellyfin widget (#713)

This commit is contained in:
Manuel
2023-02-15 22:12:49 +01:00
committed by GitHub
parent ca50cffe82
commit d157e986a1
20 changed files with 1129 additions and 236 deletions

View File

@@ -0,0 +1,34 @@
import { GenericSessionInfo } from './session-info';
export type GenericMediaServer = {
/**
* The type of the media server.
* Undefined indicates, that the type is either unsupported or recognizing went wrong
*/
type: 'jellyfin' | 'plex' | undefined;
/**
* The address of the server
*/
serverAddress: string;
/**
* The current version of the server
*/
version: string | undefined;
/**
* The active sessions on the server
*/
sessions: GenericSessionInfo[];
/**
* The app id of the used app
*/
appId: string;
/**
* Indicates, wether the communication was successfull or not
*/
success: boolean;
};

View File

@@ -0,0 +1,5 @@
import { GenericMediaServer } from './media-server';
export type MediaServersResponseType = {
servers: GenericMediaServer[];
};

View File

@@ -0,0 +1,46 @@
export type GenericSessionInfo = {
supportsMediaControl: boolean;
username: string | undefined;
id: string;
sessionName: string;
userProfilePicture: string | undefined;
currentlyPlaying: GenericCurrentlyPlaying | undefined;
};
export type GenericCurrentlyPlaying = {
name: string;
seasonName: string | undefined;
albumName: string | undefined;
episodeCount: number | undefined;
type: 'audio' | 'video' | 'tv' | 'movie' | undefined;
metadata: {
video: {
videoCodec: string | undefined;
videoFrameRate: string | undefined;
height: number | undefined;
width: number | undefined;
bitrate: number | undefined;
} | undefined;
audio: {
audioCodec: string | undefined;
audioChannels: number | undefined;
} | undefined;
transcoding: {
context: string | undefined;
sourceVideoCodec: string | undefined;
sourceAudioCodec: string | undefined;
videoDecision: string | undefined;
audioDecision: string | undefined;
container: string | undefined;
videoCodec: string | undefined;
audioCodec: string | undefined;
error: boolean | undefined;
duration: number | undefined;
audioChannels: number | undefined;
width: number | undefined;
height: number | undefined;
transcodeHwRequested: boolean | undefined;
timeStamp: number | undefined;
} | undefined;
};
};

View File

@@ -41,6 +41,8 @@ export type IntegrationType =
| 'deluge'
| 'qBittorrent'
| 'transmission'
| 'plex'
| 'jellyfin'
| 'nzbGet';
export type AppIntegrationType = {
@@ -79,6 +81,8 @@ export const integrationFieldProperties: {
nzbGet: ['username', 'password'],
qBittorrent: ['username', 'password'],
transmission: ['username', 'password'],
jellyfin: ['username', 'password'],
plex: ['apiKey'],
};
export type IntegrationFieldDefinitionType = {