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