2012-09-11 01:34:02 +00:00
|
|
|
|
using MediaBrowser.Controller.Entities.Movies;
|
|
|
|
|
using MediaBrowser.Controller.Library;
|
2012-09-08 18:37:55 +00:00
|
|
|
|
using System;
|
2012-07-26 02:33:11 +00:00
|
|
|
|
using System.ComponentModel.Composition;
|
2012-07-12 06:55:27 +00:00
|
|
|
|
using System.IO;
|
|
|
|
|
|
2012-09-08 18:37:55 +00:00
|
|
|
|
namespace MediaBrowser.Controller.Resolvers.Movies
|
2012-07-12 06:55:27 +00:00
|
|
|
|
{
|
2012-07-26 02:33:11 +00:00
|
|
|
|
[Export(typeof(IBaseItemResolver))]
|
2012-07-12 06:55:27 +00:00
|
|
|
|
public class BoxSetResolver : BaseFolderResolver<BoxSet>
|
|
|
|
|
{
|
|
|
|
|
protected override BoxSet Resolve(ItemResolveEventArgs args)
|
|
|
|
|
{
|
2012-08-23 18:35:44 +00:00
|
|
|
|
// It's a boxset if all of the following conditions are met:
|
|
|
|
|
// Is a Directory
|
|
|
|
|
// Contains [boxset] in the path
|
2012-08-27 12:18:59 +00:00
|
|
|
|
if (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;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|