mirror of
https://github.com/sct/overseerr.git
synced 2025-09-17 17:24:35 +02:00
feat(servarr): auto fill base url when testing service if missing (#1995)
* feat(servarr): auto fill base url when testing service if missing This will fill the base URL of the *arr service only if it's missing and the base URL hasn't been provided beforehand * fix(servarr): replace redundant check * fix(servarr): suggested changes
This commit is contained in:

committed by
GitHub

parent
54e9071e90
commit
739f667b54
@@ -2,6 +2,35 @@ import cacheManager, { AvailableCacheIds } from '../../lib/cache';
|
||||
import { DVRSettings } from '../../lib/settings';
|
||||
import ExternalAPI from '../externalapi';
|
||||
|
||||
export interface SystemStatus {
|
||||
version: string;
|
||||
buildTime: Date;
|
||||
isDebug: boolean;
|
||||
isProduction: boolean;
|
||||
isAdmin: boolean;
|
||||
isUserInteractive: boolean;
|
||||
startupPath: string;
|
||||
appData: string;
|
||||
osName: string;
|
||||
osVersion: string;
|
||||
isNetCore: boolean;
|
||||
isMono: boolean;
|
||||
isLinux: boolean;
|
||||
isOsx: boolean;
|
||||
isWindows: boolean;
|
||||
isDocker: boolean;
|
||||
mode: string;
|
||||
branch: string;
|
||||
authentication: string;
|
||||
sqliteVersion: string;
|
||||
migrationVersion: number;
|
||||
urlBase: string;
|
||||
runtimeVersion: string;
|
||||
runtimeName: string;
|
||||
startTime: Date;
|
||||
packageUpdateMechanism: string;
|
||||
}
|
||||
|
||||
export interface RootFolder {
|
||||
id: number;
|
||||
path: string;
|
||||
@@ -81,6 +110,18 @@ class ServarrBase<QueueItemAppendT> extends ExternalAPI {
|
||||
this.apiName = apiName;
|
||||
}
|
||||
|
||||
public getSystemStatus = async (): Promise<SystemStatus> => {
|
||||
try {
|
||||
const response = await this.axios.get<SystemStatus>('/system/status');
|
||||
|
||||
return response.data;
|
||||
} catch (e) {
|
||||
throw new Error(
|
||||
`[${this.apiName}] Failed to retrieve system status: ${e.message}`
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
public getProfiles = async (): Promise<QualityProfile[]> => {
|
||||
try {
|
||||
const data = await this.getRolling<QualityProfile[]>(
|
||||
|
Reference in New Issue
Block a user