Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
return async (dispatch) => {
const normalizedAddress = normalizeAddress(serverAddress);
setApiClient(new ApiClient(null, normalizedAddress || '-', "Jellyfin WebNG", "0.0.1", "WebNG", "WebNG", ""));
try {
await getApiClient().getPublicSystemInfo()
dispatch(connectSuccessful({ serverAddress }));
return true
} catch (err) {
dispatch(connectFailed({ serverAddress }));
return false
}
};
}
connect: function (address) {
this.apiClient = new ApiClient(null, address, "Jellyfin WebNG", '0.0.1', 'WebNG', 'WebNG', '')
}
}
import ApiClient from 'jellyfin-apiclient/dist/apiclient';
let apiClient = new ApiClient(null, '-', "Jellyfin WebNG", "0.0.1", "WebNG", "WebNG", "")
export function getApiClient(): ApiClient {
return apiClient
}
export function setApiClient(client: ApiClient) {
apiClient = client;
}