PlaylistsDynamicFolder.cs 879 B

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