CollectionsDynamicFolder.cs 940 B

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