The Free Software Media System - Server Backend & API
audio page progress
Luke Pulverenti4a100452cf98
diff --git a/MediaBrowser.Api/UserLibrary/ArtistsService.cs b/MediaBrowser.Api/UserLibrary/ArtistsService.csindex 2622f0bd15..c5f7f492ad 100644--- a/MediaBrowser.Api/UserLibrary/ArtistsService.cs+++ b/MediaBrowser.Api/UserLibrary/ArtistsService.cs@@ -161,12 +161,16 @@ namespace MediaBrowser.Api.UserLibraryreturn itemsList.SelectMany(i =>{- var list = i.Artists.ToList();+ var list = new List<string>();if (!string.IsNullOrEmpty(i.AlbumArtist)){list.Add(i.AlbumArtist);}+ if (!string.IsNullOrEmpty(i.Artist))+ {+ list.Add(i.Artist);+ }return list;})diff --git a/MediaBrowser.Controller/Dto/DtoBuilder.cs b/MediaBrowser.Controller/Dto/DtoBuilder.csindex 371241d1ba..e662355106 100644--- a/MediaBrowser.Controller/Dto/DtoBuilder.cs+++ b/MediaBrowser.Controller/Dto/DtoBuilder.cs@@ -427,7 +427,7 @@ namespace MediaBrowser.Controller.Dto{dto.Album = audio.Album;dto.AlbumArtist = audio.AlbumArtist;- dto.Artists = audio.Artists;+ dto.Artist = audio.Artist;}}diff --git a/MediaBrowser.Controller/Entities/Audio/Audio.cs b/MediaBrowser.Controller/Entities/Audio/Audio.csindex 16e4e0e596..adaec9fdcf 100644--- a/MediaBrowser.Controller/Entities/Audio/Audio.cs+++ b/MediaBrowser.Controller/Entities/Audio/Audio.cs@@ -1,7 +1,6 @@-using MediaBrowser.Model.Entities;-using System;+using System;+using MediaBrowser.Model.Entities;using System.Collections.Generic;-using System.Linq;using System.Runtime.Serialization;namespace MediaBrowser.Controller.Entities.Audio@@ -53,7 +52,7 @@ namespace MediaBrowser.Controller.Entities.Audio/// Gets or sets the artist./// </summary>/// <value>The artist.</value>- public List<string> Artists { get; set; }+ public string Artist { get; set; }/// <summary>/// 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>/// Creates the name of the sort./// </summary>/// <returns>System.String.</returns>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;}@@ -122,7 +94,7 @@ namespace MediaBrowser.Controller.Entities.Audio/// <returns><c>true</c> if the specified name has artist; otherwise, <c>false</c>.</returns>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);}}}diff --git a/MediaBrowser.Controller/Entities/Audio/MusicAlbum.cs b/MediaBrowser.Controller/Entities/Audio/MusicAlbum.csindex 7d6577b4ec..d93aec94cc 100644--- a/MediaBrowser.Controller/Entities/Audio/MusicAlbum.cs+++ b/MediaBrowser.Controller/Entities/Audio/MusicAlbum.cs@@ -139,14 +139,5 @@ namespace MediaBrowser.Controller.Entities.Audiobase.Images = value;}}-- /// <summary>- /// Creates the name of the sort.- /// </summary>- /// <returns>System.String.</returns>- protected override string CreateSortName()- {- return ProductionYear != null ? ProductionYear.Value.ToString("0000") : Name;- }}}diff --git a/MediaBrowser.Controller/Entities/Folder.cs b/MediaBrowser.Controller/Entities/Folder.csindex 14851ec430..3a8c8eec10 100644--- a/MediaBrowser.Controller/Entities/Folder.cs+++ b/MediaBrowser.Controller/Entities/Folder.cs@@ -193,8 +193,8 @@ namespace MediaBrowser.Controller.Entities{var songs = recursiveChildren.OfType<Audio.Audio>().ToList();- indexFolders = songs.SelectMany(i => i.Artists)- .Distinct()+ indexFolders = songs.Select(i => i.Artist ?? string.Empty)+ .Distinct(StringComparer.OrdinalIgnoreCase).Select(i =>{try@@ -214,7 +214,7 @@ namespace MediaBrowser.Controller.Entities}).Where(i => i != null).Select(a => new IndexFolder(us, a,- songs.Where(i => i.Artists.Contains(a.Name, StringComparer.OrdinalIgnoreCase)+ songs.Where(i => string.Equals(i.Artist, a.Name, StringComparison.OrdinalIgnoreCase)), currentIndexName)).Concat(indexFolders);}diff --git a/MediaBrowser.Controller/Providers/MediaInfo/FFProbeAudioInfoProvider.cs b/MediaBrowser.Controller/Providers/MediaInfo/FFProbeAudioInfoProvider.csindex 56e85eb1f0..983286502b 100644--- a/MediaBrowser.Controller/Providers/MediaInfo/FFProbeAudioInfoProvider.cs+++ b/MediaBrowser.Controller/Providers/MediaInfo/FFProbeAudioInfoProvider.cs@@ -109,19 +109,7 @@ namespace MediaBrowser.Controller.Providers.MediaInfoaudio.Album = GetDictionaryValue(tags, "album");- var artists = GetDictionaryValue(tags, "artist");- if (!string.IsNullOrWhiteSpace(artists))- {- foreach (var artist in Split(artists))- {- var name = artist.Trim();-- if (!string.IsNullOrEmpty(name))- {- audio.AddArtist(name);- }- }- }+ audio.Artist = GetDictionaryValue(tags, "artist");// Several different forms of albumartistaudio.AlbumArtist = GetDictionaryValue(tags, "albumartist") ?? GetDictionaryValue(tags, "album artist") ?? GetDictionaryValue(tags, "album_artist");diff --git a/MediaBrowser.Model/DTO/BaseItemDto.cs b/MediaBrowser.Model/DTO/BaseItemDto.csindex db5949c292..6e30c46b72 100644--- a/MediaBrowser.Model/DTO/BaseItemDto.cs+++ b/MediaBrowser.Model/DTO/BaseItemDto.cs@@ -268,7 +268,7 @@ namespace MediaBrowser.Model.Dto/// Gets or sets the artist./// </summary>/// <value>The artist.</value>- public List<string> Artists { get; set; }+ public string Artist { get; set; }/// <summary>/// Gets or sets the album.@@ -403,7 +403,7 @@ namespace MediaBrowser.Model.Dto/// </summary>/// <value>The revenue.</value>public double? Revenue { get; set; }-+/// <summary>/// Gets a value indicating whether this instance can resume./// </summary>diff --git a/MediaBrowser.Server.Implementations/Library/LibraryManager.cs b/MediaBrowser.Server.Implementations/Library/LibraryManager.csindex 692176efca..315abd49dd 100644--- a/MediaBrowser.Server.Implementations/Library/LibraryManager.cs+++ b/MediaBrowser.Server.Implementations/Library/LibraryManager.cs@@ -788,12 +788,16 @@ namespace MediaBrowser.Server.Implementations.Library.OfType<Audio>().SelectMany(c =>{- var list = c.Artists.ToList();+ var list = new List<string>();if (!string.IsNullOrEmpty(c.AlbumArtist)){list.Add(c.AlbumArtist);}+ if (!string.IsNullOrEmpty(c.Artist))+ {+ list.Add(c.Artist);+ }return list;})diff --git a/MediaBrowser.Server.Implementations/Sorting/ArtistComparer.cs b/MediaBrowser.Server.Implementations/Sorting/ArtistComparer.csindex d31ee87906..b0a6989e93 100644--- a/MediaBrowser.Server.Implementations/Sorting/ArtistComparer.cs+++ b/MediaBrowser.Server.Implementations/Sorting/ArtistComparer.cs@@ -32,7 +32,12 @@ namespace MediaBrowser.Server.Implementations.Sorting{var audio = x as Audio;- return audio == null ? string.Empty : audio.Artists.OrderBy(i => i).FirstOrDefault() ?? string.Empty;+ if (audio == null)+ {+ return string.Empty;+ }++ return audio.Artist ?? string.Empty;}/// <summary>diff --git a/MediaBrowser.WebDashboard/Api/DashboardService.cs b/MediaBrowser.WebDashboard/Api/DashboardService.csindex 9f49c83a8c..fbc44136b2 100644--- a/MediaBrowser.WebDashboard/Api/DashboardService.cs+++ b/MediaBrowser.WebDashboard/Api/DashboardService.cs@@ -485,6 +485,7 @@ namespace MediaBrowser.WebDashboard.Api"pluginupdatespage.js","scheduledtaskpage.js","scheduledtaskspage.js",+ "songs.js","supporterkeypage.js","supporterpage.js","tvgenres.js",diff --git a/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj b/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csprojindex f7cd271ef5..c9406417b9 100644--- a/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj+++ b/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj@@ -246,6 +246,9 @@<Content Include="dashboard-ui\musicrecommended.html"><CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory></Content>+ <Content Include="dashboard-ui\songs.html">+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>+ </Content><Content Include="dashboard-ui\playlist.html"><CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory></Content>@@ -297,6 +300,9 @@<Content Include="dashboard-ui\scripts\musicgenres.js"><CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory></Content>+ <Content Include="dashboard-ui\scripts\songs.js">+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>+ </Content><Content Include="dashboard-ui\scripts\playlist.js"><CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory></Content>diff --git a/Nuget/MediaBrowser.Common.Internal.nuspec b/Nuget/MediaBrowser.Common.Internal.nuspecindex 8634c1cf45..3a241635d5 100644--- a/Nuget/MediaBrowser.Common.Internal.nuspec+++ b/Nuget/MediaBrowser.Common.Internal.nuspec@@ -2,7 +2,7 @@<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd"><metadata><id>MediaBrowser.Common.Internal</id>- <version>3.0.80</version>+ <version>3.0.81</version><title>MediaBrowser.Common.Internal</title><authors>Luke</authors><owners>ebr,Luke,scottisafool</owners>@@ -12,7 +12,7 @@<description>Contains common components shared by Media Browser Theatre and Media Browser Server. Not intended for plugin developer consumption.</description><copyright>Copyright © Media Browser 2013</copyright><dependencies>- <dependency id="MediaBrowser.Common" version="3.0.80" />+ <dependency id="MediaBrowser.Common" version="3.0.81" /><dependency id="NLog" version="2.0.1.2" /><dependency id="ServiceStack.Text" version="3.9.38" /><dependency id="SimpleInjector" version="2.2.1" />diff --git a/Nuget/MediaBrowser.Common.nuspec b/Nuget/MediaBrowser.Common.nuspecindex b32be84ea3..e5430c124b 100644--- a/Nuget/MediaBrowser.Common.nuspec+++ b/Nuget/MediaBrowser.Common.nuspec@@ -2,7 +2,7 @@<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd"><metadata><id>MediaBrowser.Common</id>- <version>3.0.80</version>+ <version>3.0.81</version><title>MediaBrowser.Common</title><authors>Media Browser Team</authors><owners>ebr,Luke,scottisafool</owners>diff --git a/Nuget/MediaBrowser.Server.Core.nuspec b/Nuget/MediaBrowser.Server.Core.nuspecindex 6d7316f9b1..ce4cf9faab 100644--- a/Nuget/MediaBrowser.Server.Core.nuspec+++ b/Nuget/MediaBrowser.Server.Core.nuspec@@ -2,7 +2,7 @@<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd"><metadata><id>MediaBrowser.Server.Core</id>- <version>3.0.80</version>+ <version>3.0.81</version><title>Media Browser.Server.Core</title><authors>Media Browser Team</authors><owners>ebr,Luke,scottisafool</owners>@@ -12,7 +12,7 @@<description>Contains core components required to build plugins for Media Browser Server.</description><copyright>Copyright © Media Browser 2013</copyright><dependencies>- <dependency id="MediaBrowser.Common" version="3.0.80" />+ <dependency id="MediaBrowser.Common" version="3.0.81" /></dependencies></metadata><files>