Skip to content

Commit

Permalink
Merge pull request #54 from Zastai/add-new-types
Browse files Browse the repository at this point in the history
Add new cover art types
  • Loading branch information
Zastai authored Dec 22, 2023
2 parents 6c6c514 + 075f0d9 commit eef8c1f
Show file tree
Hide file tree
Showing 5 changed files with 84 additions and 13 deletions.
4 changes: 3 additions & 1 deletion MetaBrainz.MusicBrainz.CoverArt.sln.DotSettings
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,6 @@
<s:Boolean x:Key="/Default/UserDictionary/Words/=Brainz/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=coverartarchive/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=libcoverart/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=MBID/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>
<s:Boolean x:Key="/Default/UserDictionary/Words/=MBID/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Runout/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=uncropped/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>
78 changes: 66 additions & 12 deletions MetaBrainz.MusicBrainz.CoverArt/CoverArtType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,45 +12,99 @@ public enum CoverArtType : long {
/// <summary>No cover art type has been set.</summary>
None = 0,

/// <summary>The album cover, this is the front of the packaging of an audio recording (or in the case of a digital release the image associated with it in a digital media store).</summary>
/// <summary>
/// The album cover, this is the front of the packaging of an audio recording (or in the case of a digital release the image
/// associated with it in a digital media store).
/// </summary>
Front = 1L,

/// <summary>The back of the package of an audio recording, this will often contain the track listing, barcode and copyright information.</summary>
/// <summary>
/// The back of the package of an audio recording, this will often contain the track listing, barcode and copyright information.
/// </summary>
Back = 1L << 1,

/// <summary>A small book or group of pages inserted into the compact disc or DVD jewel case or the equivalent packaging for vinyl records and cassettes. Digital releases sometimes include a booklet in a digital file (usually PDF). Booklets often contain liner notes, song lyrics and/or photographs of the artist or band.</summary>
/// <summary>
/// A small book or group of pages inserted into the compact disc or DVD jewel case or the equivalent packaging for vinyl records
/// and cassettes. Digital releases sometimes include a booklet in a digital file (usually PDF). Booklets often contain liner
/// notes, song lyrics and/or photographs of the artist or band.
/// </summary>
Booklet = 1L << 2,

/// <summary>The medium contains the audio recording, for a compact disc release it is the compact disc itself, similarly for a vinyl release it is the vinyl disc itself, etc.</summary>
/// <summary>
/// The medium contains the audio recording, for a compact disc release it is the compact disc itself, similarly for a vinyl
/// release it is the vinyl disc itself, etc.
/// </summary>
Medium = 1L << 3,

/// <summary>The image behind or on the tray containing the medium. For jewel cases, this is usually printed on the other side of the piece of paper with the back image.</summary>
/// <summary>
/// The image behind or on the tray containing the medium. For jewel cases, this is usually printed on the other side of the piece
/// of paper with the back image.
/// </summary>
Tray = 1L << 4,

/// <summary>An obi is a strip of paper around the spine (or occasionally one of the other edges of the packaging).</summary>
Obi = 1L << 5,

/// <summary>A spine is the edge of the package of an audio recording, it is often the only part visible when recordings are stacked or stored in a shelf. For compact discs the spine is usually part of the back cover scan, and should not be uploaded separately.</summary>
/// <summary>
/// A spine is the edge of the package of an audio recording, it is often the only part visible when recordings are stacked or
/// stored in a shelf. For compact discs the spine is usually part of the back cover scan, and should not be uploaded separately.
/// </summary>
Spine = 1L << 6,

/// <summary>Digital releases sometimes have cover art associated with each individual track of a release (typically embedded in the .mp3 files), use this type for images associated with individual tracks.</summary>
/// <summary>
/// Digital releases sometimes have cover art associated with each individual track of a release (typically embedded in the .mp3
/// files), use this type for images associated with individual tracks.
/// </summary>
Track = 1L << 7,

/// <summary>A liner is a protective sleeve surrounding a medium (usually a vinyl record, but sometimes a CD), often printed with notes or images.</summary>
/// <summary>
/// A liner is a protective sleeve surrounding a medium (usually a vinyl record, but sometimes a CD), often printed with notes or
/// images.
/// </summary>
Liner = 1L << 8,

/// <summary>A sticker is an adhesive piece of paper, that is attached to the plastic film or enclosed inside the packaging.</summary>
/// <summary>
/// A sticker is an adhesive piece of paper, that is attached to the plastic film or enclosed inside the packaging.
/// </summary>
Sticker = 1L << 9,

/// <summary>A poster included with a release. May be the same size as the packaging or larger (in this case it would fold out). Such posters are often printed on the back of a fold-out booklet but are sometimes bundled separately.</summary>
/// <summary>
/// A poster included with a release. May be the same size as the packaging or larger (in this case it would fold out). Such
/// posters are often printed on the back of a fold-out booklet but are sometimes bundled separately.
/// </summary>
Poster = 1L << 10,

/// <summary>A watermark is a piece of text or an image which is not part of the cover art but is added by the person who scanned the cover art. Images without any watermarks are preferred where possible - this type is useful in cases where either the only available image is watermarked, or where a better quality watermarked image is uploaded alongside a poorer quality non-watermarked image.</summary>
/// <summary>
/// A watermark is a piece of text or an image which is not part of the cover art but is added by the person who scanned the cover
/// art. Images without any watermarks are preferred where possible - this type is useful in cases where either the only available
/// image is watermarked, or where a better quality watermarked image is uploaded alongside a poorer quality non-watermarked
/// image.
/// </summary>
Watermark = 1L << 11,

/// <summary>An image that is usable for reference, but needs more work to be usable for tagging (for example, an uncropped scan).</summary>
/// <summary>
/// An image that is usable for reference, but needs more work to be usable for tagging (for example, an uncropped scan).
/// </summary>
RawUnedited = 1L << 12,

/// <summary>
/// The section on a CD, record or other media containing such data as matrix numbers. Usually found in the hub of a CD or the
/// dead wax area of a vinyl record.
/// </summary>
MatrixRunout = 1L << 13,

/// <summary>
/// The top of a box or other similar packaging (for most common six sided packaging options, the one perpendicular to and above
/// front, back and spines).
/// </summary>
Top = 1L << 14,

/// <summary>
/// The bottom of a box or other similar packaging (for most common six sided packaging options, the one perpendicular to and
/// below front, back and spines).
/// </summary>
Bottom = 1L << 15,

/// <summary>An unknown image type name was returned. Please create a ticket so that proper support can be added.</summary>
Unknown = 1L << 62,

Expand Down
9 changes: 9 additions & 0 deletions MetaBrainz.MusicBrainz.CoverArt/Json/Readers/ImageReader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -108,12 +108,18 @@ private static void AddCoverArtType(string type, ref CoverArtType types, ref Lis
case "Booklet":
types |= CoverArtType.Booklet;
break;
case "Bottom":
types |= CoverArtType.Bottom;
break;
case "Front":
types |= CoverArtType.Front;
break;
case "Liner":
types |= CoverArtType.Liner;
break;
case "Matrix/Runout":
types |= CoverArtType.MatrixRunout;
break;
case "Medium":
types |= CoverArtType.Medium;
break;
Expand All @@ -126,6 +132,9 @@ private static void AddCoverArtType(string type, ref CoverArtType types, ref Lis
case "Poster":
types |= CoverArtType.Poster;
break;
case "Top":
types |= CoverArtType.Top;
break;
case "Track":
types |= CoverArtType.Track;
break;
Expand Down
3 changes: 3 additions & 0 deletions public-api/MetaBrainz.MusicBrainz.CoverArt.net6.0.cs.md
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,10 @@ public enum CoverArtType : long {

Back = 2L,
Booklet = 4L,
Bottom = 32768L,
Front = 1L,
Liner = 256L,
MatrixRunout = 8192L,
Medium = 8L,
None = 0L,
Obi = 32L,
Expand All @@ -196,6 +198,7 @@ public enum CoverArtType : long {
RawUnedited = 4096L,
Spine = 64L,
Sticker = 512L,
Top = 16384L,
Track = 128L,
Tray = 16L,
Unknown = 4611686018427387904L,
Expand Down
3 changes: 3 additions & 0 deletions public-api/MetaBrainz.MusicBrainz.CoverArt.net8.0.cs.md
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,10 @@ public enum CoverArtType : long {

Back = 2L,
Booklet = 4L,
Bottom = 32768L,
Front = 1L,
Liner = 256L,
MatrixRunout = 8192L,
Medium = 8L,
None = 0L,
Obi = 32L,
Expand All @@ -196,6 +198,7 @@ public enum CoverArtType : long {
RawUnedited = 4096L,
Spine = 64L,
Sticker = 512L,
Top = 16384L,
Track = 128L,
Tray = 16L,
Unknown = 4611686018427387904L,
Expand Down

0 comments on commit eef8c1f

Please sign in to comment.