mirror of
https://github.com/ajnart/homarr.git
synced 2025-11-18 03:01:09 +01:00
✨ Plex and Jellyfin widget (#713)
This commit is contained in:
34
src/types/api/media-server/media-server.ts
Normal file
34
src/types/api/media-server/media-server.ts
Normal 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;
|
||||
};
|
||||
5
src/types/api/media-server/response.ts
Normal file
5
src/types/api/media-server/response.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
import { GenericMediaServer } from './media-server';
|
||||
|
||||
export type MediaServersResponseType = {
|
||||
servers: GenericMediaServer[];
|
||||
};
|
||||
46
src/types/api/media-server/session-info.ts
Normal file
46
src/types/api/media-server/session-info.ts
Normal 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;
|
||||
};
|
||||
};
|
||||
@@ -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 = {
|
||||
|
||||
Reference in New Issue
Block a user