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