mirror of
https://github.com/RPCS3/discord-bot.git
synced 2024-12-14 22:38:38 +00:00
fix gz detection
This commit is contained in:
parent
86370ed21d
commit
ca11634eec
@ -17,12 +17,13 @@ namespace CompatBot.EventHandlers.LogParsing.ArchiveHandlers
|
||||
|
||||
public (bool result, string reason) CanHandle(string fileName, int fileSize, ReadOnlySpan<byte> header)
|
||||
{
|
||||
if (header.Length >= Header.Length
|
||||
&& header.Slice(0, Header.Length).SequenceEqual(Header))
|
||||
return (true, null);
|
||||
|
||||
if (fileName.EndsWith(".log.gz", StringComparison.InvariantCultureIgnoreCase)
|
||||
&& !fileName.Contains("tty.log", StringComparison.InvariantCultureIgnoreCase))
|
||||
if (header.Length >= Header.Length)
|
||||
{
|
||||
if (header.Slice(0, Header.Length).SequenceEqual(Header))
|
||||
return (true, null);
|
||||
}
|
||||
else if (fileName.EndsWith(".log.gz", StringComparison.InvariantCultureIgnoreCase)
|
||||
&& !fileName.Contains("tty.log", StringComparison.InvariantCultureIgnoreCase))
|
||||
return (true, null);
|
||||
|
||||
return (false, null);
|
||||
|
Loading…
Reference in New Issue
Block a user