mirror of
https://github.com/snobu/destreamer.git
synced 2026-01-26 18:02:19 +00:00
Merge branch 'master' of https://github.com/snobu/destreamer into aria2c_forRealNow
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user