Repository: ROpdebee/mb-userscripts
Pull request #782 (2024-07-26 18:54:15)

build(deps-dev): bump braces from 3.0.2 to 3.0.3
Bumps [braces](https://github.com/micromatch/braces) from 3.0.2 to 3.0.3.
<details>
<summary>Commits</summary>
<ul>
<li><a href="https://github.com/micromatch/braces/commit/74b2db2938fad48a2ea54a9c8bf27a37a62c350d"><code>74b2db2</code></a> 3.0.3</li>
<li><a href="https://github.com/micromatch/braces/commit/88f1429a0f47e1dd3813de35211fc97ffda27f9e"><code>88f1429</code></a> update eslint. lint, fix unit tests.</li>
<li><a href="https://github.com/micromatch/braces/commit/415d660c3002d1ab7e63dbf490c9851da80596ff"><code>415d660</code></a> Snyk js braces 6838727 (<a href="https://redirect.github.com/micromatch/braces/issues/40">#40</a>)</li>
<li><a href="https://github.com/micromatch/braces/commit/190510f79db1adf21d92798b0bb6fccc1f72c9d6"><code>190510f</code></a> fix tests, skip 1 test in test/braces.expand</li>
<li><a href="https://github.com/micromatch/braces/commit/716eb9f12d820b145a831ad678618731927e8856"><code>716eb9f</code></a> readme bump</li>
<li><a href="https://github.com/micromatch/braces/commit/a5851e57f45c3431a94d83fc565754bc10f5bbc3"><code>a5851e5</code></a> Merge pull request <a href="https://redirect.github.com/micromatch/braces/issues/37">#37</a> from coderaiser/fix/vulnerability</li>
<li><a href="https://github.com/micromatch/braces/commit/2092bd1fb108d2c59bd62e243b70ad98db961538"><code>2092bd1</code></a> feature: braces: add maxSymbols (<a href="https://github.com/micromatch/braces/issues/">https://github.com/micromatch/braces/issues/</a>...</li>
<li><a href="https://github.com/micromatch/braces/commit/9f5b4cf47329351bcb64287223ffb6ecc9a5e6d3"><code>9f5b4cf</code></a> fix: vulnerability (<a href="https://security.snyk.io/vuln/SNYK-JS-BRACES-6838727">https://security.snyk.io/vuln/SNYK-JS-BRACES-6838727</a>)</li>
<li><a href="https://github.com/micromatch/braces/commit/98414f9f1fabe021736e26836d8306d5de747e0d"><code>98414f9</code></a> remove funding file</li>
<li><a href="https://github.com/micromatch/braces/commit/665ab5d561c017a38ba7aafd92cc6655b91d8c14"><code>665ab5d</code></a> update keepEscaping doc (<a href="https://redirect.github.com/micromatch/braces/issues/27">#27</a>)</li>
<li>Additional commits viewable in <a href="https://github.com/micromatch/braces/compare/3.0.2...3.0.3">compare view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=braces&package-manager=npm_and_yarn&previous-version=3.0.2&new-version=3.0.3)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
You can disable automated security fix PRs for this repo from the [Security Alerts page](https://github.com/ROpdebee/mb-userscripts/network/alerts).

</details>


Patch:
diff --git a/package-lock.json b/package-lock.json
index 22404248..16573a76 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -5934,12 +5934,12 @@
       }
     },
     "node_modules/braces": {
-      "version": "3.0.2",
-      "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz",
-      "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==",
+      "version": "3.0.3",
+      "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz",
+      "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==",
       "dev": true,
       "dependencies": {
-        "fill-range": "^7.0.1"
+        "fill-range": "^7.1.1"
       },
       "engines": {
         "node": ">=8"
@@ -8075,9 +8075,9 @@
       }
     },
     "node_modules/fill-range": {
-      "version": "7.0.1",
-      "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz",
-      "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==",
+      "version": "7.1.1",
+      "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz",
+      "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==",
       "dev": true,
       "dependencies": {
         "to-regex-range": "^5.0.1"
@@ -11452,8 +11452,9 @@
     },
     "node_modules/nativejsx": {
       "version": "4.3.0",
-      "resolved": "git+ssh://git@github.com/ROpdebee/nativejsx.git#f2bed01d621bb158134e13ed3abb9be9e265cd00",
+      "resolved": "git+ssh://git@github.com/ROpdebee/nativejsx.git#dc9d4694ff92c78f76b153e44af69948b035a5a4",
       "dev": true,
+      "license": "MIT",
       "dependencies": {
         "acorn": "^8.3.0",
         "acorn-jsx": "^5.3.1",
diff --git a/src/mb_enhanced_cover_art_uploads/docs/supported_providers.md b/src/mb_enhanced_cover_art_uploads/docs/supported_providers.md
index 7f47f366..1c738229 100644
--- a/src/mb_enhanced_cover_art_uploads/docs/supported_providers.md
+++ b/src/mb_enhanced_cover_art_uploads/docs/supported_providers.md
@@ -29,7 +29,7 @@ The following table describes the types of links supported by MB: Upload to CAA
 | Qobuz | ✔️ | ✔️ | Goodies are grabbed whenever possible. Back covers might not be supported at this time, if you have a release with a back cover, please let me know. Maximised to original source image. |
 | RateYourMusic | ✔️ | ✔️ | Requires being logged in to RYM. |
 | Rockipedia | ✔️ | ❌ |
-| Soundcloud | ✔️ | ✔️ | Grabs custom track images. |
+| SoundCloud | ✔️ | ✔️ | Grabs custom track images. |
 | Spotify | ✔️ | ✔️ |
 | Tidal | ✔️ | ✔️ | listen.tidal.com/store.tidal.com are converted to tidal.com prior to fetching |
 | Traxsource | ✔️ | ✔️ | Limited to 600x600. |
diff --git a/src/mb_enhanced_cover_art_uploads/providers/base.ts b/src/mb_enhanced_cover_art_uploads/providers/base.ts
index fde8ad7f..9da9b78b 100644
--- a/src/mb_enhanced_cover_art_uploads/providers/base.ts
+++ b/src/mb_enhanced_cover_art_uploads/providers/base.ts
@@ -163,7 +163,7 @@ export abstract class ProviderWithTrackImages extends CoverArtProvider {
     // Providers that provide track images which need to be deduplicated. The
     // base class supports deduping by URL and thumbnail content.
     //
-    // Some providers, like Soundcloud and sometimes Bandcamp, use unique URLs
+    // Some providers, like SoundCloud and sometimes Bandcamp, use unique URLs
     // for each track image, so deduplicating based on URL won't work. They may
     // also not return any headers that uniquely identify the image (like a
     // Digest or an ETag), so we need to load the image and compare its data
diff --git a/src/mb_enhanced_cover_art_uploads/providers/index.ts b/src/mb_enhanced_cover_art_uploads/providers/index.ts
index 9609a182..4cd5d2ea 100644
--- a/src/mb_enhanced_cover_art_uploads/providers/index.ts
+++ b/src/mb_enhanced_cover_art_uploads/providers/index.ts
@@ -25,7 +25,7 @@ import { NetEaseProvider } from './netease';
 import { QobuzProvider } from './qobuz';
 import { RateYourMusicProvider } from './rateyourmusic';
 import { RockipediaProvider } from './rockipedia';
-import { SoundcloudProvider } from './soundcloud';
+import { SoundCloudProvider } from './soundcloud';
 import { SpotifyProvider } from './spotify';
 import { TidalProvider } from './tidal';
 import { TraxsourceProvider } from './traxsource';
@@ -68,7 +68,7 @@ addProvider(new QobuzProvider());
 addProvider(new RateYourMusicProvider());
 addProvider(new RockipediaProvider());
 addProvider(new SevenDigitalProvider());
-addProvider(new SoundcloudProvider());
+addProvider(new SoundCloudProvider());
 addProvider(new SpotifyProvider());
 addProvider(new TidalProvider());
 addProvider(new TraxsourceProvider());
diff --git a/src/mb_enhanced_cover_art_uploads/providers/soundcloud.ts b/src/mb_enhanced_cover_art_uploads/providers/soundcloud.ts
index 72abdb98..ab1def5c 100644
--- a/src/mb_enhanced_cover_art_uploads/providers/soundcloud.ts
+++ b/src/mb_enhanced_cover_art_uploads/providers/soundcloud.ts
@@ -51,11 +51,11 @@ const SC_CLIENT_ID_REGEX = /client_id\s*:\s*"([a-zA-Z\d]{32})"/;
 const SC_CLIENT_ID_CACHE_KEY = 'ROpdebee_ECAU_SC_ID';
 const SC_HOMEPAGE = 'https://soundcloud.com/';
 
-export class SoundcloudProvider extends ProviderWithTrackImages {
+export class SoundCloudProvider extends ProviderWithTrackImages {
     public readonly supportedDomains = ['soundcloud.com'];
     public readonly favicon = 'https://a-v2.sndcdn.com/assets/images/sc-icons/favicon-2cadd14bdb.ico';
-    public readonly name = 'Soundcloud';
-    // Soundcloud's URL scheme is a bit complicated, so instead of creating overly
+    public readonly name = 'SoundCloud';
+    // SoundCloud's URL scheme is a bit complicated, so instead of creating overly
     // complex regular expressions, we'll match URLs programmatically. However,
     // we still need to define this field, even though it'll never be used.
     protected readonly urlRegex = [];
@@ -88,7 +88,7 @@ export class SoundcloudProvider extends ProviderWithTrackImages {
             }
         }
 
-        throw new Error('Could not extract Soundcloud Client ID');
+        throw new Error('Could not extract SoundCloud Client ID');
     }
 
     private static async getClientID(): Promise<string> {
@@ -106,7 +106,7 @@ export class SoundcloudProvider extends ProviderWithTrackImages {
         const oldId = await this.getClientID();
         const newId = await this.loadClientID();
 
-        assert(oldId !== newId, 'Attempted to refresh Soundcloud Client ID but retrieved the same one.');
+        assert(oldId !== newId, 'Attempted to refresh SoundCloud Client ID but retrieved the same one.');
         localStorage.setItem(SC_CLIENT_ID_CACHE_KEY, newId);
     }
 
@@ -120,10 +120,10 @@ export class SoundcloudProvider extends ProviderWithTrackImages {
             .split('/');
 
         return (pathParts.length > 0
-            && !SoundcloudProvider.badArtistIDs.has(artistId)
+            && !SoundCloudProvider.badArtistIDs.has(artistId)
             // artist/likes, artist/track/recommended, artist/sets, ...
             // but not artist/sets/setname!
-            && !SoundcloudProvider.badSubpaths.has(urlBasename(url)));
+            && !SoundCloudProvider.badSubpaths.has(urlBasename(url)));
     }
 
     public override extractId(url: URL): string | undefined {
@@ -141,7 +141,7 @@ export class SoundcloudProvider extends ProviderWithTrackImages {
         const metadata = this.extractMetadataFromJS(pageContent)
             ?.find((data) => ['sound', 'playlist'].includes(data.hydratable));
         if (!metadata) {
-            throw new Error('Could not extract metadata from Soundcloud page. The release may have been removed.');
+            throw new Error('Could not extract metadata from SoundCloud page. The release may have been removed.');
         }
 
         if (metadata.hydratable === 'sound') {
@@ -175,7 +175,7 @@ export class SoundcloudProvider extends ProviderWithTrackImages {
             covers.push(...backdrops.map((backdropUrl) => ({
                 url: new URL(backdropUrl),
                 types: [ArtworkTypeIDs.Other],
-                comment: 'Soundcloud backdrop',
+                comment: 'SoundCloud backdrop',
             })));
         }
 
@@ -195,7 +195,7 @@ export class SoundcloudProvider extends ProviderWithTrackImages {
         // Don't bother extracting track covers if they won't be used anyway
         if (onlyFront) return covers;
 
-        // Soundcloud page only contains data for the first 5 tracks at first,
+        // SoundCloud page only contains data for the first 5 tracks at first,
         // we need to load the rest of the tracks.
         const tracks = await this.lazyLoadTracks(metadata.data.tracks);
 
@@ -215,7 +215,7 @@ export class SoundcloudProvider extends ProviderWithTrackImages {
                 trackImages.push(...visuals.map((visualUrl) => ({
                     url: visualUrl,
                     trackNumber: (trackNumber + 1).toString(),
-                    customCommentPrefix: ['Soundcloud backdrop for track', 'Soundcloud backdrop for tracks'] as [string, string],
+                    customCommentPrefix: ['SoundCloud backdrop for track', 'SoundCloud backdrop for tracks'] as [string, string],
                 })));
 
                 return trackImages;
@@ -235,7 +235,7 @@ export class SoundcloudProvider extends ProviderWithTrackImages {
         try {
             trackData = await this.getTrackData(lazyTrackIDs);
         } catch (error) {
-            LOGGER.error('Failed to load Soundcloud track data, some track images may be missed', error);
+            LOGGER.error('Failed to load SoundCloud track data, some track images may be missed', error);
             // We'll still return the tracks that we couldn't load, otherwise
             // the track indices will be wrong.
             return tracks;
@@ -260,8 +260,8 @@ export class SoundcloudProvider extends ProviderWithTrackImages {
     }
 
     private async getTrackData(lazyTrackIDs: number[], firstTry = true): Promise<SCHydrationTrack[]> {
-        LOGGER.info('Loading Soundcloud track data');
-        const clientId = await SoundcloudProvider.getClientID();
+        LOGGER.info('Loading SoundCloud track data');
+        const clientId = await SoundCloudProvider.getClientID();
 
         // TODO: Does this work still work if we pass a large list of IDs?
         const parameters = new URLSearchParams({
@@ -278,11 +278,11 @@ export class SoundcloudProvider extends ProviderWithTrackImages {
             }
 
             LOGGER.debug('Attempting to refresh client ID');
-            await SoundcloudProvider.refreshClientID();
+            await SoundCloudProvider.refreshClientID();
             return this.getTrackData(lazyTrackIDs, firstTry = false);
         }
 
-        return safeParseJSON<LoadedAPITrack[]>(trackDataResponse.text, 'Failed to parse Soundcloud API response');
+        return safeParseJSON<LoadedAPITrack[]>(trackDataResponse.text, 'Failed to parse SoundCloud API response');
     }
 
     private extractVisuals(track: SCHydrationTrack): string[] {


Test patch:
diff --git a/tests/unit/mb_enhanced_cover_art_uploads/providers/soundcloud.test.ts b/tests/unit/mb_enhanced_cover_art_uploads/providers/soundcloud.test.ts
index 538f62b7..d5b71818 100644
--- a/tests/unit/mb_enhanced_cover_art_uploads/providers/soundcloud.test.ts
+++ b/tests/unit/mb_enhanced_cover_art_uploads/providers/soundcloud.test.ts
@@ -1,6 +1,6 @@
 import { LOGGER } from '@lib/logging/logger';
 import { ArtworkTypeIDs } from '@lib/MB/cover-art';
-import { SoundcloudProvider } from '@src/mb_enhanced_cover_art_uploads/providers/soundcloud';
+import { SoundCloudProvider } from '@src/mb_enhanced_cover_art_uploads/providers/soundcloud';
 import { setupPolly } from '@test-utils/pollyjs';
 import { itBehavesLike } from '@test-utils/shared-behaviour';
 
@@ -16,7 +16,7 @@ afterEach(() => {
 });
 
 describe('soundcloud provider', () => {
-    const provider = new SoundcloudProvider();
+    const provider = new SoundCloudProvider();
     const pollyContext = setupPolly();
 
     describe('url matching', () => {
@@ -113,7 +113,7 @@ describe('soundcloud provider', () => {
                 index: 3,
                 urlPart: '9b0d4395-cc72-4aa9-84e1-17b807264e2f',
                 types: [ArtworkTypeIDs.Track],
-                comment: 'Soundcloud backdrop for tracks 2, 4, 6, 8, 10, 18, 20',
+                comment: 'SoundCloud backdrop for tracks 2, 4, 6, 8, 10, 18, 20',
             }],
         }];
 
@@ -168,7 +168,7 @@ describe('soundcloud provider', () => {
             const covers = await provider.findImages(new URL('https://soundcloud.com/soundcloud/sets/i-am-other-vol-2'));
 
             expect(covers).toBeArrayOfSize(6);
-            expect(mockLoggerError).toHaveBeenCalledWith('Failed to load Soundcloud track data, some track images may be missed', expect.any(Error));
+            expect(mockLoggerError).toHaveBeenCalledWith('Failed to load SoundCloud track data, some track images may be missed', expect.any(Error));
         });
 
         it('attempts to refresh client ID', async () => {