diff --git a/MediaBrowser.Api/BaseApiService.cs b/MediaBrowser.Api/BaseApiService.cs
index ee90d2134f..23d9b0126f 100644
--- a/MediaBrowser.Api/BaseApiService.cs
+++ b/MediaBrowser.Api/BaseApiService.cs
@@ -128,7 +128,12 @@ namespace MediaBrowser.Api
if (auth.ContainsKey("UserId"))
{
- user = UserManager.GetUserById(new Guid(auth["UserId"]));
+ var userId = auth["UserId"];
+
+ if (!string.IsNullOrEmpty(userId))
+ {
+ user = UserManager.GetUserById(new Guid(userId));
+ }
}
var deviceId = auth["DeviceId"];
diff --git a/MediaBrowser.Controller/Entities/Audio/MusicAlbumDisc.cs b/MediaBrowser.Controller/Entities/Audio/MusicAlbumDisc.cs
new file mode 100644
index 0000000000..9007a1bfd4
--- /dev/null
+++ b/MediaBrowser.Controller/Entities/Audio/MusicAlbumDisc.cs
@@ -0,0 +1,25 @@
+
+namespace MediaBrowser.Controller.Entities.Audio
+{
+ ///
+ /// Class MusicAlbumDisc
+ ///
+ public class MusicAlbumDisc : Folder
+ {
+ ///
+ /// Gets or sets the display type of the media.
+ ///
+ /// The display type of the media.
+ public override string DisplayMediaType
+ {
+ get
+ {
+ return "Disc";
+ }
+ set
+ {
+ base.DisplayMediaType = value;
+ }
+ }
+ }
+}
diff --git a/MediaBrowser.Controller/MediaBrowser.Controller.csproj b/MediaBrowser.Controller/MediaBrowser.Controller.csproj
index 2ffa8333a8..3e8eed152a 100644
--- a/MediaBrowser.Controller/MediaBrowser.Controller.csproj
+++ b/MediaBrowser.Controller/MediaBrowser.Controller.csproj
@@ -71,6 +71,7 @@
+
diff --git a/MediaBrowser.Server.Implementations/Library/Resolvers/Audio/MusicAlbumDiscResolver.cs b/MediaBrowser.Server.Implementations/Library/Resolvers/Audio/MusicAlbumDiscResolver.cs
new file mode 100644
index 0000000000..9a1065db52
--- /dev/null
+++ b/MediaBrowser.Server.Implementations/Library/Resolvers/Audio/MusicAlbumDiscResolver.cs
@@ -0,0 +1,33 @@
+using MediaBrowser.Controller.Entities.Audio;
+using MediaBrowser.Controller.Library;
+using MediaBrowser.Controller.Resolvers;
+
+namespace MediaBrowser.Server.Implementations.Library.Resolvers.Audio
+{
+ ///
+ /// Class MusicAlbumDiscResolver
+ ///
+ public class MusicAlbumDiscResolver : ItemResolver
+ {
+ ///
+ /// Gets the priority.
+ ///
+ /// The priority.
+ public override ResolverPriority Priority
+ {
+ get { return ResolverPriority.Third; } // we need to be ahead of the generic folder resolver but behind the movie one
+ }
+
+ ///
+ /// Resolves the specified args.
+ ///
+ /// The args.
+ /// MusicAlbum.
+ protected override MusicAlbumDisc Resolve(ItemResolveArgs args)
+ {
+ if (!args.IsDirectory) return null;
+
+ return args.Parent is MusicAlbum ? new MusicAlbumDisc() : null;
+ }
+ }
+}
diff --git a/MediaBrowser.Server.Implementations/Library/Resolvers/Audio/MusicAlbumResolver.cs b/MediaBrowser.Server.Implementations/Library/Resolvers/Audio/MusicAlbumResolver.cs
index 411e431aa3..98e99baa27 100644
--- a/MediaBrowser.Server.Implementations/Library/Resolvers/Audio/MusicAlbumResolver.cs
+++ b/MediaBrowser.Server.Implementations/Library/Resolvers/Audio/MusicAlbumResolver.cs
@@ -1,10 +1,9 @@
-using System.Collections.Generic;
-using System.IO;
-using System.Linq;
-using MediaBrowser.Controller.Entities.Audio;
-using MediaBrowser.Controller.IO;
+using MediaBrowser.Controller.Entities.Audio;
using MediaBrowser.Controller.Library;
using MediaBrowser.Controller.Resolvers;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
namespace MediaBrowser.Server.Implementations.Library.Resolvers.Audio
{
@@ -34,6 +33,7 @@ namespace MediaBrowser.Server.Implementations.Library.Resolvers.Audio
//Avoid mis-identifying top folders
if (args.Parent == null) return null;
if (args.Parent.IsRoot) return null;
+ if (args.Parent is MusicAlbum) return null;
return IsMusicAlbum(args) ? new MusicAlbum() : null;
}
diff --git a/MediaBrowser.Server.Implementations/MediaBrowser.Server.Implementations.csproj b/MediaBrowser.Server.Implementations/MediaBrowser.Server.Implementations.csproj
index 55a6ff9c87..22d4195a2a 100644
--- a/MediaBrowser.Server.Implementations/MediaBrowser.Server.Implementations.csproj
+++ b/MediaBrowser.Server.Implementations/MediaBrowser.Server.Implementations.csproj
@@ -129,6 +129,7 @@
+