mirror of
https://github.com/BinaryAlley/Nemera.git
synced 2026-12-03 00:11:10 +00:00
Reorganizes the shared media library enumerations and adds the image file extension helper
This commit is contained in:
1 parent
ed96046769
commit
5529e99024
11 files changed
+286
-50
No files matched your search
@@ -1,22 +0,0 @@
|
||||
namespace Lumina.Domain.SharedKernel.Common.Enums.BookLibrary;
|
||||
|
||||
/// <summary>
|
||||
/// Enumeration for the status of the artwork enrichment of a book artwork.
|
||||
/// </summary>
|
||||
public enum ArtworkStatus
|
||||
{
|
||||
/// <summary>
|
||||
/// The artwork of the book has not been resolved yet.
|
||||
/// </summary>
|
||||
Pending,
|
||||
|
||||
/// <summary>
|
||||
/// The artwork of the book has been successfully resolved.
|
||||
/// </summary>
|
||||
Enriched,
|
||||
|
||||
/// <summary>
|
||||
/// The artwork resolution of the book failed.
|
||||
/// </summary>
|
||||
Failed
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
namespace Lumina.Domain.SharedKernel.Common.Enums.BookLibrary;
|
||||
|
||||
/// <summary>
|
||||
/// Enumeration for the status of the metadata enrichment of a book.
|
||||
/// </summary>
|
||||
public enum MetadataStatus
|
||||
{
|
||||
/// <summary>
|
||||
/// The metadata of the book has not been enriched yet.
|
||||
/// </summary>
|
||||
Pending,
|
||||
|
||||
/// <summary>
|
||||
/// The metadata of the book has been successfully enriched.
|
||||
/// </summary>
|
||||
Enriched,
|
||||
|
||||
/// <summary>
|
||||
/// The metadata enrichment of the book failed.
|
||||
/// </summary>
|
||||
Failed
|
||||
}
|
||||
@@ -5,7 +5,7 @@ using System.Diagnostics;
|
||||
namespace Lumina.Domain.SharedKernel.Common.Enums.Common;
|
||||
|
||||
/// <summary>
|
||||
/// Enumeration for the country of a media release, using the ISO 3166-1 alpha-2 country codes.
|
||||
/// Enumeration for the country of a media release, using the ISO 3166-1 alpha-2 country codes, together with the MusicBrainz special codes for releases issued across Europe or worldwide.
|
||||
/// </summary>
|
||||
[DebuggerDisplay("{ToString()}")]
|
||||
public enum ReleaseCountry
|
||||
@@ -988,5 +988,20 @@ public enum ReleaseCountry
|
||||
/// <summary>
|
||||
/// The ISO 3166-1 alpha-2 code of Zimbabwe.
|
||||
/// </summary>
|
||||
ZW
|
||||
ZW,
|
||||
|
||||
/// <summary>
|
||||
/// The ISO 3166-1 alpha-2 code of the Netherlands Antilles, withdrawn in 2010.
|
||||
/// </summary>
|
||||
AN,
|
||||
|
||||
/// <summary>
|
||||
/// The MusicBrainz code for a release issued across Europe.
|
||||
/// </summary>
|
||||
XE,
|
||||
|
||||
/// <summary>
|
||||
/// The MusicBrainz code for a release issued worldwide.
|
||||
/// </summary>
|
||||
XW
|
||||
}
|
||||
+6
-1
@@ -176,5 +176,10 @@ public enum MediaContributorRole
|
||||
/// <summary>
|
||||
/// The contributor orchestrated the music of the media item.
|
||||
/// </summary>
|
||||
Orchestrator
|
||||
Orchestrator,
|
||||
|
||||
/// <summary>
|
||||
/// The contributor performed the media item, without a more specific role being known.
|
||||
/// </summary>
|
||||
Performer
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using System.Diagnostics;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Domain.SharedKernel.Common.Enums.MediaLibrary;
|
||||
|
||||
/// <summary>
|
||||
/// Enumeration for the status of the artwork enrichment of a media library item.
|
||||
/// </summary>
|
||||
[DebuggerDisplay("{ToString()}")]
|
||||
public enum ArtworkStatus
|
||||
{
|
||||
/// <summary>
|
||||
/// The artwork of the media library item has not been resolved yet.
|
||||
/// </summary>
|
||||
Pending,
|
||||
|
||||
/// <summary>
|
||||
/// The artwork of the media library item has been successfully resolved.
|
||||
/// </summary>
|
||||
Enriched,
|
||||
|
||||
/// <summary>
|
||||
/// The artwork of the media library item was searched for, and no artwork exists for it.
|
||||
/// </summary>
|
||||
NotAvailable,
|
||||
|
||||
/// <summary>
|
||||
/// The artwork resolution of the media library item failed, because an error prevented the artwork from being retrieved.
|
||||
/// </summary>
|
||||
Failed
|
||||
}
|
||||
@@ -16,5 +16,85 @@ public enum ArtworkType
|
||||
/// <summary>
|
||||
/// The main artwork of the media library item, like the cover of a book.
|
||||
/// </summary>
|
||||
Cover
|
||||
Cover,
|
||||
|
||||
/// <summary>
|
||||
/// The front of the artwork of the media library item, when it is stored separately from the cover.
|
||||
/// </summary>
|
||||
Front,
|
||||
|
||||
/// <summary>
|
||||
/// The back of the artwork of the media library item.
|
||||
/// </summary>
|
||||
Back,
|
||||
|
||||
/// <summary>
|
||||
/// A page of the booklet of the media library item.
|
||||
/// </summary>
|
||||
Booklet,
|
||||
|
||||
/// <summary>
|
||||
/// The artwork printed on the medium of the media library item, like a disc label.
|
||||
/// </summary>
|
||||
Medium,
|
||||
|
||||
/// <summary>
|
||||
/// The artwork printed on the tray of the media library item.
|
||||
/// </summary>
|
||||
Tray,
|
||||
|
||||
/// <summary>
|
||||
/// The artwork printed on the spine of the media library item.
|
||||
/// </summary>
|
||||
Spine,
|
||||
|
||||
/// <summary>
|
||||
/// The obi strip of the media library item.
|
||||
/// </summary>
|
||||
Obi,
|
||||
|
||||
/// <summary>
|
||||
/// The sticker of the media library item.
|
||||
/// </summary>
|
||||
Sticker,
|
||||
|
||||
/// <summary>
|
||||
/// The poster of the media library item.
|
||||
/// </summary>
|
||||
Poster,
|
||||
|
||||
/// <summary>
|
||||
/// The liner notes of the media library item.
|
||||
/// </summary>
|
||||
Liner,
|
||||
|
||||
/// <summary>
|
||||
/// A watermark carried by the artwork of the media library item.
|
||||
/// </summary>
|
||||
Watermark,
|
||||
|
||||
/// <summary>
|
||||
/// The backdrop, or fanart, of the media library item.
|
||||
/// </summary>
|
||||
Backdrop,
|
||||
|
||||
/// <summary>
|
||||
/// The banner of the media library item.
|
||||
/// </summary>
|
||||
Banner,
|
||||
|
||||
/// <summary>
|
||||
/// The logo of the media library item.
|
||||
/// </summary>
|
||||
Logo,
|
||||
|
||||
/// <summary>
|
||||
/// The thumbnail of the media library item.
|
||||
/// </summary>
|
||||
Thumb,
|
||||
|
||||
/// <summary>
|
||||
/// Any other artwork of the media library item.
|
||||
/// </summary>
|
||||
Other
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using System.Diagnostics;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Domain.SharedKernel.Common.Enums.MediaLibrary;
|
||||
|
||||
/// <summary>
|
||||
/// Enumeration for the status of the metadata enrichment of a media library item.
|
||||
/// </summary>
|
||||
[DebuggerDisplay("{ToString()}")]
|
||||
public enum MetadataStatus
|
||||
{
|
||||
/// <summary>
|
||||
/// The metadata of the media library item has not been enriched yet.
|
||||
/// </summary>
|
||||
Pending,
|
||||
|
||||
/// <summary>
|
||||
/// The metadata of the media library item has been successfully enriched.
|
||||
/// </summary>
|
||||
Enriched,
|
||||
|
||||
/// <summary>
|
||||
/// The metadata enrichment of the media library item failed.
|
||||
/// </summary>
|
||||
Failed
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using Lumina.Domain.SharedKernel.Common.Enums.PhotoLibrary;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Infrastructure.Common.Utilities;
|
||||
|
||||
/// <summary>
|
||||
/// Provides helpers for the <see cref="ImageType"/> enumeration.
|
||||
/// </summary>
|
||||
public static class ImageTypeUtilities
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the conventional file extension of the provided <paramref name="imageType"/>, without the leading dot.
|
||||
/// </summary>
|
||||
/// <param name="imageType">The image type whose file extension is resolved.</param>
|
||||
/// <returns>The file extension of the image type, or <c>bin</c> when the type is not a recognized image.</returns>
|
||||
public static string ToFileExtension(this ImageType imageType)
|
||||
{
|
||||
return imageType switch
|
||||
{
|
||||
ImageType.BMP => "bmp",
|
||||
ImageType.GIF => "gif",
|
||||
ImageType.PNG => "png",
|
||||
ImageType.TIFF => "tiff",
|
||||
ImageType.JPEG or ImageType.JPEG_CANON or ImageType.JPEG_UNKNOWN => "jpg",
|
||||
ImageType.PICT => "pct",
|
||||
ImageType.ICO => "ico",
|
||||
ImageType.PSD => "psd",
|
||||
ImageType.JPEG2000 => "jp2",
|
||||
ImageType.AVIF => "avif",
|
||||
ImageType.WEBP => "webp",
|
||||
ImageType.TGA => "tga",
|
||||
ImageType.SVG => "svg",
|
||||
_ => "bin"
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user