|
@@ -1,6 +1,7 @@
|
|
using System.Collections.Generic;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Linq;
|
|
using System.Runtime.Serialization;
|
|
using System.Runtime.Serialization;
|
|
|
|
+using MediaBrowser.Model.Entities;
|
|
|
|
|
|
namespace MediaBrowser.Controller.Entities.Audio
|
|
namespace MediaBrowser.Controller.Entities.Audio
|
|
{
|
|
{
|
|
@@ -52,30 +53,6 @@ namespace MediaBrowser.Controller.Entities.Audio
|
|
get { return Parent as MusicArtist ?? UnknwonArtist; }
|
|
get { return Parent as MusicArtist ?? UnknwonArtist; }
|
|
}
|
|
}
|
|
|
|
|
|
- /// <summary>
|
|
|
|
- /// Override to point to first child (song) if not explicitly defined
|
|
|
|
- /// </summary>
|
|
|
|
- /// <value>The primary image path.</value>
|
|
|
|
- [IgnoreDataMember]
|
|
|
|
- public override string PrimaryImagePath
|
|
|
|
- {
|
|
|
|
- get
|
|
|
|
- {
|
|
|
|
- if (base.PrimaryImagePath == null)
|
|
|
|
- {
|
|
|
|
- var child = Children.FirstOrDefault();
|
|
|
|
-
|
|
|
|
- return child == null ? base.PrimaryImagePath : child.PrimaryImagePath;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- return base.PrimaryImagePath;
|
|
|
|
- }
|
|
|
|
- set
|
|
|
|
- {
|
|
|
|
- base.PrimaryImagePath = value;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
/// <summary>
|
|
/// <summary>
|
|
/// Override to point to first child (song)
|
|
/// Override to point to first child (song)
|
|
/// </summary>
|
|
/// </summary>
|
|
@@ -130,6 +107,39 @@ namespace MediaBrowser.Controller.Entities.Audio
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /// <summary>
|
|
|
|
+ /// Gets or sets the images.
|
|
|
|
+ /// </summary>
|
|
|
|
+ /// <value>The images.</value>
|
|
|
|
+ public override Dictionary<string, string> Images
|
|
|
|
+ {
|
|
|
|
+ get
|
|
|
|
+ {
|
|
|
|
+ var images = base.Images;
|
|
|
|
+ string primaryImagePath;
|
|
|
|
+
|
|
|
|
+ if (images == null || !images.TryGetValue(ImageType.Primary.ToString(), out primaryImagePath))
|
|
|
|
+ {
|
|
|
|
+ var image = Children.Select(c => c.PrimaryImagePath).FirstOrDefault(c => !string.IsNullOrEmpty(c));
|
|
|
|
+
|
|
|
|
+ if (!string.IsNullOrEmpty(image))
|
|
|
|
+ {
|
|
|
|
+ if (images == null)
|
|
|
|
+ {
|
|
|
|
+ images = new Dictionary<string, string>();
|
|
|
|
+ }
|
|
|
|
+ images[ImageType.Primary.ToString()] = image;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ return images;
|
|
|
|
+ }
|
|
|
|
+ set
|
|
|
|
+ {
|
|
|
|
+ base.Images = value;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
/// <summary>
|
|
/// <summary>
|
|
/// Creates the name of the sort.
|
|
/// Creates the name of the sort.
|
|
/// </summary>
|
|
/// </summary>
|