mirror of
https://github.com/Tyrrrz/DiscordChatExporter.git
synced 2026-07-07 22:54:38 +02:00
Compare commits
9 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| e849c9516c | |||
| 524d0a1bb2 | |||
| f0a4410ee0 | |||
| a98772e46e | |||
| b6fdea11a2 | |||
| fcca052165 | |||
| ac7ebd6f91 | |||
| 9303383662 | |||
| 7fa908ce34 |
@@ -13,13 +13,17 @@ jobs:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2.3.3
|
||||
|
||||
- name: Get release version
|
||||
id: get-version
|
||||
uses: dawidd6/action-get-tag@v1
|
||||
|
||||
- name: Login
|
||||
run: docker login -u tyrrrz -p ${{ secrets.DOCKER_TOKEN }}
|
||||
|
||||
- name: Build
|
||||
run: docker build -t tyrrrz/discordchatexporter:${{ github.ref }} -t tyrrrz/discordchatexporter:stable .
|
||||
run: docker build -t tyrrrz/discordchatexporter:${{ steps.get-version.outputs.tag }} -t tyrrrz/discordchatexporter:stable .
|
||||
|
||||
- name: Deploy
|
||||
run: |
|
||||
docker push tyrrrz/discordchatexporter:${{ github.ref }}
|
||||
docker push tyrrrz/discordchatexporter:${{ steps.get-version.outputs.tag }}
|
||||
docker push tyrrrz/discordchatexporter:stable
|
||||
@@ -13,6 +13,10 @@ jobs:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2.3.3
|
||||
|
||||
- name: Get release version
|
||||
id: get-version
|
||||
uses: dawidd6/action-get-tag@v1
|
||||
|
||||
- name: Install .NET (v3.1)
|
||||
uses: actions/setup-dotnet@v1.7.2
|
||||
with:
|
||||
@@ -71,11 +75,15 @@ jobs:
|
||||
asset_content_type: application/zip
|
||||
|
||||
- name: Notify Discord
|
||||
run: |
|
||||
Invoke-WebRequest `
|
||||
-Uri "${{ secrets.DISCORD_WEBHOOK }}" `
|
||||
-Method "POST" `
|
||||
-ContentType "application/json; charset=UTF-8" `
|
||||
-Body '{"content":"**DiscordChatExporter** new version released!\nRef: `${{ github.ref }}`\nChangelog: <https://github.com/Tyrrrz/DiscordChatExporter/blob/${{ github.sha }}/Changelog.md>"}' `
|
||||
-UseBasicParsing
|
||||
shell: pwsh
|
||||
uses: satak/webrequest-action@v1.2.4
|
||||
with:
|
||||
url: ${{ secrets.DISCORD_WEBHOOK }}
|
||||
method: POST
|
||||
headers: |
|
||||
{
|
||||
"ContentType": "application/json; charset=UTF-8"
|
||||
}
|
||||
payload: |
|
||||
{
|
||||
"content": "**DiscordChatExporter** new version released!\nVersion: `${{ steps.get-version.outputs.tag }}`\nChangelog: <https://github.com/Tyrrrz/DiscordChatExporter/blob/${{ steps.get-version.outputs.tag }}/Changelog.md>"
|
||||
}
|
||||
@@ -1,3 +1,9 @@
|
||||
### v2.30.1 (28-Aug-2021)
|
||||
|
||||
- [HTML] Changed user avatars to render using higher resolution images. (Thanks [@Chris Helder](https://github.com/TheDude53))
|
||||
- Fixed an issue where `has:file` message filter was not recognized. (Thanks [@Lucas LaBuff](https://github.com/96-LB))
|
||||
- Fixed an issue where a unix timestamp marker with an invalid offset crashed the export process.
|
||||
|
||||
### v2.30 (08-Aug-2021)
|
||||
|
||||
- [HTML] Added special casing for Spotify track embeds to render them directly using an embedded player.
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netcoreapp3.1</TargetFramework>
|
||||
<Version>2.30</Version>
|
||||
<Version>2.30.1</Version>
|
||||
<Company>Tyrrrz</Company>
|
||||
<Copyright>Copyright (c) Alexey Golub</Copyright>
|
||||
<LangVersion>preview</LangVersion>
|
||||
|
||||
@@ -14,10 +14,10 @@
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="AngleSharp" Version="0.16.0" />
|
||||
<PackageReference Include="FluentAssertions" Version="5.10.3" />
|
||||
<PackageReference Include="FluentAssertions" Version="6.1.0" />
|
||||
<PackageReference Include="GitHubActionsTestLogger" Version="1.2.0" />
|
||||
<PackageReference Include="JsonExtensions" Version="1.1.0" />
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.10.0" />
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.11.0" />
|
||||
<PackageReference Include="coverlet.msbuild" Version="3.1.0" PrivateAssets="all" />
|
||||
<PackageReference Include="System.Reactive" Version="5.0.0" />
|
||||
<PackageReference Include="xunit" Version="2.4.1" />
|
||||
|
||||
@@ -170,7 +170,7 @@ namespace DiscordChatExporter.Cli.Tests
|
||||
// Assert
|
||||
iframeHtml.Should().NotBeNull();
|
||||
iframeHtml?.GetAttribute("src").Should()
|
||||
.StartWithEquivalent("https://open.spotify.com/embed/track/1LHZMWefF9502NPfArRfvP");
|
||||
.StartWithEquivalentOf("https://open.spotify.com/embed/track/1LHZMWefF9502NPfArRfvP");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
@@ -203,7 +203,8 @@ namespace DiscordChatExporter.Cli.Tests
|
||||
|
||||
// Assert
|
||||
iframeHtml.Should().NotBeNull();
|
||||
iframeHtml?.GetAttribute("src").Should().StartWithEquivalent("https://www.youtube.com/embed/qOWW4OlgbvE");
|
||||
iframeHtml?.GetAttribute("src").Should()
|
||||
.StartWithEquivalentOf("https://www.youtube.com/embed/qOWW4OlgbvE");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,12 +1,12 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Concurrent;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace DiscordChatExporter.Cli.Tests.Utils
|
||||
{
|
||||
internal static class GlobalCache
|
||||
{
|
||||
private static readonly Dictionary<string, object?> Dictionary = new();
|
||||
private static readonly ConcurrentDictionary<string, object?> Dictionary = new();
|
||||
|
||||
public static async Task<T> WrapAsync<T>(string key, Func<Task<T>> getAsync)
|
||||
{
|
||||
|
||||
@@ -53,7 +53,7 @@ namespace DiscordChatExporter.Core.Discord.Data
|
||||
? "gif"
|
||||
: "png";
|
||||
|
||||
return $"https://cdn.discordapp.com/avatars/{id}/{avatarHash}.{extension}?size=40";
|
||||
return $"https://cdn.discordapp.com/avatars/{id}/{avatarHash}.{extension}?size=128";
|
||||
}
|
||||
|
||||
public static User Parse(JsonElement json)
|
||||
|
||||
@@ -54,6 +54,7 @@ namespace DiscordChatExporter.Core.Exporting.Filtering.Parsing
|
||||
.IgnoreThen(Choice(
|
||||
Span.EqualToIgnoreCase("link").IgnoreThen(Parse.Return(MessageContentMatchKind.Link)),
|
||||
Span.EqualToIgnoreCase("embed").IgnoreThen(Parse.Return(MessageContentMatchKind.Embed)),
|
||||
Span.EqualToIgnoreCase("file").IgnoreThen(Parse.Return(MessageContentMatchKind.File)),
|
||||
Span.EqualToIgnoreCase("video").IgnoreThen(Parse.Return(MessageContentMatchKind.Video)),
|
||||
Span.EqualToIgnoreCase("image").IgnoreThen(Parse.Return(MessageContentMatchKind.Image)),
|
||||
Span.EqualToIgnoreCase("sound").IgnoreThen(Parse.Return(MessageContentMatchKind.Sound))
|
||||
|
||||
@@ -238,8 +238,8 @@ namespace DiscordChatExporter.Core.Markdown.Parsing
|
||||
new Regex("<t:(\\d+)(?::\\w)?>", DefaultRegexOptions),
|
||||
(_, m) =>
|
||||
{
|
||||
// We don't care about the 'R' parameter because we're not going to
|
||||
// show relative timestamps in an export anyway.
|
||||
// TODO: support formatting parameters
|
||||
// See: https://github.com/Tyrrrz/DiscordChatExporter/issues/662
|
||||
|
||||
if (!long.TryParse(m.Groups[1].Value, NumberStyles.Integer, CultureInfo.InvariantCulture,
|
||||
out var offset))
|
||||
@@ -247,6 +247,13 @@ namespace DiscordChatExporter.Core.Markdown.Parsing
|
||||
return null;
|
||||
}
|
||||
|
||||
// Bound check
|
||||
// https://github.com/Tyrrrz/DiscordChatExporter/issues/681
|
||||
if (offset < TimeSpan.MinValue.TotalSeconds || offset > TimeSpan.MaxValue.TotalSeconds)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
return new UnixTimestampNode(DateTimeOffset.UnixEpoch + TimeSpan.FromSeconds(offset));
|
||||
}
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user