2014-03-07 08:53:23 -07:00
|
|
|
|
using MediaBrowser.Common.Configuration;
|
|
|
|
|
using MediaBrowser.Controller.Entities;
|
|
|
|
|
using System.IO;
|
2017-05-25 23:48:54 -07:00
|
|
|
|
|
2016-10-25 12:02:04 -07:00
|
|
|
|
using MediaBrowser.Model.IO;
|
2016-09-05 13:07:36 -07:00
|
|
|
|
using MediaBrowser.Controller.Collections;
|
2016-10-25 12:02:04 -07:00
|
|
|
|
using MediaBrowser.Controller.IO;
|
2014-03-07 08:53:23 -07:00
|
|
|
|
|
2016-11-10 23:43:42 -07:00
|
|
|
|
namespace Emby.Server.Implementations.Collections
|
2014-03-07 08:53:23 -07:00
|
|
|
|
{
|
|
|
|
|
public class CollectionsDynamicFolder : IVirtualFolderCreator
|
|
|
|
|
{
|
|
|
|
|
private readonly IApplicationPaths _appPaths;
|
2016-08-13 20:12:26 -07:00
|
|
|
|
private readonly IFileSystem _fileSystem;
|
2014-03-07 08:53:23 -07:00
|
|
|
|
|
2015-09-13 16:07:54 -07:00
|
|
|
|
public CollectionsDynamicFolder(IApplicationPaths appPaths, IFileSystem fileSystem)
|
2014-03-07 08:53:23 -07:00
|
|
|
|
{
|
|
|
|
|
_appPaths = appPaths;
|
2015-09-13 16:07:54 -07:00
|
|
|
|
_fileSystem = fileSystem;
|
2014-03-07 08:53:23 -07:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public BasePluginFolder GetFolder()
|
|
|
|
|
{
|
|
|
|
|
var path = Path.Combine(_appPaths.DataPath, "collections");
|
|
|
|
|
|
2015-09-13 14:32:02 -07:00
|
|
|
|
_fileSystem.CreateDirectory(path);
|
2014-03-07 08:53:23 -07:00
|
|
|
|
|
|
|
|
|
return new ManualCollectionsFolder
|
|
|
|
|
{
|
|
|
|
|
Path = path
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|