Dont load recordings for streams by default
This commit is contained in:
@ -78,5 +78,11 @@ public interface IStreamManager
|
||||
/// Republish stream event
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public Task UpdateEvent();
|
||||
Task UpdateEvent();
|
||||
|
||||
/// <summary>
|
||||
/// Return a list of recordings segments
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
Task<List<UserStreamRecording>> GetRecordings();
|
||||
}
|
@ -149,12 +149,19 @@ public class NostrStreamManager : IStreamManager
|
||||
|
||||
await _context.Db.SaveChangesAsync();
|
||||
}
|
||||
|
||||
|
||||
public async Task UpdateEvent()
|
||||
{
|
||||
await UpdateStreamState(_context.UserStream.State);
|
||||
}
|
||||
|
||||
public async Task<List<UserStreamRecording>> GetRecordings()
|
||||
{
|
||||
return await _context.Db.Recordings.AsNoTracking()
|
||||
.Where(a => a.UserStreamId == _context.UserStream.Id)
|
||||
.ToListAsync();
|
||||
}
|
||||
|
||||
public async Task UpdateViewers()
|
||||
{
|
||||
if (_context.UserStream.State is not UserStreamState.Live) return;
|
||||
|
@ -89,7 +89,6 @@ public class StreamManagerFactory
|
||||
.AsNoTracking()
|
||||
.Include(a => a.User)
|
||||
.Include(a => a.Endpoint)
|
||||
.Include(a => a.Recordings)
|
||||
.FirstOrDefaultAsync(a => a.Id == id);
|
||||
|
||||
if (stream == default) throw new Exception("No live stream");
|
||||
@ -110,7 +109,6 @@ public class StreamManagerFactory
|
||||
.AsNoTracking()
|
||||
.Include(a => a.User)
|
||||
.Include(a => a.Endpoint)
|
||||
.Include(a => a.Recordings)
|
||||
.FirstOrDefaultAsync(a => a.PubKey.Equals(pubkey) && a.State == UserStreamState.Live);
|
||||
|
||||
if (stream == default) throw new Exception("No live stream");
|
||||
@ -131,7 +129,6 @@ public class StreamManagerFactory
|
||||
.AsNoTracking()
|
||||
.Include(a => a.User)
|
||||
.Include(a => a.Endpoint)
|
||||
.Include(a => a.Recordings)
|
||||
.OrderByDescending(a => a.Starts)
|
||||
.FirstOrDefaultAsync(a =>
|
||||
a.User.StreamKey.Equals(info.StreamKey) &&
|
||||
|
Reference in New Issue
Block a user