fix: fix formatting, refs NOISSUE

This commit is contained in:
Simon Diesenreiter 2025-06-25 09:48:27 +02:00
parent c0bee8fd3c
commit 4b18003aa8
9 changed files with 20 additions and 19 deletions

View File

@ -3,10 +3,10 @@ using song_of_the_day;
public class LinkPreviewAttachment public class LinkPreviewAttachment
{ {
public string Url { get; set; } public required string Url { get; set; }
public string Title { get; set; } public required string Title { get; set; }
public string Description { get; set; } public required string Description { get; set; }
public string Base64Image { get; set; } public required string Base64Image { get; set; }
} }
public class SignalIntegration public class SignalIntegration

View File

@ -17,13 +17,14 @@ public class IndexModel : PageModel
[BindProperty] [BindProperty]
public List<SongSuggestion> SongSuggestions { get; set; } = new List<SongSuggestion>(); public List<SongSuggestion> SongSuggestions { get; set; } = new List<SongSuggestion>();
public async Task OnGet() public Task OnGet()
{ {
using var dci = DataContext.Instance; using var dci = DataContext.Instance;
this.SongSuggestions = dci.SongSuggestions.OrderByDescending(s => s.Date) SongSuggestions = dci.SongSuggestions.OrderByDescending(s => s.Date)
.Take(50) .Take(50)
.Include(s => s.Song) .Include(s => s.Song)
.Include(s => s.User) .Include(s => s.User)
.ToList(); .ToList();
return Task.CompletedTask;
} }
} }

View File

@ -1,6 +1,6 @@
public class SongPartialModel public class SongPartialModel
{ {
public Song InnerSong { get; set; } public required Song InnerSong { get; set; }
public string? Artist => InnerSong.Artist; public string? Artist => InnerSong.Artist;

View File

@ -40,7 +40,7 @@ public class SongSubmissionModel : PageModel
public bool IsPageReadonly { get; set; } = false; public bool IsPageReadonly { get; set; } = false;
[BindProperty] [BindProperty]
public SuggestionHelper SuggestionHelper { get; set; } = null; public SuggestionHelper? SuggestionHelper { get; set; } = null;
[BindProperty] [BindProperty]
public List<SongSuggestion> UserSongSubmissions { get; set; } = []; public List<SongSuggestion> UserSongSubmissions { get; set; } = [];

View File

@ -1,6 +1,6 @@
public class Base64UrlImageBuilder public class Base64UrlImageBuilder
{ {
public string ContentType { set; get; } public required string ContentType { set; get; }
public string Url public string Url
{ {
@ -13,7 +13,7 @@ public class Base64UrlImageBuilder
} }
} }
private string FileContents { get; set; } private required string FileContents { get; set; }
public override string ToString() public override string ToString()
{ {

View File

@ -14,9 +14,9 @@ public class YoutubeValidator : UriBasedSongValidatorBase
public override string UriValidatorRegex => @"^(https?://)?(www\.)?(youtube\.com/watch\?v=|youtu\.be/)([a-zA-Z0-9_-]{11})"; public override string UriValidatorRegex => @"^(https?://)?(www\.)?(youtube\.com/watch\?v=|youtu\.be/)([a-zA-Z0-9_-]{11})";
public override async Task<bool> CanExtractSongMetadataAsync(Uri songUri) public override Task<bool> CanExtractSongMetadataAsync(Uri songUri)
{ {
return this.CanValidateUri(songUri); return Task.FromResult(this.CanValidateUri(songUri));
} }
public override SongProvider GetSongProvider() public override SongProvider GetSongProvider()