mirror of
https://github.com/Tyrrrz/DiscordChatExporter.git
synced 2026-02-14 07:43:31 -07:00
Simplify null checking for canonical URLs in JSON export
Co-authored-by: Tyrrrz <1935960+Tyrrrz@users.noreply.github.com>
This commit is contained in:
parent
5a12e42f45
commit
197c9f39e3
|
|
@ -139,11 +139,8 @@ internal class JsonMessageWriter(Stream stream, ExportContext context)
|
|||
)
|
||||
);
|
||||
|
||||
// Include canonical URL if a proxy URL is being used
|
||||
if (
|
||||
!string.IsNullOrWhiteSpace(embedAuthor.IconProxyUrl)
|
||||
&& !string.IsNullOrWhiteSpace(embedAuthor.IconUrl)
|
||||
)
|
||||
// Include canonical URL if present
|
||||
if (!string.IsNullOrWhiteSpace(embedAuthor.IconUrl))
|
||||
{
|
||||
_writer.WriteString("iconCanonicalUrl", embedAuthor.IconUrl);
|
||||
}
|
||||
|
|
@ -170,11 +167,8 @@ internal class JsonMessageWriter(Stream stream, ExportContext context)
|
|||
)
|
||||
);
|
||||
|
||||
// Include canonical URL if a proxy URL is being used
|
||||
if (
|
||||
!string.IsNullOrWhiteSpace(embedImage.ProxyUrl)
|
||||
&& !string.IsNullOrWhiteSpace(embedImage.Url)
|
||||
)
|
||||
// Include canonical URL if present
|
||||
if (!string.IsNullOrWhiteSpace(embedImage.Url))
|
||||
{
|
||||
_writer.WriteString("canonicalUrl", embedImage.Url);
|
||||
}
|
||||
|
|
@ -204,11 +198,8 @@ internal class JsonMessageWriter(Stream stream, ExportContext context)
|
|||
)
|
||||
);
|
||||
|
||||
// Include canonical URL if a proxy URL is being used
|
||||
if (
|
||||
!string.IsNullOrWhiteSpace(embedVideo.ProxyUrl)
|
||||
&& !string.IsNullOrWhiteSpace(embedVideo.Url)
|
||||
)
|
||||
// Include canonical URL if present
|
||||
if (!string.IsNullOrWhiteSpace(embedVideo.Url))
|
||||
{
|
||||
_writer.WriteString("canonicalUrl", embedVideo.Url);
|
||||
}
|
||||
|
|
@ -240,11 +231,8 @@ internal class JsonMessageWriter(Stream stream, ExportContext context)
|
|||
)
|
||||
);
|
||||
|
||||
// Include canonical URL if a proxy URL is being used
|
||||
if (
|
||||
!string.IsNullOrWhiteSpace(embedFooter.IconProxyUrl)
|
||||
&& !string.IsNullOrWhiteSpace(embedFooter.IconUrl)
|
||||
)
|
||||
// Include canonical URL if present
|
||||
if (!string.IsNullOrWhiteSpace(embedFooter.IconUrl))
|
||||
{
|
||||
_writer.WriteString("iconCanonicalUrl", embedFooter.IconUrl);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue