Merge branch 'CyferShepard:main' into main

This commit is contained in:
Félix MARQUET
2025-05-23 09:34:40 +02:00
committed by GitHub
22 changed files with 216 additions and 151 deletions

View File

@@ -104,8 +104,8 @@ class EmbyAPI {
//Functions
async getUsers() {
if (!this.configReady) {
async getUsers(refreshConfig = false) {
if (!this.configReady || refreshConfig) {
const success = await this.#fetchConfig();
if (!success) {
return [];
@@ -133,9 +133,9 @@ class EmbyAPI {
}
}
async getAdmins() {
async getAdmins(refreshConfig = false) {
try {
const users = await this.getUsers();
const users = await this.getUsers(refreshConfig);
return users?.filter((user) => user.Policy.IsAdministrator) || [];
} catch (error) {
this.#errorHandler(error);

View File

@@ -105,8 +105,8 @@ class JellyfinAPI {
//Functions
async getUsers() {
if (!this.configReady) {
async getUsers(refreshConfig = false) {
if (!this.configReady || refreshConfig) {
const success = await this.#fetchConfig();
if (!success) {
return [];
@@ -133,9 +133,9 @@ class JellyfinAPI {
}
}
async getAdmins() {
async getAdmins(refreshConfig = false) {
try {
const users = await this.getUsers();
const users = await this.getUsers(refreshConfig);
return users?.filter((user) => user.Policy.IsAdministrator) || [];
} catch (error) {
this.#errorHandler(error);

View File

@@ -45,7 +45,7 @@ class TaskManager {
if (code !== 0) {
console.error(`Worker ${task.name} stopped with exit code ${code}`);
}
if (onExit) {
if (code !== 0 && onExit) {
onExit();
}
delete this.tasks[task.name];