Skip to content

Commit

Permalink
fix: Refactor static arrow function class fields to normal functions #…
Browse files Browse the repository at this point in the history
…143

Something about using arrow function form for static class methods causes node debugger to crash.

Closes #143
  • Loading branch information
FoxxMD committed Feb 19, 2024
1 parent dae4af0 commit 69e15b3
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/backend/common/vendor/AbstractApiClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export default abstract class AbstractApiClient {
this.options = options;
}

static formatPlayObj = (obj: any, options: FormatPlayObjectOptions): PlayObject => {
static formatPlayObj(obj: any, options: FormatPlayObjectOptions): PlayObject {
throw new Error('should be overridden');
}
}
2 changes: 1 addition & 1 deletion src/backend/common/vendor/LastfmApiClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export default class LastfmApiClient extends AbstractApiClient {
this.client = new LastFm(apiKey as string, secret, session);
}

static formatPlayObj = (obj: TrackObject, options: FormatPlayObjectOptions = {}): PlayObject => {
static formatPlayObj(obj: TrackObject, options: FormatPlayObjectOptions = {}): PlayObject {
const {
artist: {
'#text': artists,
Expand Down
6 changes: 3 additions & 3 deletions src/backend/common/vendor/ListenbrainzApiClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ export class ListenbrainzApiClient extends AbstractApiClient {
}
}

static listenResponseToPlay = (listen: ListenResponse): PlayObject => {
static listenResponseToPlay(listen: ListenResponse): PlayObject {
const {
listened_at,
track_metadata: {
Expand Down Expand Up @@ -512,7 +512,7 @@ export class ListenbrainzApiClient extends AbstractApiClient {
/**
* Try to parse true artists and track name without using MB information
* */
static listenResponseToNaivePlay = (listen: ListenResponse): PlayObject => {
static listenResponseToNaivePlay(listen: ListenResponse): PlayObject {
const {
listened_at,
recording_msid,
Expand Down Expand Up @@ -581,7 +581,7 @@ export class ListenbrainzApiClient extends AbstractApiClient {
}
}

static formatPlayObj = (obj: any, options: FormatPlayObjectOptions): PlayObject => {
static formatPlayObj(obj: any, options: FormatPlayObjectOptions): PlayObject {
return ListenbrainzApiClient.listenResponseToPlay(obj);
}
}
2 changes: 1 addition & 1 deletion src/backend/sources/ListenbrainzSource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export default class ListenbrainzSource extends MemorySource {
this.logger.info(`Note: The player for this source is an analogue for the 'Now Playing' status exposed by ${this.type} which is NOT used for scrobbling. Instead, the 'recently played' or 'history' information provided by this source is used for scrobbles.`)
}

static formatPlayObj = (obj: any, options: FormatPlayObjectOptions = {}) => ListenbrainzApiClient.formatPlayObj(obj, options);
static formatPlayObj(obj: any, options: FormatPlayObjectOptions = {}){ return ListenbrainzApiClient.formatPlayObj(obj, options); }

protected async doCheckConnection(): Promise<true | string | undefined> {
try {
Expand Down

0 comments on commit 69e15b3

Please sign in to comment.