fixes #268 - (Multicd) Albums with discnumbers in subfolders on filesystem = Multiple album objects
This commit is contained in:
parent
734e53e937
commit
57d7e9fccc
|
@ -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"];
|
||||
|
|
25
MediaBrowser.Controller/Entities/Audio/MusicAlbumDisc.cs
Normal file
25
MediaBrowser.Controller/Entities/Audio/MusicAlbumDisc.cs
Normal file
|
@ -0,0 +1,25 @@
|
|||
|
||||
namespace MediaBrowser.Controller.Entities.Audio
|
||||
{
|
||||
/// <summary>
|
||||
/// Class MusicAlbumDisc
|
||||
/// </summary>
|
||||
public class MusicAlbumDisc : Folder
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the display type of the media.
|
||||
/// </summary>
|
||||
/// <value>The display type of the media.</value>
|
||||
public override string DisplayMediaType
|
||||
{
|
||||
get
|
||||
{
|
||||
return "Disc";
|
||||
}
|
||||
set
|
||||
{
|
||||
base.DisplayMediaType = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -71,6 +71,7 @@
|
|||
</Compile>
|
||||
<Compile Include="Configuration\IServerConfigurationManager.cs" />
|
||||
<Compile Include="Dto\SessionInfoDtoBuilder.cs" />
|
||||
<Compile Include="Entities\Audio\MusicAlbumDisc.cs" />
|
||||
<Compile Include="Session\ISessionManager.cs" />
|
||||
<Compile Include="Drawing\ImageExtensions.cs" />
|
||||
<Compile Include="Drawing\ImageHeader.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
|
||||
{
|
||||
/// <summary>
|
||||
/// Class MusicAlbumDiscResolver
|
||||
/// </summary>
|
||||
public class MusicAlbumDiscResolver : ItemResolver<MusicAlbumDisc>
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the priority.
|
||||
/// </summary>
|
||||
/// <value>The priority.</value>
|
||||
public override ResolverPriority Priority
|
||||
{
|
||||
get { return ResolverPriority.Third; } // we need to be ahead of the generic folder resolver but behind the movie one
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Resolves the specified args.
|
||||
/// </summary>
|
||||
/// <param name="args">The args.</param>
|
||||
/// <returns>MusicAlbum.</returns>
|
||||
protected override MusicAlbumDisc Resolve(ItemResolveArgs args)
|
||||
{
|
||||
if (!args.IsDirectory) return null;
|
||||
|
||||
return args.Parent is MusicAlbum ? new MusicAlbumDisc() : null;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -129,6 +129,7 @@
|
|||
<Compile Include="Library\LuceneSearchEngine.cs" />
|
||||
<Compile Include="Library\ResolverHelper.cs" />
|
||||
<Compile Include="Library\Resolvers\Audio\AudioResolver.cs" />
|
||||
<Compile Include="Library\Resolvers\Audio\MusicAlbumDiscResolver.cs" />
|
||||
<Compile Include="Library\Resolvers\Audio\MusicAlbumResolver.cs" />
|
||||
<Compile Include="Library\Resolvers\Audio\MusicArtistResolver.cs" />
|
||||
<Compile Include="Library\Resolvers\BaseItemResolver.cs" />
|
||||
|
|
Loading…
Reference in New Issue
Block a user