More debug information

This commit is contained in:
Izuco 2022-03-17 17:26:23 +01:00
parent f1c2f84f66
commit 431e840913
No known key found for this signature in database
GPG key ID: E9CBE9E4EF3A1BFA
2 changed files with 7 additions and 2 deletions

View file

@ -11,6 +11,7 @@ class CrunchyHandler extends Base implements MessageHandler {
constructor(window: BrowserWindow) {
super(window);
this.crunchy = new Crunchy();
this.crunchy.refreshToken();
}
public async listEpisodes (id: string): Promise<EpisodeListResponse> {
@ -35,6 +36,7 @@ class CrunchyHandler extends Base implements MessageHandler {
}
public async resolveItems(data: ResolveItemsData): Promise<ResponseBase<QueueItem[]>> {
console.log(`[DEBUG] Got resolve options: ${JSON.stringify(data)}`)
const res = await this.crunchy.downloadFromSeriesID(data.id, data);
if (!res.isOk)
return res;
@ -54,7 +56,7 @@ class CrunchyHandler extends Base implements MessageHandler {
}
public async search(data: SearchData): Promise<SearchResponse> {
this.crunchy.refreshToken();
console.log(`[DEBUG] Got search options: ${JSON.stringify(data)}`)
const crunchySearch = await this.crunchy.doSearch(data);
if (!crunchySearch.isOk)
return crunchySearch;
@ -74,9 +76,9 @@ class CrunchyHandler extends Base implements MessageHandler {
}
public async downloadItem(data: DownloadData) {
console.log(`[DEBUG] Got download options: ${JSON.stringify(data)}`)
this.setDownloading(true);
const _default = buildDefault() as ArgvType;
await this.crunchy.refreshToken();
const res = await this.crunchy.downloadFromSeriesID(data.id, {
dubLang: data.dubLang,
e: data.e

View file

@ -52,6 +52,7 @@ class FunimationHandler extends Base implements MessageHandler {
}
public async resolveItems(data: ResolveItemsData): Promise<ResponseBase<QueueItem[]>> {
console.log(`[DEBUG] Got resolve options: ${JSON.stringify(data)}`)
const res = await this.funi.getShow(false, { ...data, id: parseInt(data.id) });
if (!res.isOk)
return res;
@ -71,6 +72,7 @@ class FunimationHandler extends Base implements MessageHandler {
}
public async search(data: SearchData): Promise<SearchResponse> {
console.log(`[DEBUG] Got search options: ${JSON.stringify(data)}`)
const funiSearch = await this.funi.searchShow(false, data);
if (!funiSearch.isOk)
return funiSearch;
@ -94,6 +96,7 @@ class FunimationHandler extends Base implements MessageHandler {
public async downloadItem(data: DownloadData) {
this.setDownloading(true);
console.log(`[DEBUG] Got download options: ${JSON.stringify(data)}`)
const res = await this.funi.getShow(false, { all: false, but: false, id: parseInt(data.id), e: data.e });
const _default = buildDefault() as ArgvType;
if (!res.isOk)