Skip to content
This repository has been archived by the owner on Sep 25, 2023. It is now read-only.

Commit

Permalink
Fix version check
Browse files Browse the repository at this point in the history
  • Loading branch information
ConfusedPolarBear committed May 22, 2022
1 parent 552a1fd commit bb2c9a3
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 32 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<RootNamespace>ConfusedPolarBear.Plugin.IntroSkipper</RootNamespace>
<AssemblyVersion>0.0.0.2</AssemblyVersion>
<FileVersion>0.0.0.2</FileVersion>
<AssemblyVersion>0.0.0.3</AssemblyVersion>
<FileVersion>0.0.0.3</FileVersion>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<Nullable>enable</Nullable>
Expand Down
31 changes: 3 additions & 28 deletions ConfusedPolarBear.Plugin.IntroSkipper/FPCalc.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,6 @@ namespace ConfusedPolarBear.Plugin.IntroSkipper;
/// </summary>
public static class FPCalc
{
/// <summary>
/// Minimum fpcalc version that can be used.
/// </summary>
private static Version minimumFPCalcVersion = new Version(1, 4, 3);

/// <summary>
/// Gets or sets the logger.
/// </summary>
Expand All @@ -32,29 +27,9 @@ public static bool CheckFPCalcInstalled()
{
try
{
var rawVersion = GetOutput("-version", 2000).TrimEnd();
if (!rawVersion.StartsWith("fpcalc version", StringComparison.OrdinalIgnoreCase))
{
return false;
}

Logger?.LogDebug("raw fpcalc version: {Version}", rawVersion);

var version = Version.Parse(rawVersion.AsSpan(15));

Logger?.LogDebug("Found fpcalc version {Version}", version);

var okay = version >= minimumFPCalcVersion;

if (!okay)
{
Logger?.LogError(
"installed fpcalc version of {Version} is too old (minimum is {Minimum})",
version,
minimumFPCalcVersion);
}

return okay;
var version = GetOutput("-version", 2000).TrimEnd();
Logger?.LogInformation("fpcalc -version: {Version}", version);
return version.StartsWith("fpcalc version", StringComparison.OrdinalIgnoreCase);
}
catch
{
Expand Down
12 changes: 10 additions & 2 deletions manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,16 @@
"changelog": "- decrease audio fingerprint comparison time\n- analyze two seasons simultaneously",
"targetAbi": "10.8.0.0",
"sourceUrl": "https://github.com/ConfusedPolarBear/intro-skipper/releases/download/v0.0.2/intro-skipper-v0.0.2.zip",
"checksum": "83c3e3618a6c37c2767e5bfea64ef515",
"timestamp": "2022-05-22T00:05:12Z"
"checksum": "83c3e3618a6c37c2767e5bfea64ef515",
"timestamp": "2022-05-22T00:05:12Z"
},
{
"version": "0.0.0.3",
"changelog": "- fix version check",
"targetAbi": "10.8.0.0",
"sourceUrl": "https://github.com/ConfusedPolarBear/intro-skipper/releases/download/v0.0.3/intro-skipper-v0.0.3.zip",
"checksum": "4d9eee379679c13c351d64f9d8c52a23",
"timestamp": "2022-05-22T03:43:29Z"
}
]
}
Expand Down

0 comments on commit bb2c9a3

Please sign in to comment.