1
0
mirror of https://github.com/snobu/destreamer.git synced 2026-01-24 17:02:20 +00:00

Misc fixes (#244)

* cleared up docs

* fix 401 bug for images thumbnail
This commit is contained in:
lukaarma
2020-10-08 15:00:28 +02:00
committed by GitHub
parent ec24ff9e1b
commit 22968f42ea
4 changed files with 45 additions and 23 deletions

View File

@@ -43,6 +43,11 @@ export class ApiClient {
});
}
/**
* Used to initialize/retrive the active ApiClient
*
* @param session used if initializing
*/
public static getInstance(session?: Session): ApiClient {
if (!ApiClient.instance) {
ApiClient.instance = new ApiClient(session);
@@ -51,6 +56,16 @@ export class ApiClient {
return ApiClient.instance;
}
public setSession(session: Session): void {
if (!ApiClient.instance) {
logger.warn("Trying to update ApiCient session when it's not initialized!");
}
this.session = session;
return;
}
/**
* Call Microsoft Stream API. Base URL is sourced from
* the session object and prepended automatically.