@@ -51,11 +51,11 @@ const SC_CLIENT_ID_REGEX = /client_id\s*:\s*"([a-zA-Z\d]{32})"/;
51
51
const SC_CLIENT_ID_CACHE_KEY = 'ROpdebee_ECAU_SC_ID' ;
52
52
const SC_HOMEPAGE = 'https://soundcloud.com/' ;
53
53
54
- export class SoundcloudProvider extends ProviderWithTrackImages {
54
+ export class SoundCloudProvider extends ProviderWithTrackImages {
55
55
public readonly supportedDomains = [ 'soundcloud.com' ] ;
56
56
public readonly favicon = 'https://a-v2.sndcdn.com/assets/images/sc-icons/favicon-2cadd14bdb.ico' ;
57
- public readonly name = 'Soundcloud ' ;
58
- // Soundcloud 's URL scheme is a bit complicated, so instead of creating overly
57
+ public readonly name = 'SoundCloud ' ;
58
+ // SoundCloud 's URL scheme is a bit complicated, so instead of creating overly
59
59
// complex regular expressions, we'll match URLs programmatically. However,
60
60
// we still need to define this field, even though it'll never be used.
61
61
protected readonly urlRegex = [ ] ;
@@ -88,7 +88,7 @@ export class SoundcloudProvider extends ProviderWithTrackImages {
88
88
}
89
89
}
90
90
91
- throw new Error ( 'Could not extract Soundcloud Client ID' ) ;
91
+ throw new Error ( 'Could not extract SoundCloud Client ID' ) ;
92
92
}
93
93
94
94
private static async getClientID ( ) : Promise < string > {
@@ -106,7 +106,7 @@ export class SoundcloudProvider extends ProviderWithTrackImages {
106
106
const oldId = await this . getClientID ( ) ;
107
107
const newId = await this . loadClientID ( ) ;
108
108
109
- assert ( oldId !== newId , 'Attempted to refresh Soundcloud Client ID but retrieved the same one.' ) ;
109
+ assert ( oldId !== newId , 'Attempted to refresh SoundCloud Client ID but retrieved the same one.' ) ;
110
110
localStorage . setItem ( SC_CLIENT_ID_CACHE_KEY , newId ) ;
111
111
}
112
112
@@ -120,10 +120,10 @@ export class SoundcloudProvider extends ProviderWithTrackImages {
120
120
. split ( '/' ) ;
121
121
122
122
return ( pathParts . length > 0
123
- && ! SoundcloudProvider . badArtistIDs . has ( artistId )
123
+ && ! SoundCloudProvider . badArtistIDs . has ( artistId )
124
124
// artist/likes, artist/track/recommended, artist/sets, ...
125
125
// but not artist/sets/setname!
126
- && ! SoundcloudProvider . badSubpaths . has ( urlBasename ( url ) ) ) ;
126
+ && ! SoundCloudProvider . badSubpaths . has ( urlBasename ( url ) ) ) ;
127
127
}
128
128
129
129
public override extractId ( url : URL ) : string | undefined {
@@ -141,7 +141,7 @@ export class SoundcloudProvider extends ProviderWithTrackImages {
141
141
const metadata = this . extractMetadataFromJS ( pageContent )
142
142
?. find ( ( data ) => [ 'sound' , 'playlist' ] . includes ( data . hydratable ) ) ;
143
143
if ( ! metadata ) {
144
- throw new Error ( 'Could not extract metadata from Soundcloud page. The release may have been removed.' ) ;
144
+ throw new Error ( 'Could not extract metadata from SoundCloud page. The release may have been removed.' ) ;
145
145
}
146
146
147
147
if ( metadata . hydratable === 'sound' ) {
@@ -175,7 +175,7 @@ export class SoundcloudProvider extends ProviderWithTrackImages {
175
175
covers . push ( ...backdrops . map ( ( backdropUrl ) => ( {
176
176
url : new URL ( backdropUrl ) ,
177
177
types : [ ArtworkTypeIDs . Other ] ,
178
- comment : 'Soundcloud backdrop' ,
178
+ comment : 'SoundCloud backdrop' ,
179
179
} ) ) ) ;
180
180
}
181
181
@@ -195,7 +195,7 @@ export class SoundcloudProvider extends ProviderWithTrackImages {
195
195
// Don't bother extracting track covers if they won't be used anyway
196
196
if ( onlyFront ) return covers ;
197
197
198
- // Soundcloud page only contains data for the first 5 tracks at first,
198
+ // SoundCloud page only contains data for the first 5 tracks at first,
199
199
// we need to load the rest of the tracks.
200
200
const tracks = await this . lazyLoadTracks ( metadata . data . tracks ) ;
201
201
@@ -215,7 +215,7 @@ export class SoundcloudProvider extends ProviderWithTrackImages {
215
215
trackImages . push ( ...visuals . map ( ( visualUrl ) => ( {
216
216
url : visualUrl ,
217
217
trackNumber : ( trackNumber + 1 ) . toString ( ) ,
218
- customCommentPrefix : [ 'Soundcloud backdrop for track' , 'Soundcloud backdrop for tracks' ] as [ string , string ] ,
218
+ customCommentPrefix : [ 'SoundCloud backdrop for track' , 'SoundCloud backdrop for tracks' ] as [ string , string ] ,
219
219
} ) ) ) ;
220
220
221
221
return trackImages ;
@@ -235,7 +235,7 @@ export class SoundcloudProvider extends ProviderWithTrackImages {
235
235
try {
236
236
trackData = await this . getTrackData ( lazyTrackIDs ) ;
237
237
} catch ( error ) {
238
- LOGGER . error ( 'Failed to load Soundcloud track data, some track images may be missed' , error ) ;
238
+ LOGGER . error ( 'Failed to load SoundCloud track data, some track images may be missed' , error ) ;
239
239
// We'll still return the tracks that we couldn't load, otherwise
240
240
// the track indices will be wrong.
241
241
return tracks ;
@@ -260,8 +260,8 @@ export class SoundcloudProvider extends ProviderWithTrackImages {
260
260
}
261
261
262
262
private async getTrackData ( lazyTrackIDs : number [ ] , firstTry = true ) : Promise < SCHydrationTrack [ ] > {
263
- LOGGER . info ( 'Loading Soundcloud track data' ) ;
264
- const clientId = await SoundcloudProvider . getClientID ( ) ;
263
+ LOGGER . info ( 'Loading SoundCloud track data' ) ;
264
+ const clientId = await SoundCloudProvider . getClientID ( ) ;
265
265
266
266
// TODO: Does this work still work if we pass a large list of IDs?
267
267
const parameters = new URLSearchParams ( {
@@ -278,11 +278,11 @@ export class SoundcloudProvider extends ProviderWithTrackImages {
278
278
}
279
279
280
280
LOGGER . debug ( 'Attempting to refresh client ID' ) ;
281
- await SoundcloudProvider . refreshClientID ( ) ;
281
+ await SoundCloudProvider . refreshClientID ( ) ;
282
282
return this . getTrackData ( lazyTrackIDs , firstTry = false ) ;
283
283
}
284
284
285
- return safeParseJSON < LoadedAPITrack [ ] > ( trackDataResponse . text , 'Failed to parse Soundcloud API response' ) ;
285
+ return safeParseJSON < LoadedAPITrack [ ] > ( trackDataResponse . text , 'Failed to parse SoundCloud API response' ) ;
286
286
}
287
287
288
288
private extractVisuals ( track : SCHydrationTrack ) : string [ ] {
0 commit comments