コード例 #1
0
ファイル: FolderScanner.cs プロジェクト: DNIDNL/hadouken
        private void AddFile(IFile file)
        {
            using (var stream = file.OpenRead())
            using (var ms = new MemoryStream())
            {
                stream.CopyTo(ms);
                _messageBus.Publish(new AddTorrentMessage(ms.ToArray()));
            }

            // Add file to history
            var hist = new History {Path = file.Path.FullPath};
            _autoAddRepository.CreateHistory(hist);
        }
コード例 #2
0
ファイル: AutoAddRepository.cs プロジェクト: DNIDNL/hadouken
 public void CreateHistory(History history)
 {
     var query = @"insert into AutoAdd_History (Path, AddedTime) values (@Path, @AddedTime); select last_insert_rowid();";
     history.Id = _connection.Query<int>(query, history).First();
 }