mirror of
https://github.com/BreizhHardware/Jellystat.git
synced 2026-01-19 00:37:22 +01:00
Merge branch 'CyferShepard:main' into main
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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];
|
||||
|
||||
Reference in New Issue
Block a user