diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2013-04-20 21:02:16 -0400 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2013-04-20 21:02:16 -0400 |
| commit | 19d21a246d9304f824674df3138b30a5b8e51e8c (patch) | |
| tree | 3078ba8b630c544915a4a2c1e0b928e193c19056 /MediaBrowser.Controller/Entities/Audio | |
| parent | 04030ffb65add7e280d3c9a8382bac706ebc56f4 (diff) | |
made Audio.Artist plural and removed duplicated of artists into the people collection
Diffstat (limited to 'MediaBrowser.Controller/Entities/Audio')
| -rw-r--r-- | MediaBrowser.Controller/Entities/Audio/Artist.cs | 18 | ||||
| -rw-r--r-- | MediaBrowser.Controller/Entities/Audio/Audio.cs | 33 |
2 files changed, 49 insertions, 2 deletions
diff --git a/MediaBrowser.Controller/Entities/Audio/Artist.cs b/MediaBrowser.Controller/Entities/Audio/Artist.cs new file mode 100644 index 0000000000..dcd6af92d3 --- /dev/null +++ b/MediaBrowser.Controller/Entities/Audio/Artist.cs @@ -0,0 +1,18 @@ + +namespace MediaBrowser.Controller.Entities.Audio +{ + /// <summary> + /// Class Artist + /// </summary> + public class Artist : BaseItem + { + /// <summary> + /// Gets the user data key. + /// </summary> + /// <returns>System.String.</returns> + public override string GetUserDataKey() + { + return Name; + } + } +} diff --git a/MediaBrowser.Controller/Entities/Audio/Audio.cs b/MediaBrowser.Controller/Entities/Audio/Audio.cs index d629ec4d77..9deb8241de 100644 --- a/MediaBrowser.Controller/Entities/Audio/Audio.cs +++ b/MediaBrowser.Controller/Entities/Audio/Audio.cs @@ -1,5 +1,7 @@ using MediaBrowser.Model.Entities; +using System; using System.Collections.Generic; +using System.Linq; using System.Runtime.Serialization; namespace MediaBrowser.Controller.Entities.Audio @@ -14,7 +16,7 @@ namespace MediaBrowser.Controller.Entities.Audio /// </summary> /// <value>The media streams.</value> public List<MediaStream> MediaStreams { get; set; } - + /// <summary> /// Override this to true if class should be grouped under a container in indicies /// The container class should be defined via IndexContainer @@ -51,7 +53,8 @@ namespace MediaBrowser.Controller.Entities.Audio /// Gets or sets the artist. /// </summary> /// <value>The artist.</value> - public string Artist { get; set; } + public List<string> Artists { get; set; } + /// <summary> /// Gets or sets the album. /// </summary> @@ -76,6 +79,32 @@ 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> /// Creates the name of the sort. /// </summary> /// <returns>System.String.</returns> |
