|
@@ -1,7 +1,6 @@
|
|
-using MediaBrowser.Model.Entities;
|
|
|
|
-using System;
|
|
|
|
|
|
+using System;
|
|
|
|
+using MediaBrowser.Model.Entities;
|
|
using System.Collections.Generic;
|
|
using System.Collections.Generic;
|
|
-using System.Linq;
|
|
|
|
using System.Runtime.Serialization;
|
|
using System.Runtime.Serialization;
|
|
|
|
|
|
namespace MediaBrowser.Controller.Entities.Audio
|
|
namespace MediaBrowser.Controller.Entities.Audio
|
|
@@ -53,7 +52,7 @@ namespace MediaBrowser.Controller.Entities.Audio
|
|
/// Gets or sets the artist.
|
|
/// Gets or sets the artist.
|
|
/// </summary>
|
|
/// </summary>
|
|
/// <value>The artist.</value>
|
|
/// <value>The artist.</value>
|
|
- public List<string> Artists { get; set; }
|
|
|
|
|
|
+ public string Artist { get; set; }
|
|
|
|
|
|
/// <summary>
|
|
/// <summary>
|
|
/// Gets or sets the album.
|
|
/// Gets or sets the album.
|
|
@@ -78,40 +77,13 @@ namespace MediaBrowser.Controller.Entities.Audio
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- /// <summary>
|
|
|
|
- /// Initializes a new instance of the <see cref="Audio"/> class.
|
|
|
|
- /// </summary>
|
|
|
|
- public Audio()
|
|
|
|
- {
|
|
|
|
- Artists = new List<string>();
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- /// <summary>
|
|
|
|
- /// Adds the artist.
|
|
|
|
- /// </summary>
|
|
|
|
- /// <param name="name">The name.</param>
|
|
|
|
- /// <exception cref="System.ArgumentNullException">name</exception>
|
|
|
|
- public void AddArtist(string name)
|
|
|
|
- {
|
|
|
|
- if (string.IsNullOrWhiteSpace(name))
|
|
|
|
- {
|
|
|
|
- throw new ArgumentNullException("name");
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- if (!Artists.Contains(name, StringComparer.OrdinalIgnoreCase))
|
|
|
|
- {
|
|
|
|
- Artists.Add(name);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
/// <summary>
|
|
/// <summary>
|
|
/// Creates the name of the sort.
|
|
/// Creates the name of the sort.
|
|
/// </summary>
|
|
/// </summary>
|
|
/// <returns>System.String.</returns>
|
|
/// <returns>System.String.</returns>
|
|
protected override string CreateSortName()
|
|
protected override string CreateSortName()
|
|
{
|
|
{
|
|
- return (ProductionYear != null ? ProductionYear.Value.ToString("000-") : "")
|
|
|
|
- + (ParentIndexNumber != null ? ParentIndexNumber.Value.ToString("0000 - ") : "")
|
|
|
|
|
|
+ return (ParentIndexNumber != null ? ParentIndexNumber.Value.ToString("0000 - ") : "")
|
|
+ (IndexNumber != null ? IndexNumber.Value.ToString("0000 - ") : "") + Name;
|
|
+ (IndexNumber != null ? IndexNumber.Value.ToString("0000 - ") : "") + Name;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -122,7 +94,7 @@ namespace MediaBrowser.Controller.Entities.Audio
|
|
/// <returns><c>true</c> if the specified name has artist; otherwise, <c>false</c>.</returns>
|
|
/// <returns><c>true</c> if the specified name has artist; otherwise, <c>false</c>.</returns>
|
|
public bool HasArtist(string name)
|
|
public bool HasArtist(string name)
|
|
{
|
|
{
|
|
- return Artists.Contains(name, StringComparer.OrdinalIgnoreCase) || string.Equals(AlbumArtist, name, StringComparison.OrdinalIgnoreCase);
|
|
|
|
|
|
+ return string.Equals(Artist, name, StringComparison.OrdinalIgnoreCase) || string.Equals(AlbumArtist, name, StringComparison.OrdinalIgnoreCase);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|