diff --git a/MediaManager/Library/IMediaItem.cs b/MediaManager/Library/IMediaItem.cs
index 2785fcd2..3e8b1892 100644
--- a/MediaManager/Library/IMediaItem.cs
+++ b/MediaManager/Library/IMediaItem.cs
@@ -30,100 +30,90 @@ public interface IMediaItem : IContentItem
///
string Album { get; set; }
- ///
- /// The metadata key for a Bitmap typed value to retrieve the information about the artwork for the Album of the media's original source.
- ///
- object AlbumArt { get; set; }
-
///
/// The metadata for the artist for the Album of the media's original source.
///
string AlbumArtist { get; set; }
///
- /// The metadata key for a CharSequence or string typed value to retrieve the information about the Uri of the artwork for the Album of the media's original source.
+ /// The metadata for a Bitmap typed value to retrieve the information about the artwork for the Album of the media's original source.
///
- string AlbumArtUri { get; set; }
+ object AlbumImage { get; set; }
///
- /// The metadata key for a Bitmap typed value to retrieve the information about the artwork for the media.
+ /// The metadata for a CharSequence or string typed value to retrieve the information about the Uri of the artwork for the Album of the media's original source.
///
- object Art { get; set; }
+ string AlbumImageUri { get; set; }
///
- /// The metadata key for a CharSequence or string typed value to retrieve the information about the artist of the media.
+ /// The metadata for a CharSequence or string typed value to retrieve the information about the artist of the media.
///
string Artist { get; set; }
///
- /// The metadata key for a CharSequence or string typed value to retrieve the information about Uri of the artwork for the media.
+ /// The metadata for a Bitmap typed value to retrieve the information about the artwork for the media.
+ ///
+ object Image { get; set; }
+
+ ///
+ /// The metadata for a CharSequence or string typed value to retrieve the information about Uri of the artwork for the media.
///
- string ArtUri { get; set; }
+ string ImageUri { get; set; }
///
- /// The metadata key for a CharSequence or string typed value to retrieve the information about the author of the media.
+ /// The metadata for a CharSequence or string typed value to retrieve the information about the author of the media.
///
string Author { get; set; }
//TODO: Probably remove this one
///
- /// The metadata key for a int typed value to retrieve the information about the bluetooth folder type of the media specified in the section 6.10.2.2 of the Bluetooth AVRCP 1.5.
+ /// The metadata for a int typed value to retrieve the information about the bluetooth folder type of the media specified in the section 6.10.2.2 of the Bluetooth AVRCP 1.5.
///
BtFolderType BtFolderType { get; set; }
///
- /// The metadata key for a CharSequence or string typed value to retrieve the information about the compilation status of the media.
+ /// The metadata for a CharSequence or string typed value to retrieve the information about the compilation status of the media.
///
string Compilation { get; set; }
///
- /// The metadata key for a CharSequence or string typed value to retrieve the information about the composer of the media.
+ /// The metadata for a CharSequence or string typed value to retrieve the information about the composer of the media.
///
string Composer { get; set; }
//TODO: Make it a DateTime
///
- /// The metadata key for a CharSequence or string typed value to retrieve the information about the date the media was created or published.
+ /// The metadata for a CharSequence or string typed value to retrieve the information about the date the media was created or published.
///
string Date { get; set; }
///
- /// The metadata key for a int typed value to retrieve the information about the disc number for the media's original source.
+ /// The metadata for a int typed value to retrieve the information about the disc number for the media's original source.
///
int DiscNumber { get; set; }
///
- /// The metadata key for a CharSequence or string typed value to retrieve the information about the description that is suitable for display to the user.
+ /// The metadata for a CharSequence or string typed value to retrieve the information about the description that is suitable for display to the user.
///
string DisplayDescription { get; set; }
///
- /// The metadata key for a Bitmap typed value to retrieve the information about the icon or thumbnail that is suitable for display to the user.
- ///
- object DisplayIcon { get; set; }
-
- ///
- /// The metadata key for a CharSequence or string typed value to retrieve the information about the Uri of icon or thumbnail that is suitable for display to the user.
- ///
- string DisplayIconUri { get; set; }
-
- ///
- /// The metadata key for a CharSequence or string typed value to retrieve the information about the subtitle that is suitable for display to the user.
+ /// The metadata for a CharSequence or string typed value to retrieve the information about the subtitle that is suitable for display to the user.
///
string DisplaySubtitle { get; set; }
///
- /// The metadata key for a CharSequence or string typed value to retrieve the information about the title that is suitable for display to the user.
+ /// The metadata for a CharSequence or string typed value to retrieve the information about the title that is suitable for display to the user.
///
string DisplayTitle { get; set; }
///
- /// The metadata key for a int typed value to retrieve the information about the download status of the media which will be used for later offline playback.
+ /// The metadata for a int typed value to retrieve the information about the download status of the media which will be used for later offline playback.
///
DownloadStatus DownloadStatus { get; set; }
///
- /// The metadata key for a int typed value to retrieve the information about the duration of the media in ms.
+ /// The metadata for a int typed value to retrieve the information about the duration of the media in ms.
///
TimeSpan Duration { get; set; }
@@ -133,47 +123,47 @@ public interface IMediaItem : IContentItem
object Extras { get; set; }
///
- /// The metadata key for a CharSequence or string typed value to retrieve the information about the genre of the media.
+ /// The metadata for a CharSequence or string typed value to retrieve the information about the genre of the media.
///
string Genre { get; set; }
///
- /// The metadata key for a CharSequence or string typed value to retrieve the information about the Uri of the content.
+ /// The metadata for a CharSequence or string typed value to retrieve the information about the Uri of the content.
///
string MediaUri { get; set; }
///
- /// The metadata key for a int typed value to retrieve the information about the number of tracks in the media's original source.
+ /// The metadata for a int typed value to retrieve the information about the number of tracks in the media's original source.
///
int NumTracks { get; set; }
///
- /// The metadata key for a Rating2 typed value to retrieve the information about the overall rating for the media.
+ /// The metadata for a Rating2 typed value to retrieve the information about the overall rating for the media.
///
object Rating { get; set; }
///
- /// The metadata key for a CharSequence or string typed value to retrieve the information about the title of the media.
+ /// The metadata for a CharSequence or string typed value to retrieve the information about the title of the media.
///
string Title { get; set; }
///
- /// The metadata key for a int typed value to retrieve the information about the track number for the media.
+ /// The metadata for a int typed value to retrieve the information about the track number for the media.
///
int TrackNumber { get; set; }
///
- /// The metadata key for a Rating2 typed value to retrieve the information about the user's rating for the media.
+ /// The metadata for a Rating2 typed value to retrieve the information about the user's rating for the media.
///
object UserRating { get; set; }
///
- /// The metadata key for a CharSequence or string typed value to retrieve the information about the writer of the media.
+ /// The metadata for a CharSequence or string typed value to retrieve the information about the writer of the media.
///
string Writer { get; set; }
///
- /// The metadata key for a int typed value to retrieve the information about the year the media was created or published.
+ /// The metadata for a int typed value to retrieve the information about the year the media was created or published.
///
int Year { get; set; }
diff --git a/MediaManager/Library/MediaItem.cs b/MediaManager/Library/MediaItem.cs
index 368e32c4..e84c6e6d 100644
--- a/MediaManager/Library/MediaItem.cs
+++ b/MediaManager/Library/MediaItem.cs
@@ -33,7 +33,7 @@ public string Album
}
private object _albumArt;
- public object AlbumArt
+ public object AlbumImage
{
get => _albumArt;
set => SetProperty(ref _albumArt, value);
@@ -47,14 +47,14 @@ public string AlbumArtist
}
private string _albumArtUri;
- public string AlbumArtUri
+ public string AlbumImageUri
{
get => _albumArtUri;
set => SetProperty(ref _albumArtUri, value);
}
private object _art;
- public object Art
+ public object Image
{
get => _art;
set => SetProperty(ref _art, value);
@@ -68,7 +68,7 @@ public string Artist
}
private string _artUri;
- public string ArtUri
+ public string ImageUri
{
get => _artUri;
set => SetProperty(ref _artUri, value);
diff --git a/MediaManager/Library/MediaItemExtensions.cs b/MediaManager/Library/MediaItemExtensions.cs
index 979ab20d..90e39def 100644
--- a/MediaManager/Library/MediaItemExtensions.cs
+++ b/MediaManager/Library/MediaItemExtensions.cs
@@ -51,5 +51,25 @@ public static string GetSubText(this IMediaItem mediaItem)
else
return "";
}
+
+ public static string GetImageUri(this IMediaItem mediaItem)
+ {
+ if (!string.IsNullOrEmpty(mediaItem.ImageUri))
+ return mediaItem.ImageUri;
+ else if (!string.IsNullOrEmpty(mediaItem.AlbumImageUri))
+ return mediaItem.AlbumImageUri;
+ else
+ return "";
+ }
+
+ public static object GetImage(this IMediaItem mediaItem)
+ {
+ if (mediaItem.Image != null)
+ return mediaItem.Image;
+ else if (mediaItem.AlbumImage != null)
+ return mediaItem.AlbumImage;
+ else
+ return null;
+ }
}
}
diff --git a/MediaManager/Media/MediaExtractorBase.cs b/MediaManager/Media/MediaExtractorBase.cs
index 0e899c46..c7189f0a 100644
--- a/MediaManager/Media/MediaExtractorBase.cs
+++ b/MediaManager/Media/MediaExtractorBase.cs
@@ -143,6 +143,7 @@ public virtual async Task UpdateMediaItem(IMediaItem mediaItem)
}
mediaItem = await GetMetadata(mediaItem).ConfigureAwait(false);
+ mediaItem.Image = await GetMediaImage(mediaItem).ConfigureAwait(false);
mediaItem.IsMetadataExtracted = true;
}
@@ -163,11 +164,18 @@ public async Task GetMetadata(IMediaItem mediaItem)
public async Task