CollectionsDynamicFolder.cs 828 B

12345678910111213141516171819202122232425262728293031
  1. using MediaBrowser.Common.Configuration;
  2. using MediaBrowser.Controller.Entities;
  3. using System.IO;
  4. using CommonIO;
  5. namespace MediaBrowser.Server.Implementations.Collections
  6. {
  7. public class CollectionsDynamicFolder : IVirtualFolderCreator
  8. {
  9. private readonly IApplicationPaths _appPaths;
  10. private readonly IFileSystem _fileSystem;
  11. public CollectionsDynamicFolder(IApplicationPaths appPaths, IFileSystem fileSystem)
  12. {
  13. _appPaths = appPaths;
  14. _fileSystem = fileSystem;
  15. }
  16. public BasePluginFolder GetFolder()
  17. {
  18. var path = Path.Combine(_appPaths.DataPath, "collections");
  19. _fileSystem.CreateDirectory(path);
  20. return new ManualCollectionsFolder
  21. {
  22. Path = path
  23. };
  24. }
  25. }
  26. }