From ee929c6dfc3edacc926c05e2788ab0b6edb2c9ee Mon Sep 17 00:00:00 2001 From: Master Kwoth Date: Sun, 12 Nov 2017 07:57:01 +0100 Subject: [PATCH] .novel fixed, close #1819 --- NadekoBot.Core/Modules/Searches/AnimeSearchCommands.cs | 4 ++-- .../Modules/Searches/Services/AnimeSearchService.cs | 2 ++ NadekoBot.Core/Modules/Searches/Services/SearchesService.cs | 1 - src/NadekoBot/_strings/ResponseStrings.en-US.json | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/NadekoBot.Core/Modules/Searches/AnimeSearchCommands.cs b/NadekoBot.Core/Modules/Searches/AnimeSearchCommands.cs index fb1b0bd0..0fe17431 100644 --- a/NadekoBot.Core/Modules/Searches/AnimeSearchCommands.cs +++ b/NadekoBot.Core/Modules/Searches/AnimeSearchCommands.cs @@ -26,7 +26,7 @@ namespace NadekoBot.Modules.Searches if (novelData == null) { - await ReplyErrorLocalized("error_finding_novel").ConfigureAwait(false); + await ReplyErrorLocalized("failed_finding_novel").ConfigureAwait(false); return; } @@ -35,7 +35,7 @@ namespace NadekoBot.Modules.Searches .WithTitle(novelData.Title) .WithUrl(novelData.Link) .WithImageUrl(novelData.ImageUrl) - .AddField(efb => efb.WithName(GetText("authors")).WithValue(String.Join("\n", novelData.Authors)).WithIsInline(true)) + .AddField(efb => efb.WithName(GetText("authors")).WithValue(string.Join("\n", novelData.Authors)).WithIsInline(true)) .AddField(efb => efb.WithName(GetText("status")).WithValue(novelData.Status).WithIsInline(true)) .AddField(efb => efb.WithName(GetText("genres")).WithValue(string.Join(" ", novelData.Genres.Any() ? novelData.Genres : new[] { "none" })).WithIsInline(true)) .WithFooter(efb => efb.WithText(GetText("score") + " " + novelData.Score)); diff --git a/NadekoBot.Core/Modules/Searches/Services/AnimeSearchService.cs b/NadekoBot.Core/Modules/Searches/Services/AnimeSearchService.cs index e236fa51..daa5492c 100644 --- a/NadekoBot.Core/Modules/Searches/Services/AnimeSearchService.cs +++ b/NadekoBot.Core/Modules/Searches/Services/AnimeSearchService.cs @@ -67,6 +67,8 @@ namespace NadekoBot.Modules.Searches.Services var document = await BrowsingContext.New(config).OpenAsync(link); var imageElem = document.QuerySelector("div.seriesimg > img"); + if (imageElem == null) + return null; var imageUrl = ((IHtmlImageElement)imageElem).Source; var descElem = document.QuerySelector("div#editdescription > p"); diff --git a/NadekoBot.Core/Modules/Searches/Services/SearchesService.cs b/NadekoBot.Core/Modules/Searches/Services/SearchesService.cs index 098364d9..8656a038 100644 --- a/NadekoBot.Core/Modules/Searches/Services/SearchesService.cs +++ b/NadekoBot.Core/Modules/Searches/Services/SearchesService.cs @@ -51,7 +51,6 @@ namespace NadekoBot.Modules.Searches.Services public ConcurrentDictionary AutoButtTimers { get; } = new ConcurrentDictionary(); private readonly ConcurrentDictionary> _blacklistedTags = new ConcurrentDictionary>(); - private readonly Timer _t; private readonly SemaphoreSlim _cryptoLock = new SemaphoreSlim(1, 1); public async Task CryptoData() diff --git a/src/NadekoBot/_strings/ResponseStrings.en-US.json b/src/NadekoBot/_strings/ResponseStrings.en-US.json index 12b5ba93..dfabc637 100644 --- a/src/NadekoBot/_strings/ResponseStrings.en-US.json +++ b/src/NadekoBot/_strings/ResponseStrings.en-US.json @@ -923,5 +923,5 @@ "administration_invalid": "Invalid / Can't be found ({0})", "administration_mass_kill_in_progress": "Mass Banning and Blacklisting of {0} users is in progress...", "administration_mass_kill_completed": "Mass Banning and Blacklisting of {0} users is complete.", - "searches_error_finding_novel": "Can't find that novel. Make sure you've typed the exact full name, and that it exists on novelupdates.com" + "searches_failed_finding_novel": "Can't find that novel. Make sure you've typed the exact full name, and that it exists on novelupdates.com" } \ No newline at end of file