private Task <Validation <BaseError, Unit> > FolderMustBeEmpty(StartFFmpegSession request)
    {
        string folder = Path.Combine(FileSystemLayout.TranscodeFolder, request.ChannelNumber);

        _logger.LogDebug("Preparing transcode folder {Folder}", folder);

        _localFileSystem.EnsureFolderExists(folder);
        _localFileSystem.EmptyFolder(folder);

        return(Task.FromResult <Validation <BaseError, Unit> >(Unit.Default));
    }
Esempio n. 2
0
    public Task <bool> Initialize(ILocalFileSystem localFileSystem)
    {
        if (!_initialized)
        {
            localFileSystem.EnsureFolderExists(FileSystemLayout.SearchIndexFolder);

            _directory = FSDirectory.Open(FileSystemLayout.SearchIndexFolder);
            var analyzer    = new StandardAnalyzer(AppLuceneVersion);
            var indexConfig = new IndexWriterConfig(AppLuceneVersion, analyzer)
            {
                OpenMode = OpenMode.CREATE_OR_APPEND
            };
            _writer      = new IndexWriter(_directory, indexConfig);
            _initialized = true;
        }

        return(Task.FromResult(_initialized));
    }
Esempio n. 3
0
 public Task <bool> Initialize()
 {
     _localFileSystem.EnsureFolderExists(FileSystemLayout.SearchIndexFolder);
     return(Task.FromResult(true));
 }