From 99efab6013e64b68593f898d0f0188139f6c0549 Mon Sep 17 00:00:00 2001 From: Kieran Date: Mon, 31 Jul 2023 14:06:45 +0100 Subject: [PATCH] Store segments in subfolder --- NostrStreamer/Services/Dvr/S3DvrStore.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/NostrStreamer/Services/Dvr/S3DvrStore.cs b/NostrStreamer/Services/Dvr/S3DvrStore.cs index ea9c88f..e94f859 100644 --- a/NostrStreamer/Services/Dvr/S3DvrStore.cs +++ b/NostrStreamer/Services/Dvr/S3DvrStore.cs @@ -2,6 +2,7 @@ using System.Diagnostics; using Amazon.S3; using Amazon.S3.Model; using FFMpegCore; +using NostrStreamer.Database; namespace NostrStreamer.Services.Dvr; @@ -20,7 +21,7 @@ public class S3DvrStore : IDvrStore _client = config.DvrStore.CreateClient(); } - public async Task UploadRecording(Uri source) + public async Task UploadRecording(UserStream stream, Uri source) { var sw = Stopwatch.StartNew(); @@ -54,7 +55,7 @@ public class S3DvrStore : IDvrStore sw.Restart(); var ext = Path.GetExtension(source.AbsolutePath); - var key = $"{recordingId}{ext}"; + var key = $"{stream.Id}/{recordingId}{ext}"; await _client.PutObjectAsync(new PutObjectRequest { BucketName = _config.BucketName,