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 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();
|
||||||
|
|
||||||
|
|||||||
@@ -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 = [];
|
||||||
|
|||||||
@@ -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)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -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);
|
||||||
|
|||||||
Reference in New Issue
Block a user