Skip to content

Commit

Permalink
New changelog is working perfectly. Fixed a bug with the version upda…
Browse files Browse the repository at this point in the history
…te code from earlier which wasn't caching the installed version properly.
  • Loading branch information
majora2007 committed Dec 22, 2024
1 parent 02df815 commit 1114fc1
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
1 change: 1 addition & 0 deletions API/API.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@
</ItemGroup>

<ItemGroup>
<Folder Include="config\cache-long\" />
<Folder Include="config\themes" />
<Content Include="EmailTemplates\**">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
Expand Down
2 changes: 2 additions & 0 deletions API/Helpers/GenreHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,10 @@
namespace API.Helpers;
#nullable enable


public static class GenreHelper
{

public static async Task UpdateChapterGenres(Chapter chapter, IEnumerable<string> genreNames, IUnitOfWork unitOfWork)
{
// Normalize genre names once and store them in a hash set for quick lookups
Expand Down
10 changes: 3 additions & 7 deletions API/Services/Tasks/VersionUpdaterService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ private async Task EnrichWithNightlyInfo(List<UpdateNotificationDto> dtos)
CurrentVersion = dto.CurrentVersion,
UpdateUrl = prInfo.Html_Url,
PublishDate = prInfo.Merged_At,
IsDocker = dto.IsDocker,
IsDocker = true, // Nightlies are always Docker Only
IsReleaseEqual = IsVersionEqualToBuildVersion(Version.Parse(nightly.Version)),
IsReleaseNewer = true, // Since we already filtered these in GetNightlyReleases
Added = sections.TryGetValue("Added", out var added) ? added : [],
Expand All @@ -137,11 +137,7 @@ private async Task EnrichWithNightlyInfo(List<UpdateNotificationDto> dtos)
nightlyDtos.Add(nightlyDto);
}

// Get the parent list that contains our DTO


// Insert nightly releases at the beginning of the list
//var index = dtos.IndexOf(dto);
var sortedNightlyDtos = nightlyDtos.OrderByDescending(x => x.PublishDate).ToList();
dtos.InsertRange(0, sortedNightlyDtos);
}
Expand Down Expand Up @@ -369,8 +365,8 @@ private async Task CacheReleasesAsync(IList<UpdateNotificationDto> updates)

private static bool IsVersionEqualToBuildVersion(Version updateVersion)
{
return updateVersion.Revision < 0 && BuildInfo.Version.Revision == 0 &&
CompareWithoutRevision(BuildInfo.Version, updateVersion);
return updateVersion == BuildInfo.Version || (updateVersion.Revision < 0 && BuildInfo.Version.Revision == 0 &&
CompareWithoutRevision(BuildInfo.Version, updateVersion));
}

private static bool CompareWithoutRevision(Version v1, Version v2)
Expand Down
6 changes: 3 additions & 3 deletions UI/Web/src/app/_services/version.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,11 @@ export class VersionService implements OnDestroy{
ref.closed.subscribe(_ => this.onModalClosed());
ref.dismissed.subscribe(_ => this.onModalClosed());

})
});

} else {
localStorage.setItem(VersionService.versionKey, version);
}

localStorage.setItem(VersionService.versionKey, version);
}

private onModalClosed() {
Expand Down
3 changes: 2 additions & 1 deletion UI/Web/src/assets/langs/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -637,7 +637,8 @@
"theme": "Theme",
"removed": "Removed",
"api": "API",
"published-label": "Published: "
"published-label": "Published: ",
"installed": "{{changelog.installed}}"
},

"new-version-modal": {
Expand Down

0 comments on commit 1114fc1

Please sign in to comment.