Skip to content

Commit

Permalink
fix: use older endpoints for stable
Browse files Browse the repository at this point in the history
  • Loading branch information
revam committed Apr 9, 2024
1 parent 619f97c commit aa9b495
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Shokofin/API/ShokoAPIClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,18 @@ public class ShokoAPIClient : IDisposable

private readonly ILogger<ShokoAPIClient> Logger;

private static DateTime? ServerCommitDate =>
Plugin.Instance.Configuration.ServerVersion?.ReleaseDate;
private static ComponentVersion? ServerVersion =>
Plugin.Instance.Configuration.ServerVersion;

private static readonly DateTime StableCutOffDate = DateTime.Parse("2023-12-16T00:00:00.000Z");

private static bool UseOlderSeriesAndFileEndpoints =>
ServerCommitDate.HasValue && ServerCommitDate.Value < StableCutOffDate;
ServerVersion != null && ((ServerVersion.ReleaseChannel == ReleaseChannel.Stable && ServerVersion.Version == "4.2.2.0") || (ServerVersion.ReleaseDate.HasValue && ServerVersion.ReleaseDate.Value < StableCutOffDate));

private static readonly DateTime ImportFolderCutOffDate = DateTime.Parse("2024-03-28T00:00:00.000Z");

private static bool UseOlderImportFolderFileEndpoints =>
ServerCommitDate.HasValue && ServerCommitDate.Value < ImportFolderCutOffDate;
ServerVersion != null && ((ServerVersion.ReleaseChannel == ReleaseChannel.Stable && ServerVersion.Version == "4.2.2.0") || (ServerVersion.ReleaseDate.HasValue && ServerVersion.ReleaseDate.Value < ImportFolderCutOffDate));

private GuardedMemoryCache _cache = new(new MemoryCacheOptions() {
ExpirationScanFrequency = ExpirationScanFrequency,
Expand Down

0 comments on commit aa9b495

Please sign in to comment.