jellyfin/MediaBrowser.Movies/Resolvers/BoxSetResolver.cs

31 lines
1.0 KiB
C#
Raw Normal View History

2012-07-12 06:55:27 +00:00
using System;
using System.ComponentModel.Composition;
2012-07-12 06:55:27 +00:00
using System.IO;
using MediaBrowser.Controller.Library;
2012-07-12 06:55:27 +00:00
using MediaBrowser.Controller.Resolvers;
using MediaBrowser.Movies.Entities;
namespace MediaBrowser.Movies.Resolvers
{
[Export(typeof(IBaseItemResolver))]
2012-07-12 06:55:27 +00:00
public class BoxSetResolver : BaseFolderResolver<BoxSet>
{
protected override BoxSet Resolve(ItemResolveEventArgs args)
{
// It's a boxset if all of the following conditions are met:
// It's under a 'Movies' VF
// Is a Directory
// Contains [boxset] in the path
2012-08-21 14:42:40 +00:00
if ((args.VirtualFolderCollectionType ?? string.Empty).Equals("Movies", StringComparison.OrdinalIgnoreCase) && args.IsDirectory)
2012-07-12 06:55:27 +00:00
{
if (Path.GetFileName(args.Path).IndexOf("[boxset]", StringComparison.OrdinalIgnoreCase) != -1)
{
return new BoxSet();
}
}
return null;
}
}
}