2014-03-07 16:53:23 +01:00
|
|
|
|
using MediaBrowser.Common.Configuration;
|
|
|
|
|
using MediaBrowser.Controller.Entities;
|
|
|
|
|
using System.IO;
|
2015-09-14 01:07:54 +02:00
|
|
|
|
using MediaBrowser.Common.IO;
|
2014-03-07 16:53:23 +01:00
|
|
|
|
|
|
|
|
|
namespace MediaBrowser.Server.Implementations.Collections
|
|
|
|
|
{
|
|
|
|
|
public class CollectionsDynamicFolder : IVirtualFolderCreator
|
|
|
|
|
{
|
|
|
|
|
private readonly IApplicationPaths _appPaths;
|
2015-09-14 01:07:54 +02:00
|
|
|
|
private IFileSystem _fileSystem;
|
2014-03-07 16:53:23 +01:00
|
|
|
|
|
2015-09-14 01:07:54 +02:00
|
|
|
|
public CollectionsDynamicFolder(IApplicationPaths appPaths, IFileSystem fileSystem)
|
2014-03-07 16:53:23 +01:00
|
|
|
|
{
|
|
|
|
|
_appPaths = appPaths;
|
2015-09-14 01:07:54 +02:00
|
|
|
|
_fileSystem = fileSystem;
|
2014-03-07 16:53:23 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public BasePluginFolder GetFolder()
|
|
|
|
|
{
|
|
|
|
|
var path = Path.Combine(_appPaths.DataPath, "collections");
|
|
|
|
|
|
2015-09-13 23:32:02 +02:00
|
|
|
|
_fileSystem.CreateDirectory(path);
|
2014-03-07 16:53:23 +01:00
|
|
|
|
|
|
|
|
|
return new ManualCollectionsFolder
|
|
|
|
|
{
|
|
|
|
|
Path = path
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|