jellyfin/MediaBrowser.Controller/Resolvers/Audio/MusicAlbumResolver.cs
2013-02-23 02:57:11 -05:00

38 lines
1.1 KiB
C#

using MediaBrowser.Controller.Entities.Audio;
using MediaBrowser.Controller.Library;
namespace MediaBrowser.Controller.Resolvers.Audio
{
/// <summary>
/// Class MusicAlbumResolver
/// </summary>
public class MusicAlbumResolver : BaseItemResolver<MusicAlbum>
{
/// <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 MusicAlbum Resolve(ItemResolveArgs args)
{
if (!args.IsDirectory) return null;
//Avoid mis-identifying top folders
if (args.Parent == null) return null;
if (args.Parent.IsRoot) return null;
return EntityResolutionHelper.IsMusicAlbum(args) ? new MusicAlbum() : null;
}
}
}