Compare commits
3 Commits
a0cd779f85
...
1024721e0e
| Author | SHA1 | Date | |
|---|---|---|---|
| 1024721e0e | |||
| ed2e9571ab | |||
| 6670c69fda |
@@ -1,4 +1,3 @@
|
||||
using DysonNetwork.Sphere.Account;
|
||||
using DysonNetwork.Sphere.Storage;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using NodaTime;
|
||||
@@ -41,6 +40,8 @@ public class ChatRoomService(AppDatabase db, ICacheService cache)
|
||||
if (member is not null) return member;
|
||||
|
||||
member = await db.ChatMembers
|
||||
.Include(m => m.Account)
|
||||
.ThenInclude(m => m.Profile)
|
||||
.Where(m => m.AccountId == accountId && m.ChatRoomId == chatRoomId)
|
||||
.FirstOrDefaultAsync();
|
||||
|
||||
|
||||
@@ -84,7 +84,8 @@ public class ChatService(
|
||||
["images"] = message.Attachments
|
||||
.Where(a => a.MimeType != null && a.MimeType.StartsWith("image"))
|
||||
.Select(a => a.Id).ToList()
|
||||
}
|
||||
},
|
||||
Priority = 10,
|
||||
};
|
||||
|
||||
List<Account.Account> accountsToNotify = [];
|
||||
|
||||
@@ -105,7 +105,7 @@ public class RealtimeCallController(
|
||||
if (realtime is LivekitRealtimeService livekitService)
|
||||
{
|
||||
var roomParticipants = await livekitService.GetRoomParticipantsAsync(ongoingCall.SessionId);
|
||||
participants = new List<CallParticipant>();
|
||||
participants = [];
|
||||
|
||||
foreach (var p in roomParticipants)
|
||||
{
|
||||
|
||||
@@ -541,7 +541,7 @@ public class CloudFileUnusedRecyclingJob(AppDatabase db, FileService fs, ILogger
|
||||
var files = await db.Files
|
||||
.Where(f =>
|
||||
(f.ExpiredAt == null && f.UsedCount == 0 && f.CreatedAt < cutoff) ||
|
||||
(f.ExpiredAt != null && f.ExpiredAt >= now)
|
||||
(f.ExpiredAt != null && now >= f.ExpiredAt)
|
||||
)
|
||||
.ToListAsync();
|
||||
|
||||
@@ -573,10 +573,8 @@ public class CloudFileUnusedRecyclingJob(AppDatabase db, FileService fs, ILogger
|
||||
.ToDictionary(grouping => grouping.Key!, grouping => grouping.ToList());
|
||||
|
||||
// Delete files by remote storage
|
||||
foreach (var group in filesToDelete)
|
||||
foreach (var group in filesToDelete.Where(group => !string.IsNullOrEmpty(group.Key)))
|
||||
{
|
||||
if (string.IsNullOrEmpty(group.Key)) continue;
|
||||
|
||||
try
|
||||
{
|
||||
var dest = fs.GetRemoteStorageConfig(group.Key);
|
||||
|
||||
Reference in New Issue
Block a user