public async Task Save() { if (Dirty) { using (StreamWriter writer = new StreamWriter(ListingFilename)) { writer.Write(JsonConvert.SerializeObject(this, Formatting.Indented)); } string hashFilename = await IpfsApiWrapper.AddAsync(ListingFilename); await IpfsApiWrapper.PublishAsync(hashFilename); Dirty = false; } }
private async Task AddFileNotAlreadyExisting(string filename, object lockObject) { string hashFilename = await IpfsApiWrapper.AddAsync(filename); IpfsFile file = new IpfsFile { LocalFilename = filename, RemoteFilename = hashFilename }; file.ComputerAndStoreHash(filename); lock (lockObject) { Dirty = true; _Files.Add(file); } }
public async Task Save() { if (Dirty) { using (StreamWriter writer = new StreamWriter(ListingFilename)) { writer.Write(JsonConvert.SerializeObject(this, Formatting.Indented)); } string hashFilename = await IpfsApiWrapper.AddAsync(ListingFilename); string filenameHashIpnsEntry = await IpfsApiWrapper.GetAdditionalInformation("salus"); await IpfsApiWrapper.PublishAsync(hashFilename, filenameHashIpnsEntry); Dirty = false; } }