aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--MediaBrowser.Api/UserLibrary/ArtistsService.cs6
-rw-r--r--MediaBrowser.Controller/Dto/DtoBuilder.cs2
-rw-r--r--MediaBrowser.Controller/Entities/Audio/Audio.cs38
-rw-r--r--MediaBrowser.Controller/Entities/Audio/MusicAlbum.cs9
-rw-r--r--MediaBrowser.Controller/Entities/Folder.cs6
-rw-r--r--MediaBrowser.Controller/Providers/MediaInfo/FFProbeAudioInfoProvider.cs14
-rw-r--r--MediaBrowser.Model/DTO/BaseItemDto.cs4
-rw-r--r--MediaBrowser.Server.Implementations/Library/LibraryManager.cs6
-rw-r--r--MediaBrowser.Server.Implementations/Sorting/ArtistComparer.cs7
-rw-r--r--MediaBrowser.WebDashboard/Api/DashboardService.cs1
-rw-r--r--MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj6
-rw-r--r--Nuget/MediaBrowser.Common.Internal.nuspec4
-rw-r--r--Nuget/MediaBrowser.Common.nuspec2
-rw-r--r--Nuget/MediaBrowser.Server.Core.nuspec4
14 files changed, 40 insertions, 69 deletions
diff --git a/MediaBrowser.Api/UserLibrary/ArtistsService.cs b/MediaBrowser.Api/UserLibrary/ArtistsService.cs
index 2622f0bd1..c5f7f492a 100644
--- a/MediaBrowser.Api/UserLibrary/ArtistsService.cs
+++ b/MediaBrowser.Api/UserLibrary/ArtistsService.cs
@@ -161,12 +161,16 @@ namespace MediaBrowser.Api.UserLibrary
return 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.cs
index 371241d1b..e66235510 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.cs
index 16e4e0e59..adaec9fdc 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.
@@ -79,39 +78,12 @@ 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.cs
index 7d6577b4e..d93aec94c 100644
--- a/MediaBrowser.Controller/Entities/Audio/MusicAlbum.cs
+++ b/MediaBrowser.Controller/Entities/Audio/MusicAlbum.cs
@@ -139,14 +139,5 @@ namespace MediaBrowser.Controller.Entities.Audio
base.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.cs
index 14851ec43..3a8c8eec1 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.cs
index 56e85eb1f..983286502 100644
--- a/MediaBrowser.Controller/Providers/MediaInfo/FFProbeAudioInfoProvider.cs
+++ b/MediaBrowser.Controller/Providers/MediaInfo/FFProbeAudioInfoProvider.cs
@@ -109,19 +109,7 @@ namespace MediaBrowser.Controller.Providers.MediaInfo
audio.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 albumartist
audio.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.cs
index db5949c29..6e30c46b7 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.cs
index 692176efc..315abd49d 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.cs
index d31ee8790..b0a6989e9 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.cs
index 9f49c83a8..fbc44136b 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.csproj
index f7cd271ef..c9406417b 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.nuspec
index 8634c1cf4..3a241635d 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.nuspec
index b32be84ea..e5430c124 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.nuspec
index 6d7316f9b..ce4cf9faa 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>