CollectionsDynamicFolder.cs 911 B

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