Browse Source

music progress and search placeholder

Luke Pulverenti 12 years ago
parent
commit
dc6f264a30
2 changed files with 14 additions and 9 deletions
  1. 11 6
      MediaBrowser.Controller/Dto/DtoBuilder.cs
  2. 3 3
      MediaBrowser.Model/DTO/BaseItemDto.cs

+ 11 - 6
MediaBrowser.Controller/Dto/DtoBuilder.cs

@@ -65,7 +65,7 @@ namespace MediaBrowser.Controller.Dto
             {
             {
                 dto.Studios = item.Studios;
                 dto.Studios = item.Studios;
             }
             }
-            
+
             if (fields.Contains(ItemFields.People))
             if (fields.Contains(ItemFields.People))
             {
             {
                 tasks.Add(AttachPeople(dto, item));
                 tasks.Add(AttachPeople(dto, item));
@@ -176,7 +176,7 @@ namespace MediaBrowser.Controller.Dto
 
 
             if (item.IsFolder && fields.Contains(ItemFields.DisplayPreferencesId))
             if (item.IsFolder && fields.Contains(ItemFields.DisplayPreferencesId))
             {
             {
-                dto.DisplayPreferencesId = ((Folder) item).GetDisplayPreferencesId(user.Id).ToString();
+                dto.DisplayPreferencesId = ((Folder)item).GetDisplayPreferencesId(user.Id).ToString();
             }
             }
 
 
             if (item.IsFolder)
             if (item.IsFolder)
@@ -283,7 +283,7 @@ namespace MediaBrowser.Controller.Dto
             {
             {
                 dto.ProductionLocations = item.ProductionLocations;
                 dto.ProductionLocations = item.ProductionLocations;
             }
             }
-            
+
             dto.AspectRatio = item.AspectRatio;
             dto.AspectRatio = item.AspectRatio;
 
 
             dto.BackdropImageTags = GetBackdropImageTags(item);
             dto.BackdropImageTags = GetBackdropImageTags(item);
@@ -340,7 +340,7 @@ namespace MediaBrowser.Controller.Dto
                     dto.OverviewHtml = item.Overview;
                     dto.OverviewHtml = item.Overview;
                 }
                 }
             }
             }
-            
+
             // If there are no backdrops, indicate what parent has them in case the Ui wants to allow inheritance
             // If there are no backdrops, indicate what parent has them in case the Ui wants to allow inheritance
             if (dto.BackdropImageTags.Count == 0)
             if (dto.BackdropImageTags.Count == 0)
             {
             {
@@ -424,7 +424,7 @@ namespace MediaBrowser.Controller.Dto
                 {
                 {
                     dto.Album = audio.Album;
                     dto.Album = audio.Album;
                     dto.AlbumArtist = audio.AlbumArtist;
                     dto.AlbumArtist = audio.AlbumArtist;
-                    dto.Artist = audio.Artist;
+                    dto.Artists = new[] { audio.Artist };
                 }
                 }
 
 
                 var album = item as MusicAlbum;
                 var album = item as MusicAlbum;
@@ -434,7 +434,12 @@ namespace MediaBrowser.Controller.Dto
                     var songs = album.Children.OfType<Audio>().ToList();
                     var songs = album.Children.OfType<Audio>().ToList();
 
 
                     dto.AlbumArtist = songs.Select(i => i.AlbumArtist).FirstOrDefault(i => !string.IsNullOrEmpty(i));
                     dto.AlbumArtist = songs.Select(i => i.AlbumArtist).FirstOrDefault(i => !string.IsNullOrEmpty(i));
-                    dto.Artist = songs.Select(i => i.Artist).FirstOrDefault(i => !string.IsNullOrEmpty(i));
+
+                    dto.Artists =
+                        songs.Select(i => i.Artist ?? string.Empty)
+                             .Where(i => !string.IsNullOrEmpty(i))
+                             .Distinct(StringComparer.OrdinalIgnoreCase)
+                             .ToArray();
                 }
                 }
             }
             }
 
 

+ 3 - 3
MediaBrowser.Model/DTO/BaseItemDto.cs

@@ -271,10 +271,10 @@ namespace MediaBrowser.Model.Dto
         public double? PrimaryImageAspectRatio { get; set; }
         public double? PrimaryImageAspectRatio { get; set; }
 
 
         /// <summary>
         /// <summary>
-        /// Gets or sets the artist.
+        /// Gets or sets the artists.
         /// </summary>
         /// </summary>
-        /// <value>The artist.</value>
-        public string Artist { get; set; }
+        /// <value>The artists.</value>
+        public string[] Artists { get; set; }
 
 
         /// <summary>
         /// <summary>
         /// Gets or sets the album.
         /// Gets or sets the album.