CollectionsDynamicFolder.cs 849 B

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