Repository: ROpdebee/mb-userscripts
Pull request #304 (2021-12-14 11:02:52)

refactor(caa upload): move `ArtworkTypeIDs` to `lib/MB/CoverArt`
It'll most likely be useful in Supercharged CAA Edits, but more importantly, we'll need it in some of the E2E tests, and importing it from `providers/base` (which wasn't a good spot for the enum anyway) leads to errors because of a dependency chain ending up in `@src/compat`, which dereferences `GM` functions.

Cherry-picked from #254, will probably conflict with #301 but we can fix that later.

codecov[bot]: # [Codecov](https://codecov.io/gh/ROpdebee/mb-userscripts/pull/304?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Ruben+Opdebeeck) Report
> Merging [#304](https://codecov.io/gh/ROpdebee/mb-userscripts/pull/304?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Ruben+Opdebeeck) (6b7cc40) into [main](https://codecov.io/gh/ROpdebee/mb-userscripts/commit/3f9e89dd525b112b9784c9eb793b13d45d0b2501?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Ruben+Opdebeeck) (3f9e89d) will **not change** coverage.
> The diff coverage is `n/a`.

[![Impacted file tree graph](https://codecov.io/gh/ROpdebee/mb-userscripts/pull/304/graphs/tree.svg?width=650&height=150&src=pr&token=CjulzlICM8&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Ruben+Opdebeeck)](https://codecov.io/gh/ROpdebee/mb-userscripts/pull/304?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Ruben+Opdebeeck)

```diff
@@            Coverage Diff            @@
##              main      #304   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           40        40           
  Lines          888       888           
  Branches       159       159           
=========================================
  Hits           888       888           
```


| [Impacted Files](https://codecov.io/gh/ROpdebee/mb-userscripts/pull/304?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Ruben+Opdebeeck) | Coverage Δ | |
|---|---|---|
| [src/mb\_enhanced\_cover\_art\_uploads/fetch.ts](https://codecov.io/gh/ROpdebee/mb-userscripts/pull/304/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Ruben+Opdebeeck#diff-c3JjL21iX2VuaGFuY2VkX2NvdmVyX2FydF91cGxvYWRzL2ZldGNoLnRz) | `100.00% <ø> (ø)` | |
| [src/mb\_enhanced\_cover\_art\_uploads/form.ts](https://codecov.io/gh/ROpdebee/mb-userscripts/pull/304/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Ruben+Opdebeeck#diff-c3JjL21iX2VuaGFuY2VkX2NvdmVyX2FydF91cGxvYWRzL2Zvcm0udHM=) | `100.00% <ø> (ø)` | |
| [.../mb\_enhanced\_cover\_art\_uploads/providers/amazon.ts](https://codecov.io/gh/ROpdebee/mb-userscripts/pull/304/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Ruben+Opdebeeck#diff-c3JjL21iX2VuaGFuY2VkX2NvdmVyX2FydF91cGxvYWRzL3Byb3ZpZGVycy9hbWF6b24udHM=) | `100.00% <ø> (ø)` | |
| [...b\_enhanced\_cover\_art\_uploads/providers/bandcamp.ts](https://codecov.io/gh/ROpdebee/mb-userscripts/pull/304/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Ruben+Opdebeeck#diff-c3JjL21iX2VuaGFuY2VkX2NvdmVyX2FydF91cGxvYWRzL3Byb3ZpZGVycy9iYW5kY2FtcC50cw==) | `100.00% <ø> (ø)` | |
| [...rc/mb\_enhanced\_cover\_art\_uploads/providers/base.ts](https://codecov.io/gh/ROpdebee/mb-userscripts/pull/304/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Ruben+Opdebeeck#diff-c3JjL21iX2VuaGFuY2VkX2NvdmVyX2FydF91cGxvYWRzL3Byb3ZpZGVycy9iYXNlLnRz) | `100.00% <ø> (ø)` | |
| [...b\_enhanced\_cover\_art\_uploads/providers/beatport.ts](https://codecov.io/gh/ROpdebee/mb-userscripts/pull/304/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Ruben+Opdebeeck#diff-c3JjL21iX2VuaGFuY2VkX2NvdmVyX2FydF91cGxvYWRzL3Byb3ZpZGVycy9iZWF0cG9ydC50cw==) | `100.00% <ø> (ø)` | |
| [...nhanced\_cover\_art\_uploads/providers/musicbrainz.ts](https://codecov.io/gh/ROpdebee/mb-userscripts/pull/304/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Ruben+Opdebeeck#diff-c3JjL21iX2VuaGFuY2VkX2NvdmVyX2FydF91cGxvYWRzL3Byb3ZpZGVycy9tdXNpY2JyYWluei50cw==) | `100.00% <ø> (ø)` | |
| [...c/mb\_enhanced\_cover\_art\_uploads/providers/qobuz.ts](https://codecov.io/gh/ROpdebee/mb-userscripts/pull/304/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Ruben+Opdebeeck#diff-c3JjL21iX2VuaGFuY2VkX2NvdmVyX2FydF91cGxvYWRzL3Byb3ZpZGVycy9xb2J1ei50cw==) | `100.00% <ø> (ø)` | |
| [...anced\_cover\_art\_uploads/providers/rateyourmusic.ts](https://codecov.io/gh/ROpdebee/mb-userscripts/pull/304/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Ruben+Opdebeeck#diff-c3JjL21iX2VuaGFuY2VkX2NvdmVyX2FydF91cGxvYWRzL3Byb3ZpZGVycy9yYXRleW91cm11c2ljLnRz) | `100.00% <ø> (ø)` | |
| [...enhanced\_cover\_art\_uploads/providers/soundcloud.ts](https://codecov.io/gh/ROpdebee/mb-userscripts/pull/304/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Ruben+Opdebeeck#diff-c3JjL21iX2VuaGFuY2VkX2NvdmVyX2FydF91cGxvYWRzL3Byb3ZpZGVycy9zb3VuZGNsb3VkLnRz) | `100.00% <ø> (ø)` | |
| ... and [2 more](https://codecov.io/gh/ROpdebee/mb-userscripts/pull/304/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Ruben+Opdebeeck) | |

------

[Continue to review full report at Codecov](https://codecov.io/gh/ROpdebee/mb-userscripts/pull/304?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Ruben+Opdebeeck).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Ruben+Opdebeeck)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/ROpdebee/mb-userscripts/pull/304?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Ruben+Opdebeeck). Last update [3f9e89d...6b7cc40](https://codecov.io/gh/ROpdebee/mb-userscripts/pull/304?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Ruben+Opdebeeck). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Ruben+Opdebeeck).


Patch:
diff --git a/src/lib/MB/CoverArt.ts b/src/lib/MB/CoverArt.ts
new file mode 100644
index 00000000..356cdf86
--- /dev/null
+++ b/src/lib/MB/CoverArt.ts
@@ -0,0 +1,16 @@
+export enum ArtworkTypeIDs {
+    Back = 2,
+    Booklet = 3,
+    Front = 1,
+    Liner = 12,
+    Medium = 4,
+    Obi = 5,
+    Other = 8,
+    Poster = 11,
+    Raw = 14,  // Raw/Unedited
+    Spine = 6,
+    Sticker = 10,
+    Track = 7,
+    Tray = 9,
+    Watermark = 13
+}
diff --git a/src/mb_enhanced_cover_art_uploads/fetch.ts b/src/mb_enhanced_cover_art_uploads/fetch.ts
index ae852330..a346273b 100644
--- a/src/mb_enhanced_cover_art_uploads/fetch.ts
+++ b/src/mb_enhanced_cover_art_uploads/fetch.ts
@@ -1,11 +1,11 @@
 import { LOGGER } from '@lib/logging/logger';
+import { ArtworkTypeIDs } from '@lib/MB/CoverArt';
 import { gmxhr } from '@lib/util/xhr';
+import { urlBasename } from '@lib/util/urls';
+import { getFromPageContext } from '@src/compat';
 import { getMaximisedCandidates } from './maximise';
 import { getProvider } from './providers';
-import { ArtworkTypeIDs } from './providers/base';
 import type { CoverArt, CoverArtProvider } from './providers/base';
-import { getFromPageContext } from '@src/compat';
-import { urlBasename } from '@lib/util/urls';
 
 interface ImageContents {
     requestedUrl: URL;
diff --git a/src/mb_enhanced_cover_art_uploads/form.ts b/src/mb_enhanced_cover_art_uploads/form.ts
index cd81eac0..800d52cc 100644
--- a/src/mb_enhanced_cover_art_uploads/form.ts
+++ b/src/mb_enhanced_cover_art_uploads/form.ts
@@ -1,10 +1,12 @@
+import type { ArtworkTypeIDs } from '@lib/MB/CoverArt';
+import type { EditNote } from '@lib/MB/EditNote';
 import { assertDefined } from '@lib/util/assert';
 import { retryTimes } from '@lib/util/async';
-import { cloneIntoPageContext, getFromPageContext } from '@src/compat';
 import { qs, qsa } from '@lib/util/dom';
-import type { EditNote } from '@lib/MB/EditNote';
+
+import { cloneIntoPageContext, getFromPageContext } from '@src/compat';
+
 import type { FetchedImage, FetchedImages } from './fetch';
-import type { ArtworkTypeIDs } from './providers/base';
 
 export async function enqueueImages({ images }: FetchedImages, defaultTypes: ArtworkTypeIDs[] = [], defaultComment = ''): Promise<void> {
     await Promise.all(images.map((image) => {
diff --git a/src/mb_enhanced_cover_art_uploads/providers/amazon.ts b/src/mb_enhanced_cover_art_uploads/providers/amazon.ts
index 599cb071..272a575c 100644
--- a/src/mb_enhanced_cover_art_uploads/providers/amazon.ts
+++ b/src/mb_enhanced_cover_art_uploads/providers/amazon.ts
@@ -1,10 +1,11 @@
 import { LOGGER } from '@lib/logging/logger';
+import { ArtworkTypeIDs } from '@lib/MB/CoverArt';
 import { parseDOM, qsa, qsMaybe } from '@lib/util/dom';
 import { safeParseJSON } from '@lib/util/json';
 import { GMgetResourceUrl } from '@src/compat';
 
 import type { CoverArt } from './base';
-import { ArtworkTypeIDs, CoverArtProvider } from './base';
+import { CoverArtProvider } from './base';
 
 const PLACEHOLDER_IMG_REGEX = /01RmK(?:\+|%2B)J4pJL/;
 
diff --git a/src/mb_enhanced_cover_art_uploads/providers/bandcamp.ts b/src/mb_enhanced_cover_art_uploads/providers/bandcamp.ts
index 3de396f9..64cc837c 100644
--- a/src/mb_enhanced_cover_art_uploads/providers/bandcamp.ts
+++ b/src/mb_enhanced_cover_art_uploads/providers/bandcamp.ts
@@ -1,11 +1,12 @@
 import pThrottle from 'p-throttle';
 
 import { LOGGER } from '@lib/logging/logger';
+import { ArtworkTypeIDs } from '@lib/MB/CoverArt';
 import { filterNonNull } from '@lib/util/array';
 import { parseDOM, qs, qsa, qsMaybe } from '@lib/util/dom';
 
 import type { CoverArt, ParsedTrackImage } from './base';
-import { ArtworkTypeIDs, ProviderWithTrackImages } from './base';
+import { ProviderWithTrackImages } from './base';
 import { getImageDimensions } from '../image_dimensions';
 
 export class BandcampProvider extends ProviderWithTrackImages {
diff --git a/src/mb_enhanced_cover_art_uploads/providers/base.ts b/src/mb_enhanced_cover_art_uploads/providers/base.ts
index 28ed52c6..f52e26a5 100644
--- a/src/mb_enhanced_cover_art_uploads/providers/base.ts
+++ b/src/mb_enhanced_cover_art_uploads/providers/base.ts
@@ -1,4 +1,5 @@
 import { LOGGER } from '@lib/logging/logger';
+import { ArtworkTypeIDs } from '@lib/MB/CoverArt';
 import { filterNonNull, groupBy } from '@lib/util/array';
 import { blobToDigest } from '@lib/util/blob';
 import { parseDOM, qs } from '@lib/util/dom';
@@ -133,23 +134,6 @@ export interface ParsedTrackImage {
     trackNumber?: string;
 }
 
-export enum ArtworkTypeIDs {
-    Back = 2,
-    Booklet = 3,
-    Front = 1,
-    Liner = 12,
-    Medium = 4,
-    Obi = 5,
-    Other = 8,
-    Poster = 11,
-    Raw = 14,  // Raw/Unedited
-    Spine = 6,
-    Sticker = 10,
-    Track = 7,
-    Tray = 9,
-    Watermark = 13,
-}
-
 export abstract class HeadMetaPropertyProvider extends CoverArtProvider {
     // Providers for which the cover art can be retrieved from the head
     // og:image property and maximised using maxurl
diff --git a/src/mb_enhanced_cover_art_uploads/providers/beatport.ts b/src/mb_enhanced_cover_art_uploads/providers/beatport.ts
index 07bc8e4d..1f4b9146 100644
--- a/src/mb_enhanced_cover_art_uploads/providers/beatport.ts
+++ b/src/mb_enhanced_cover_art_uploads/providers/beatport.ts
@@ -1,7 +1,8 @@
+import { ArtworkTypeIDs } from '@lib/MB/CoverArt';
 import { parseDOM, qs } from '@lib/util/dom';
 
 import type { CoverArt } from './base';
-import { ArtworkTypeIDs, CoverArtProvider } from './base';
+import { CoverArtProvider } from './base';
 
 export class BeatportProvider extends CoverArtProvider {
     supportedDomains = ['beatport.com'];
diff --git a/src/mb_enhanced_cover_art_uploads/providers/musicbrainz.ts b/src/mb_enhanced_cover_art_uploads/providers/musicbrainz.ts
index 2d0887d5..4652fd56 100644
--- a/src/mb_enhanced_cover_art_uploads/providers/musicbrainz.ts
+++ b/src/mb_enhanced_cover_art_uploads/providers/musicbrainz.ts
@@ -3,7 +3,8 @@ import { safeParseJSON } from '@lib/util/json';
 import { urlBasename } from '@lib/util/urls';
 
 import type { CoverArt } from './base';
-import { ArtworkTypeIDs, CoverArtProvider } from './base';
+import { CoverArtProvider } from './base';
+import { ArtworkTypeIDs } from '@lib/MB/CoverArt';
 
 interface CAAIndex {
     images: Array<{
diff --git a/src/mb_enhanced_cover_art_uploads/providers/qobuz.ts b/src/mb_enhanced_cover_art_uploads/providers/qobuz.ts
index a8144a8d..25b17516 100644
--- a/src/mb_enhanced_cover_art_uploads/providers/qobuz.ts
+++ b/src/mb_enhanced_cover_art_uploads/providers/qobuz.ts
@@ -1,9 +1,10 @@
+import { ArtworkTypeIDs } from '@lib/MB/CoverArt';
 import { assert, assertHasValue } from '@lib/util/assert';
 import { safeParseJSON } from '@lib/util/json';
 import { gmxhr, HTTPResponseError } from '@lib/util/xhr';
 
 import type { CoverArt } from './base';
-import { ArtworkTypeIDs, CoverArtProvider } from './base';
+import { CoverArtProvider } from './base';
 
 interface Goodie {
     id: number;
diff --git a/src/mb_enhanced_cover_art_uploads/providers/rateyourmusic.ts b/src/mb_enhanced_cover_art_uploads/providers/rateyourmusic.ts
index 72996768..d858c3fe 100644
--- a/src/mb_enhanced_cover_art_uploads/providers/rateyourmusic.ts
+++ b/src/mb_enhanced_cover_art_uploads/providers/rateyourmusic.ts
@@ -1,8 +1,10 @@
+import { ArtworkTypeIDs } from '@lib/MB/CoverArt';
+import { assertHasValue } from '@lib/util/assert';
 import { parseDOM, qs, qsMaybe } from '@lib/util/dom';
 
 import type { CoverArt } from './base';
-import { ArtworkTypeIDs, CoverArtProvider } from './base';
-import { assertHasValue } from '@lib/util/assert';
+import { CoverArtProvider } from './base';
+
 
 export class RateYourMusicProvider extends CoverArtProvider {
     supportedDomains = ['rateyourmusic.com'];
diff --git a/src/mb_enhanced_cover_art_uploads/providers/soundcloud.ts b/src/mb_enhanced_cover_art_uploads/providers/soundcloud.ts
index 9f349278..1527d116 100644
--- a/src/mb_enhanced_cover_art_uploads/providers/soundcloud.ts
+++ b/src/mb_enhanced_cover_art_uploads/providers/soundcloud.ts
@@ -1,5 +1,6 @@
 import { filterNonNull } from '@lib/util/array';
-import { ArtworkTypeIDs, ProviderWithTrackImages } from './base';
+import { ProviderWithTrackImages } from './base';
+import { ArtworkTypeIDs } from '@lib/MB/CoverArt';
 import type { CoverArt } from './base';
 import { safeParseJSON } from '@lib/util/json';
 import { assert } from '@lib/util/assert';
diff --git a/src/mb_enhanced_cover_art_uploads/providers/tidal.ts b/src/mb_enhanced_cover_art_uploads/providers/tidal.ts
index 425e09c5..dcd55719 100644
--- a/src/mb_enhanced_cover_art_uploads/providers/tidal.ts
+++ b/src/mb_enhanced_cover_art_uploads/providers/tidal.ts
@@ -1,9 +1,10 @@
+import { ArtworkTypeIDs } from '@lib/MB/CoverArt';
 import { assert, assertHasValue } from '@lib/util/assert';
 import { safeParseJSON } from '@lib/util/json';
 import { gmxhr } from '@lib/util/xhr';
 
 import type { CoverArt } from './base';
-import { ArtworkTypeIDs, CoverArtProvider } from './base';
+import { CoverArtProvider } from './base';
 
 // Extracted from listen.tidal.com JS. There seem to be at least 10 different
 // API keys, I guess they might depend on the user type and/or country?
diff --git a/src/mb_enhanced_cover_art_uploads/providers/vgmdb.ts b/src/mb_enhanced_cover_art_uploads/providers/vgmdb.ts
index 130c2b17..349c3d60 100644
--- a/src/mb_enhanced_cover_art_uploads/providers/vgmdb.ts
+++ b/src/mb_enhanced_cover_art_uploads/providers/vgmdb.ts
@@ -1,4 +1,5 @@
 import { LOGGER } from '@lib/logging/logger';
+import { ArtworkTypeIDs } from '@lib/MB/CoverArt';
 import { assert, assertHasValue } from '@lib/util/assert';
 import { parseDOM, qs, qsa, qsMaybe } from '@lib/util/dom';
 import { safeParseJSON } from '@lib/util/json';
@@ -6,7 +7,7 @@ import { urlBasename } from '@lib/util/urls';
 import { gmxhr } from '@lib/util/xhr';
 
 import type { CoverArt } from './base';
-import { ArtworkTypeIDs, CoverArtProvider } from './base';
+import { CoverArtProvider } from './base';
 
 // Not full, only what we need
 interface AlbumMetadata {


Test patch:
diff --git a/tests/unit/mb_enhanced_cover_art_uploads/fetch.test.ts b/tests/unit/mb_enhanced_cover_art_uploads/fetch.test.ts
index 1ba10dc5..00ab84fd 100644
--- a/tests/unit/mb_enhanced_cover_art_uploads/fetch.test.ts
+++ b/tests/unit/mb_enhanced_cover_art_uploads/fetch.test.ts
@@ -2,7 +2,8 @@ import { gmxhr, NetworkError } from '@lib/util/xhr';
 import { ImageFetcher } from '@src/mb_enhanced_cover_art_uploads/fetch';
 import type { FetchedImage } from '@src/mb_enhanced_cover_art_uploads/fetch';
 import { getMaximisedCandidates } from '@src/mb_enhanced_cover_art_uploads/maximise';
-import { ArtworkTypeIDs, CoverArtProvider } from '@src/mb_enhanced_cover_art_uploads/providers/base';
+import { CoverArtProvider } from '@src/mb_enhanced_cover_art_uploads/providers/base';
+import { ArtworkTypeIDs } from '@lib/MB/CoverArt';
 import { getProvider } from '@src/mb_enhanced_cover_art_uploads/providers';
 import { createCoverArt, createImageFile, createXhrResponse } from './test-utils/dummy-data';
 
diff --git a/tests/unit/mb_enhanced_cover_art_uploads/form.test.ts b/tests/unit/mb_enhanced_cover_art_uploads/form.test.ts
index 60b65d6f..4bd6b056 100644
--- a/tests/unit/mb_enhanced_cover_art_uploads/form.test.ts
+++ b/tests/unit/mb_enhanced_cover_art_uploads/form.test.ts
@@ -2,8 +2,8 @@ import path from 'path';
 import fs from 'fs/promises';
 
 import $ from 'jquery';
+import { ArtworkTypeIDs } from '@lib/MB/CoverArt';
 import { enqueueImages, fillEditNote } from '@src/mb_enhanced_cover_art_uploads/form';
-import { ArtworkTypeIDs } from '@src/mb_enhanced_cover_art_uploads/providers/base';
 import { EditNote } from '@lib/MB/EditNote';
 import { createFetchedImage, createImageFile } from './test-utils/dummy-data';
 
diff --git a/tests/unit/mb_enhanced_cover_art_uploads/providers/7digital.test.ts b/tests/unit/mb_enhanced_cover_art_uploads/providers/7digital.test.ts
index fb0d162f..a15c3f16 100644
--- a/tests/unit/mb_enhanced_cover_art_uploads/providers/7digital.test.ts
+++ b/tests/unit/mb_enhanced_cover_art_uploads/providers/7digital.test.ts
@@ -1,4 +1,4 @@
-import { ArtworkTypeIDs } from '@src/mb_enhanced_cover_art_uploads/providers/base';
+import { ArtworkTypeIDs } from '@lib/MB/CoverArt';
 import { SevenDigitalProvider } from '@src/mb_enhanced_cover_art_uploads/providers/7digital';
 
 import { itBehavesLike } from '@test-utils/shared_behaviour';
diff --git a/tests/unit/mb_enhanced_cover_art_uploads/providers/amazon.test.ts b/tests/unit/mb_enhanced_cover_art_uploads/providers/amazon.test.ts
index 1d425b04..902d32fa 100644
--- a/tests/unit/mb_enhanced_cover_art_uploads/providers/amazon.test.ts
+++ b/tests/unit/mb_enhanced_cover_art_uploads/providers/amazon.test.ts
@@ -1,4 +1,4 @@
-import { ArtworkTypeIDs } from '@src/mb_enhanced_cover_art_uploads/providers/base';
+import { ArtworkTypeIDs } from '@lib/MB/CoverArt';
 import { AmazonProvider } from '@src/mb_enhanced_cover_art_uploads/providers/amazon';
 
 import { itBehavesLike } from '@test-utils/shared_behaviour';
diff --git a/tests/unit/mb_enhanced_cover_art_uploads/providers/amazon_music.test.ts b/tests/unit/mb_enhanced_cover_art_uploads/providers/amazon_music.test.ts
index 4f90568f..c3828c42 100644
--- a/tests/unit/mb_enhanced_cover_art_uploads/providers/amazon_music.test.ts
+++ b/tests/unit/mb_enhanced_cover_art_uploads/providers/amazon_music.test.ts
@@ -1,4 +1,4 @@
-import { ArtworkTypeIDs } from '@src/mb_enhanced_cover_art_uploads/providers/base';
+import { ArtworkTypeIDs } from '@lib/MB/CoverArt';
 import { AmazonMusicProvider } from '@src/mb_enhanced_cover_art_uploads/providers/amazon_music';
 
 import { itBehavesLike } from '@test-utils/shared_behaviour';
diff --git a/tests/unit/mb_enhanced_cover_art_uploads/providers/apple_music.test.ts b/tests/unit/mb_enhanced_cover_art_uploads/providers/apple_music.test.ts
index 24b825d7..3e32b0ba 100644
--- a/tests/unit/mb_enhanced_cover_art_uploads/providers/apple_music.test.ts
+++ b/tests/unit/mb_enhanced_cover_art_uploads/providers/apple_music.test.ts
@@ -1,5 +1,5 @@
+import { ArtworkTypeIDs } from '@lib/MB/CoverArt';
 import { AppleMusicProvider } from '@src/mb_enhanced_cover_art_uploads/providers/apple_music';
-import { ArtworkTypeIDs } from '@src/mb_enhanced_cover_art_uploads/providers/base';
 
 import { itBehavesLike } from '@test-utils/shared_behaviour';
 
diff --git a/tests/unit/mb_enhanced_cover_art_uploads/providers/bandcamp.test.ts b/tests/unit/mb_enhanced_cover_art_uploads/providers/bandcamp.test.ts
index c98d5fcf..7bd97b89 100644
--- a/tests/unit/mb_enhanced_cover_art_uploads/providers/bandcamp.test.ts
+++ b/tests/unit/mb_enhanced_cover_art_uploads/providers/bandcamp.test.ts
@@ -1,4 +1,4 @@
-import { ArtworkTypeIDs } from '@src/mb_enhanced_cover_art_uploads/providers/base';
+import { ArtworkTypeIDs } from '@lib/MB/CoverArt';
 import { BandcampProvider } from '@src/mb_enhanced_cover_art_uploads/providers/bandcamp';
 import { getImageDimensions } from '@src/mb_enhanced_cover_art_uploads/image_dimensions';
 
diff --git a/tests/unit/mb_enhanced_cover_art_uploads/providers/base.test.ts b/tests/unit/mb_enhanced_cover_art_uploads/providers/base.test.ts
index 8de85f16..e4d0ab26 100644
--- a/tests/unit/mb_enhanced_cover_art_uploads/providers/base.test.ts
+++ b/tests/unit/mb_enhanced_cover_art_uploads/providers/base.test.ts
@@ -3,7 +3,8 @@ import { when } from 'jest-when';
 import { gmxhr } from '@lib/util/xhr';
 
 import type { CoverArt, ParsedTrackImage } from '@src/mb_enhanced_cover_art_uploads/providers/base';
-import { ArtworkTypeIDs, CoverArtProvider, HeadMetaPropertyProvider, ProviderWithTrackImages } from '@src/mb_enhanced_cover_art_uploads/providers/base';
+import { CoverArtProvider, HeadMetaPropertyProvider, ProviderWithTrackImages } from '@src/mb_enhanced_cover_art_uploads/providers/base';
+import { ArtworkTypeIDs } from '@lib/MB/CoverArt';
 
 import { createBlob, createFetchedImage, createXhrResponse } from '../test-utils/dummy-data';
 import { registerMatchers } from '../test-utils/matchers';
diff --git a/tests/unit/mb_enhanced_cover_art_uploads/providers/beatport.test.ts b/tests/unit/mb_enhanced_cover_art_uploads/providers/beatport.test.ts
index 0e303133..46125870 100644
--- a/tests/unit/mb_enhanced_cover_art_uploads/providers/beatport.test.ts
+++ b/tests/unit/mb_enhanced_cover_art_uploads/providers/beatport.test.ts
@@ -1,4 +1,4 @@
-import { ArtworkTypeIDs } from '@src/mb_enhanced_cover_art_uploads/providers/base';
+import { ArtworkTypeIDs } from '@lib/MB/CoverArt';
 import { BeatportProvider } from '@src/mb_enhanced_cover_art_uploads/providers/beatport';
 
 import { itBehavesLike } from '@test-utils/shared_behaviour';
diff --git a/tests/unit/mb_enhanced_cover_art_uploads/providers/deezer.test.ts b/tests/unit/mb_enhanced_cover_art_uploads/providers/deezer.test.ts
index 1a0ae6f0..9b7add92 100644
--- a/tests/unit/mb_enhanced_cover_art_uploads/providers/deezer.test.ts
+++ b/tests/unit/mb_enhanced_cover_art_uploads/providers/deezer.test.ts
@@ -1,4 +1,4 @@
-import { ArtworkTypeIDs } from '@src/mb_enhanced_cover_art_uploads/providers/base';
+import { ArtworkTypeIDs } from '@lib/MB/CoverArt';
 import { DeezerProvider } from '@src/mb_enhanced_cover_art_uploads/providers/deezer';
 
 import { itBehavesLike } from '@test-utils/shared_behaviour';
diff --git a/tests/unit/mb_enhanced_cover_art_uploads/providers/melon.test.ts b/tests/unit/mb_enhanced_cover_art_uploads/providers/melon.test.ts
index 39601939..0c7524be 100644
--- a/tests/unit/mb_enhanced_cover_art_uploads/providers/melon.test.ts
+++ b/tests/unit/mb_enhanced_cover_art_uploads/providers/melon.test.ts
@@ -1,4 +1,4 @@
-import { ArtworkTypeIDs } from '@src/mb_enhanced_cover_art_uploads/providers/base';
+import { ArtworkTypeIDs } from '@lib/MB/CoverArt';
 import { MelonProvider } from '@src/mb_enhanced_cover_art_uploads/providers/melon';
 
 import { itBehavesLike } from '@test-utils/shared_behaviour';
diff --git a/tests/unit/mb_enhanced_cover_art_uploads/providers/musicbrainz.test.ts b/tests/unit/mb_enhanced_cover_art_uploads/providers/musicbrainz.test.ts
index 03fc6cee..ccb8fd76 100644
--- a/tests/unit/mb_enhanced_cover_art_uploads/providers/musicbrainz.test.ts
+++ b/tests/unit/mb_enhanced_cover_art_uploads/providers/musicbrainz.test.ts
@@ -1,6 +1,6 @@
 import HttpAdapter from '@pollyjs/adapter-node-http';
 
-import { ArtworkTypeIDs } from '@src/mb_enhanced_cover_art_uploads/providers/base';
+import { ArtworkTypeIDs } from '@lib/MB/CoverArt';
 import { MusicBrainzProvider } from '@src/mb_enhanced_cover_art_uploads/providers/musicbrainz';
 
 import { mockFetch, setupPolly } from '@test-utils/pollyjs';
diff --git a/tests/unit/mb_enhanced_cover_art_uploads/providers/qobuz.test.ts b/tests/unit/mb_enhanced_cover_art_uploads/providers/qobuz.test.ts
index ac01a9fa..58d2e096 100644
--- a/tests/unit/mb_enhanced_cover_art_uploads/providers/qobuz.test.ts
+++ b/tests/unit/mb_enhanced_cover_art_uploads/providers/qobuz.test.ts
@@ -1,4 +1,4 @@
-import { ArtworkTypeIDs } from '@src/mb_enhanced_cover_art_uploads/providers/base';
+import { ArtworkTypeIDs } from '@lib/MB/CoverArt';
 import { QobuzProvider } from '@src/mb_enhanced_cover_art_uploads/providers/qobuz';
 
 import { setupPolly } from '@test-utils/pollyjs';
diff --git a/tests/unit/mb_enhanced_cover_art_uploads/providers/qub_musique.test.ts b/tests/unit/mb_enhanced_cover_art_uploads/providers/qub_musique.test.ts
index d221ec97..ab2522de 100644
--- a/tests/unit/mb_enhanced_cover_art_uploads/providers/qub_musique.test.ts
+++ b/tests/unit/mb_enhanced_cover_art_uploads/providers/qub_musique.test.ts
@@ -1,4 +1,4 @@
-import { ArtworkTypeIDs } from '@src/mb_enhanced_cover_art_uploads/providers/base';
+import { ArtworkTypeIDs } from '@lib/MB/CoverArt';
 import { QubMusiqueProvider } from '@src/mb_enhanced_cover_art_uploads/providers/qub_musique';
 
 import { itBehavesLike } from '@test-utils/shared_behaviour';
diff --git a/tests/unit/mb_enhanced_cover_art_uploads/providers/rateyourmusic.test.ts b/tests/unit/mb_enhanced_cover_art_uploads/providers/rateyourmusic.test.ts
index 4e86af05..125d91e3 100644
--- a/tests/unit/mb_enhanced_cover_art_uploads/providers/rateyourmusic.test.ts
+++ b/tests/unit/mb_enhanced_cover_art_uploads/providers/rateyourmusic.test.ts
@@ -1,5 +1,5 @@
+import { ArtworkTypeIDs } from '@lib/MB/CoverArt';
 import type { CoverArtProvider } from '@src/mb_enhanced_cover_art_uploads/providers/base';
-import { ArtworkTypeIDs } from '@src/mb_enhanced_cover_art_uploads/providers/base';
 import { RateYourMusicProvider } from '@src/mb_enhanced_cover_art_uploads/providers/rateyourmusic';
 
 import { setupPolly } from '@test-utils/pollyjs';
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 784e9a10..2ebf12bf 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,4 +1,4 @@
-import { ArtworkTypeIDs } from '@src/mb_enhanced_cover_art_uploads/providers/base';
+import { ArtworkTypeIDs } from '@lib/MB/CoverArt';
 import { SoundcloudProvider } from '@src/mb_enhanced_cover_art_uploads/providers/soundcloud';
 
 import { itBehavesLike } from '@test-utils/shared_behaviour';
diff --git a/tests/unit/mb_enhanced_cover_art_uploads/providers/spotify.test.ts b/tests/unit/mb_enhanced_cover_art_uploads/providers/spotify.test.ts
index 5020856b..b5803984 100644
--- a/tests/unit/mb_enhanced_cover_art_uploads/providers/spotify.test.ts
+++ b/tests/unit/mb_enhanced_cover_art_uploads/providers/spotify.test.ts
@@ -1,4 +1,4 @@
-import { ArtworkTypeIDs } from '@src/mb_enhanced_cover_art_uploads/providers/base';
+import { ArtworkTypeIDs } from '@lib/MB/CoverArt';
 import { SpotifyProvider } from '@src/mb_enhanced_cover_art_uploads/providers/spotify';
 
 import { itBehavesLike } from '@test-utils/shared_behaviour';
diff --git a/tests/unit/mb_enhanced_cover_art_uploads/providers/tidal.test.ts b/tests/unit/mb_enhanced_cover_art_uploads/providers/tidal.test.ts
index 8c0a7adb..4a0e0206 100644
--- a/tests/unit/mb_enhanced_cover_art_uploads/providers/tidal.test.ts
+++ b/tests/unit/mb_enhanced_cover_art_uploads/providers/tidal.test.ts
@@ -1,4 +1,4 @@
-import { ArtworkTypeIDs } from '@src/mb_enhanced_cover_art_uploads/providers/base';
+import { ArtworkTypeIDs } from '@lib/MB/CoverArt';
 import { TidalProvider } from '@src/mb_enhanced_cover_art_uploads/providers/tidal';
 
 import { itBehavesLike } from '@test-utils/shared_behaviour';
diff --git a/tests/unit/mb_enhanced_cover_art_uploads/providers/vgmdb.test.ts b/tests/unit/mb_enhanced_cover_art_uploads/providers/vgmdb.test.ts
index c8b13bd3..4bb5d21b 100644
--- a/tests/unit/mb_enhanced_cover_art_uploads/providers/vgmdb.test.ts
+++ b/tests/unit/mb_enhanced_cover_art_uploads/providers/vgmdb.test.ts
@@ -1,4 +1,4 @@
-import { ArtworkTypeIDs } from '@src/mb_enhanced_cover_art_uploads/providers/base';
+import { ArtworkTypeIDs } from '@lib/MB/CoverArt';
 import { convertCaptions, mapJacketType, VGMdbProvider } from '@src/mb_enhanced_cover_art_uploads/providers/vgmdb';
 
 import { setupPolly } from '@test-utils/pollyjs';
diff --git a/tests/unit/mb_enhanced_cover_art_uploads/seeding/parameters.test.ts b/tests/unit/mb_enhanced_cover_art_uploads/seeding/parameters.test.ts
index c812c440..f08bd9d2 100644
--- a/tests/unit/mb_enhanced_cover_art_uploads/seeding/parameters.test.ts
+++ b/tests/unit/mb_enhanced_cover_art_uploads/seeding/parameters.test.ts
@@ -1,4 +1,4 @@
-import { ArtworkTypeIDs } from '@src/mb_enhanced_cover_art_uploads/providers/base';
+import { ArtworkTypeIDs } from '@lib/MB/CoverArt';
 import { SeedParameters } from '@src/mb_enhanced_cover_art_uploads/seeding/parameters';
 
 describe('seed parameters', () => {
diff --git a/tests/unit/mb_enhanced_cover_art_uploads/test-utils/matchers.ts b/tests/unit/mb_enhanced_cover_art_uploads/test-utils/matchers.ts
index 1c209cd1..122cede2 100644
--- a/tests/unit/mb_enhanced_cover_art_uploads/test-utils/matchers.ts
+++ b/tests/unit/mb_enhanced_cover_art_uploads/test-utils/matchers.ts
@@ -1,7 +1,7 @@
 // Custom matchers for provider testing
 
 import type { CoverArt } from '@src/mb_enhanced_cover_art_uploads/providers/base';
-import { ArtworkTypeIDs } from '@src/mb_enhanced_cover_art_uploads/providers/base';
+import { ArtworkTypeIDs } from '@lib/MB/CoverArt';
 
 export interface ExpectedCoverArt {
     urlPart: string | RegExp;