🚨 Fix complier warnings
This commit is contained in:
@@ -9,10 +9,10 @@ public class AppDatabase(
|
|||||||
IConfiguration configuration
|
IConfiguration configuration
|
||||||
) : DbContext(options)
|
) : DbContext(options)
|
||||||
{
|
{
|
||||||
public DbSet<Developer> Developers { get; set; }
|
public DbSet<Developer> Developers { get; set; } = null!;
|
||||||
|
|
||||||
public DbSet<CustomApp> CustomApps { get; set; }
|
public DbSet<CustomApp> CustomApps { get; set; } = null!;
|
||||||
public DbSet<CustomAppSecret> CustomAppSecrets { get; set; }
|
public DbSet<CustomAppSecret> CustomAppSecrets { get; set; } = null!;
|
||||||
|
|
||||||
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
|
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
|
||||||
{
|
{
|
||||||
|
@@ -8,9 +8,6 @@ using Google.Protobuf.WellKnownTypes;
|
|||||||
using NodaTime.Serialization.Protobuf;
|
using NodaTime.Serialization.Protobuf;
|
||||||
using NodaTime;
|
using NodaTime;
|
||||||
|
|
||||||
using DysonNetwork.Shared.Proto;
|
|
||||||
using Google.Protobuf.WellKnownTypes;
|
|
||||||
using NodaTime.Serialization.Protobuf;
|
|
||||||
using VerificationMark = DysonNetwork.Shared.Data.VerificationMark;
|
using VerificationMark = DysonNetwork.Shared.Data.VerificationMark;
|
||||||
|
|
||||||
namespace DysonNetwork.Develop.Identity;
|
namespace DysonNetwork.Develop.Identity;
|
||||||
|
@@ -72,8 +72,8 @@ public class CloudFile : ModelBase, ICloudFile, IIdentifiedResource
|
|||||||
DeletedAt = DeletedAt,
|
DeletedAt = DeletedAt,
|
||||||
Id = Id,
|
Id = Id,
|
||||||
Name = Name,
|
Name = Name,
|
||||||
FileMeta = FileMeta,
|
FileMeta = FileMeta ?? [],
|
||||||
UserMeta = UserMeta,
|
UserMeta = UserMeta ?? [],
|
||||||
SensitiveMarks = SensitiveMarks,
|
SensitiveMarks = SensitiveMarks,
|
||||||
MimeType = MimeType,
|
MimeType = MimeType,
|
||||||
Hash = Hash,
|
Hash = Hash,
|
||||||
|
@@ -20,7 +20,6 @@ namespace DysonNetwork.Drive.Storage;
|
|||||||
public class FileService(
|
public class FileService(
|
||||||
AppDatabase db,
|
AppDatabase db,
|
||||||
IConfiguration configuration,
|
IConfiguration configuration,
|
||||||
TusDiskStore store,
|
|
||||||
ILogger<FileService> logger,
|
ILogger<FileService> logger,
|
||||||
IServiceScopeFactory scopeFactory,
|
IServiceScopeFactory scopeFactory,
|
||||||
ICacheService cache
|
ICacheService cache
|
||||||
@@ -268,12 +267,24 @@ public class FileService(
|
|||||||
// Add detailed stream information
|
// Add detailed stream information
|
||||||
["video_streams"] = mediaInfo.VideoStreams.Select(s => new
|
["video_streams"] = mediaInfo.VideoStreams.Select(s => new
|
||||||
{
|
{
|
||||||
s.AvgFrameRate, s.BitRate, s.CodecName, s.Duration, s.Height, s.Width, s.Language,
|
s.AvgFrameRate,
|
||||||
s.PixelFormat, s.Rotation
|
s.BitRate,
|
||||||
|
s.CodecName,
|
||||||
|
s.Duration,
|
||||||
|
s.Height,
|
||||||
|
s.Width,
|
||||||
|
s.Language,
|
||||||
|
s.PixelFormat,
|
||||||
|
s.Rotation
|
||||||
}).Where(s => double.IsNormal(s.AvgFrameRate)).ToList(),
|
}).Where(s => double.IsNormal(s.AvgFrameRate)).ToList(),
|
||||||
["audio_streams"] = mediaInfo.AudioStreams.Select(s => new
|
["audio_streams"] = mediaInfo.AudioStreams.Select(s => new
|
||||||
{
|
{
|
||||||
s.BitRate, s.Channels, s.ChannelLayout, s.CodecName, s.Duration, s.Language,
|
s.BitRate,
|
||||||
|
s.Channels,
|
||||||
|
s.ChannelLayout,
|
||||||
|
s.CodecName,
|
||||||
|
s.Duration,
|
||||||
|
s.Language,
|
||||||
s.SampleRateHz
|
s.SampleRateHz
|
||||||
})
|
})
|
||||||
.ToList(),
|
.ToList(),
|
||||||
|
@@ -16,7 +16,7 @@ public class AppDatabase(
|
|||||||
) : DbContext(options)
|
) : DbContext(options)
|
||||||
{
|
{
|
||||||
public DbSet<Notification.Notification> Notifications { get; set; } = null!;
|
public DbSet<Notification.Notification> Notifications { get; set; } = null!;
|
||||||
public DbSet<PushSubscription> PushSubscriptions { get; set; }
|
public DbSet<PushSubscription> PushSubscriptions { get; set; } = null!;
|
||||||
|
|
||||||
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
|
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
|
||||||
{
|
{
|
||||||
|
@@ -127,7 +127,7 @@ public class NotificationController(
|
|||||||
[Required][MaxLength(1024)] public string Title { get; set; } = null!;
|
[Required][MaxLength(1024)] public string Title { get; set; } = null!;
|
||||||
[MaxLength(2048)] public string? Subtitle { get; set; }
|
[MaxLength(2048)] public string? Subtitle { get; set; }
|
||||||
[Required][MaxLength(4096)] public string Content { get; set; } = null!;
|
[Required][MaxLength(4096)] public string Content { get; set; } = null!;
|
||||||
public Dictionary<string, object>? Meta { get; set; }
|
public Dictionary<string, object?>? Meta { get; set; }
|
||||||
public int Priority { get; set; } = 10;
|
public int Priority { get; set; } = 10;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -153,7 +153,7 @@ public class NotificationController(
|
|||||||
Title = request.Title,
|
Title = request.Title,
|
||||||
Subtitle = request.Subtitle,
|
Subtitle = request.Subtitle,
|
||||||
Content = request.Content,
|
Content = request.Content,
|
||||||
Meta = request.Meta,
|
Meta = request.Meta ?? [],
|
||||||
},
|
},
|
||||||
request.AccountId,
|
request.AccountId,
|
||||||
save
|
save
|
||||||
|
@@ -24,37 +24,37 @@ public class AppDatabase(
|
|||||||
IConfiguration configuration
|
IConfiguration configuration
|
||||||
) : DbContext(options)
|
) : DbContext(options)
|
||||||
{
|
{
|
||||||
public DbSet<Publisher.Publisher> Publishers { get; set; }
|
public DbSet<Publisher.Publisher> Publishers { get; set; } = null!;
|
||||||
public DbSet<PublisherMember> PublisherMembers { get; set; }
|
public DbSet<PublisherMember> PublisherMembers { get; set; } = null!;
|
||||||
public DbSet<PublisherSubscription> PublisherSubscriptions { get; set; }
|
public DbSet<PublisherSubscription> PublisherSubscriptions { get; set; } = null!;
|
||||||
public DbSet<PublisherFeature> PublisherFeatures { get; set; }
|
public DbSet<PublisherFeature> PublisherFeatures { get; set; } = null!;
|
||||||
|
|
||||||
public DbSet<Post.Post> Posts { get; set; }
|
public DbSet<Post.Post> Posts { get; set; } = null!;
|
||||||
public DbSet<PostReaction> PostReactions { get; set; }
|
public DbSet<PostReaction> PostReactions { get; set; } = null!;
|
||||||
public DbSet<PostTag> PostTags { get; set; }
|
public DbSet<PostTag> PostTags { get; set; } = null!;
|
||||||
public DbSet<PostCategory> PostCategories { get; set; }
|
public DbSet<PostCategory> PostCategories { get; set; } = null!;
|
||||||
public DbSet<PostCollection> PostCollections { get; set; }
|
public DbSet<PostCollection> PostCollections { get; set; } = null!;
|
||||||
public DbSet<PostFeaturedRecord> PostFeaturedRecords { get; set; }
|
public DbSet<PostFeaturedRecord> PostFeaturedRecords { get; set; } = null!;
|
||||||
|
|
||||||
public DbSet<Poll.Poll> Polls { get; set; }
|
public DbSet<Poll.Poll> Polls { get; set; } = null!;
|
||||||
public DbSet<Poll.PollQuestion> PollQuestions { get; set; }
|
public DbSet<Poll.PollQuestion> PollQuestions { get; set; } = null!;
|
||||||
public DbSet<Poll.PollAnswer> PollAnswers { get; set; }
|
public DbSet<Poll.PollAnswer> PollAnswers { get; set; } = null!;
|
||||||
|
|
||||||
public DbSet<Realm.Realm> Realms { get; set; }
|
public DbSet<Realm.Realm> Realms { get; set; } = null!;
|
||||||
public DbSet<RealmMember> RealmMembers { get; set; }
|
public DbSet<RealmMember> RealmMembers { get; set; } = null!;
|
||||||
|
|
||||||
public DbSet<ChatRoom> ChatRooms { get; set; }
|
public DbSet<ChatRoom> ChatRooms { get; set; } = null!;
|
||||||
public DbSet<ChatMember> ChatMembers { get; set; }
|
public DbSet<ChatMember> ChatMembers { get; set; } = null!;
|
||||||
public DbSet<Message> ChatMessages { get; set; }
|
public DbSet<Message> ChatMessages { get; set; } = null!;
|
||||||
public DbSet<RealtimeCall> ChatRealtimeCall { get; set; }
|
public DbSet<RealtimeCall> ChatRealtimeCall { get; set; } = null!;
|
||||||
public DbSet<MessageReaction> ChatReactions { get; set; }
|
public DbSet<MessageReaction> ChatReactions { get; set; } = null!;
|
||||||
|
|
||||||
public DbSet<Sticker.Sticker> Stickers { get; set; }
|
public DbSet<Sticker.Sticker> Stickers { get; set; } = null!;
|
||||||
public DbSet<StickerPack> StickerPacks { get; set; }
|
public DbSet<StickerPack> StickerPacks { get; set; } = null!;
|
||||||
public DbSet<StickerPackOwnership> StickerPackOwnerships { get; set; }
|
public DbSet<StickerPackOwnership> StickerPackOwnerships { get; set; } = null!;
|
||||||
|
|
||||||
public DbSet<WebReader.WebArticle> WebArticles { get; set; }
|
public DbSet<WebReader.WebArticle> WebArticles { get; set; } = null!;
|
||||||
public DbSet<WebReader.WebFeed> WebFeeds { get; set; }
|
public DbSet<WebReader.WebFeed> WebFeeds { get; set; } = null!;
|
||||||
|
|
||||||
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
|
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
|
||||||
{
|
{
|
||||||
|
@@ -127,7 +127,7 @@ public class ChatMemberTransmissionObject : ModelBase
|
|||||||
Id = member.Id,
|
Id = member.Id,
|
||||||
ChatRoomId = member.ChatRoomId,
|
ChatRoomId = member.ChatRoomId,
|
||||||
AccountId = member.AccountId,
|
AccountId = member.AccountId,
|
||||||
Account = member.Account,
|
Account = member.Account!,
|
||||||
Nick = member.Nick,
|
Nick = member.Nick,
|
||||||
Role = member.Role,
|
Role = member.Role,
|
||||||
Notify = member.Notify,
|
Notify = member.Notify,
|
||||||
|
@@ -970,7 +970,7 @@ public class ChatRoomController(
|
|||||||
? localizer["ChatInviteDirectBody", sender.Nick]
|
? localizer["ChatInviteDirectBody", sender.Nick]
|
||||||
: localizer["ChatInviteBody", member.ChatRoom.Name ?? "Unnamed"];
|
: localizer["ChatInviteBody", member.ChatRoom.Name ?? "Unnamed"];
|
||||||
|
|
||||||
CultureService.SetCultureInfo(member.Account.Language);
|
CultureService.SetCultureInfo(member.Account!.Language);
|
||||||
await pusher.SendPushNotificationToUserAsync(
|
await pusher.SendPushNotificationToUserAsync(
|
||||||
new SendPushNotificationToUserRequest
|
new SendPushNotificationToUserRequest
|
||||||
{
|
{
|
||||||
|
@@ -383,7 +383,7 @@ public partial class ChatService(
|
|||||||
|
|
||||||
// Get keys of messages to remove (where sender is not found)
|
// Get keys of messages to remove (where sender is not found)
|
||||||
var messagesToRemove = messages
|
var messagesToRemove = messages
|
||||||
.Where(m => messageSenders.All(s => s.Id != m.Value.SenderId))
|
.Where(m => messageSenders.All(s => s.Id != m.Value!.SenderId))
|
||||||
.Select(m => m.Key)
|
.Select(m => m.Key)
|
||||||
.ToList();
|
.ToList();
|
||||||
|
|
||||||
|
@@ -2,7 +2,6 @@ using System.Net;
|
|||||||
using DysonNetwork.Shared.PageData;
|
using DysonNetwork.Shared.PageData;
|
||||||
using DysonNetwork.Shared.Proto;
|
using DysonNetwork.Shared.Proto;
|
||||||
using DysonNetwork.Sphere.Post;
|
using DysonNetwork.Sphere.Post;
|
||||||
using DysonNetwork.Sphere.Publisher;
|
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
using OpenGraphNet;
|
using OpenGraphNet;
|
||||||
|
|
||||||
|
@@ -216,9 +216,10 @@ public class PostController(
|
|||||||
if (useVector)
|
if (useVector)
|
||||||
queryable = queryable.Where(p => p.SearchVector.Matches(EF.Functions.ToTsQuery(query)));
|
queryable = queryable.Where(p => p.SearchVector.Matches(EF.Functions.ToTsQuery(query)));
|
||||||
else
|
else
|
||||||
queryable = queryable.Where(p => EF.Functions.ILike(p.Title, $"%{query}%") ||
|
queryable = queryable.Where(p =>
|
||||||
EF.Functions.ILike(p.Description, $"%{query}%") ||
|
(p.Title != null && EF.Functions.ILike(p.Title, $"%{query}%")) ||
|
||||||
EF.Functions.ILike(p.Content, $"%{query}%")
|
(p.Description != null && EF.Functions.ILike(p.Description, $"%{query}%")) ||
|
||||||
|
(p.Content != null && EF.Functions.ILike(p.Content, $"%{query}%"))
|
||||||
);
|
);
|
||||||
|
|
||||||
var totalCount = await queryable.CountAsync();
|
var totalCount = await queryable.CountAsync();
|
||||||
|
Reference in New Issue
Block a user