Compare commits

...

3 Commits

Author SHA1 Message Date
1024721e0e 🐛 Fix realtime call somethings account missing profile 2025-05-31 02:52:19 +08:00
ed2e9571ab 🐛 Fix the cloud file deletion 2025-05-31 02:48:36 +08:00
6670c69fda 🐛 Add priority to chat notification 2025-05-31 02:46:35 +08:00
4 changed files with 7 additions and 7 deletions

View File

@@ -1,4 +1,3 @@
using DysonNetwork.Sphere.Account;
using DysonNetwork.Sphere.Storage; using DysonNetwork.Sphere.Storage;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using NodaTime; using NodaTime;
@@ -41,6 +40,8 @@ public class ChatRoomService(AppDatabase db, ICacheService cache)
if (member is not null) return member; if (member is not null) return member;
member = await db.ChatMembers member = await db.ChatMembers
.Include(m => m.Account)
.ThenInclude(m => m.Profile)
.Where(m => m.AccountId == accountId && m.ChatRoomId == chatRoomId) .Where(m => m.AccountId == accountId && m.ChatRoomId == chatRoomId)
.FirstOrDefaultAsync(); .FirstOrDefaultAsync();

View File

@@ -84,7 +84,8 @@ public class ChatService(
["images"] = message.Attachments ["images"] = message.Attachments
.Where(a => a.MimeType != null && a.MimeType.StartsWith("image")) .Where(a => a.MimeType != null && a.MimeType.StartsWith("image"))
.Select(a => a.Id).ToList() .Select(a => a.Id).ToList()
} },
Priority = 10,
}; };
List<Account.Account> accountsToNotify = []; List<Account.Account> accountsToNotify = [];

View File

@@ -105,7 +105,7 @@ public class RealtimeCallController(
if (realtime is LivekitRealtimeService livekitService) if (realtime is LivekitRealtimeService livekitService)
{ {
var roomParticipants = await livekitService.GetRoomParticipantsAsync(ongoingCall.SessionId); var roomParticipants = await livekitService.GetRoomParticipantsAsync(ongoingCall.SessionId);
participants = new List<CallParticipant>(); participants = [];
foreach (var p in roomParticipants) foreach (var p in roomParticipants)
{ {

View File

@@ -541,7 +541,7 @@ public class CloudFileUnusedRecyclingJob(AppDatabase db, FileService fs, ILogger
var files = await db.Files var files = await db.Files
.Where(f => .Where(f =>
(f.ExpiredAt == null && f.UsedCount == 0 && f.CreatedAt < cutoff) || (f.ExpiredAt == null && f.UsedCount == 0 && f.CreatedAt < cutoff) ||
(f.ExpiredAt != null && f.ExpiredAt >= now) (f.ExpiredAt != null && now >= f.ExpiredAt)
) )
.ToListAsync(); .ToListAsync();
@@ -573,10 +573,8 @@ public class CloudFileUnusedRecyclingJob(AppDatabase db, FileService fs, ILogger
.ToDictionary(grouping => grouping.Key!, grouping => grouping.ToList()); .ToDictionary(grouping => grouping.Key!, grouping => grouping.ToList());
// Delete files by remote storage // 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 try
{ {
var dest = fs.GetRemoteStorageConfig(group.Key); var dest = fs.GetRemoteStorageConfig(group.Key);