jellyfin-server/MediaBrowser.Server.Implementations/Collections/CollectionsDynamicFolder.cs

33 lines
849 B
C#
Raw Normal View History

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