Record segments when capable
This commit is contained in:
@ -118,16 +118,19 @@ public class NostrStreamManager : IStreamManager
|
|||||||
{
|
{
|
||||||
//var matches = new Regex("\\.(\\d+)\\.[\\w]{2,4}$").Match(segment.AbsolutePath);
|
//var matches = new Regex("\\.(\\d+)\\.[\\w]{2,4}$").Match(segment.AbsolutePath);
|
||||||
|
|
||||||
var result = await _dvrStore.UploadRecording(_context.UserStream, segment);
|
if (_context.UserStream.Endpoint.Capabilities.Contains("dvr:source"))
|
||||||
_context.Db.Recordings.Add(new()
|
|
||||||
{
|
{
|
||||||
UserStreamId = _context.UserStream.Id,
|
var result = await _dvrStore.UploadRecording(_context.UserStream, segment);
|
||||||
Url = result.Result.ToString(),
|
_context.Db.Recordings.Add(new()
|
||||||
Duration = result.Duration,
|
{
|
||||||
Timestamp = DateTime.UtcNow //DateTimeOffset.FromUnixTimeMilliseconds(long.Parse(matches.Groups[1].Value)).UtcDateTime
|
UserStreamId = _context.UserStream.Id,
|
||||||
});
|
Url = result.Result.ToString(),
|
||||||
|
Duration = result.Duration,
|
||||||
|
Timestamp = DateTime.UtcNow //DateTimeOffset.FromUnixTimeMilliseconds(long.Parse(matches.Groups[1].Value)).UtcDateTime
|
||||||
|
});
|
||||||
|
|
||||||
await _context.Db.SaveChangesAsync();
|
await _context.Db.SaveChangesAsync();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task UpdateEvent()
|
public async Task UpdateEvent()
|
||||||
|
Reference in New Issue
Block a user