Skip to content

Commit

Permalink
Fix: Revert IDE suggested changes
Browse files Browse the repository at this point in the history
  • Loading branch information
fearnlj01 committed Nov 12, 2023
1 parent 5bca290 commit bcac83e
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 10 deletions.
11 changes: 5 additions & 6 deletions Helpers/DiscordHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public async Task PatchWebhook(IVideoFile file, IAnime anime, IEpisode episode,
{
try
{
MultipartFormDataContent form = [];
MultipartFormDataContent form = new();

Webhook webhook = GetMatchedWebhook(file, anime, episode);
string json = JsonSerializer.Serialize(webhook, _options);
Expand Down Expand Up @@ -161,13 +161,13 @@ private Webhook GetMatchedWebhook(IVideoFile file, IAnime anime, IEpisode episod
private static List<WebhookField> GetUnmatchedFields(string dumpResult, AniDBSearchResult searchResult)
{
List<WebhookField> output =
[
new() {
new WebhookField()
{
Name = "ED2K",
Value = $"{dumpResult}"
}
];
};

foreach (AniDBSeries result in searchResult.List)
{
Expand All @@ -187,8 +187,7 @@ private static List<WebhookField> GetMatchedFields(IAnime series, IEpisode episo
AnimeTitle episodeTitle = episode.Titles.FirstOrDefault(t => t.Language == TitleLanguage.English);
string episodeNumber = episode.Number.ToString("00", CultureInfo.InvariantCulture);

return
[
return new() {
new WebhookField()
{
Name = "Anime",
Expand All @@ -201,7 +200,7 @@ private static List<WebhookField> GetMatchedFields(IAnime series, IEpisode episo
Value = $"{episodeNumber} - [{episodeTitle.Title}](https://anidb.net/episode/{episode.EpisodeID})",
Inline = true
},
];
};
}

private static WebhookFooter GetFooter(IVideoFile file)
Expand Down
2 changes: 1 addition & 1 deletion Helpers/FileTracker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public class FileTracker

public FileTracker()
{
_fileSet = [];
_fileSet = new();
}

public bool TryAddFile(IVideoFile fileInfo)
Expand Down
4 changes: 2 additions & 2 deletions Helpers/MessageTracker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ public MessageTracker(ISettingsProvider settingsProvider, IDiscordHelper discord
_discordHelper = discordHelper;
_shokoHelper = shokoHelper;

_messageSet = [];
_processedSet = [];
_messageSet = new();
_processedSet = new();

if (_settings.Shoko.AutomaticMatch.WatchReactions)
{
Expand Down
2 changes: 1 addition & 1 deletion Settings/SettingsProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ private CustomSettings GetSettingsFromFile()

private static void ValidateSettings(ISettings settings)
{
List<ValidationResult> validationResults = [];
List<ValidationResult> validationResults = new();
ValidationContext validationContext = new(settings);

bool isValid = Validator.TryValidateObject(
Expand Down

0 comments on commit bcac83e

Please sign in to comment.