mirror of
https://github.com/Kareadita/Kavita.git
synced 2025-07-09 03:04:19 -04:00
Versioning Fix & Improvement (#553)
* Fix UpdaterService versioning (#544) * Add "Available" to newer, non-installed updates * Add if...else logic to Available/Installed badge * Change substring to account for bigger versions (#544) * Cache BuildInfo.version into local variable (#544) * Cache BuildInfo.Version.ToString() into local variable (#544) Co-authored-by: Yovarni Yearwood <yovarni@hawser.org>
This commit is contained in:
parent
1f0fa6e5b6
commit
31ae65b2b7
@ -22,8 +22,6 @@
|
|||||||
<Company>kareadita.github.io</Company>
|
<Company>kareadita.github.io</Company>
|
||||||
<Copyright>Copyright 2020-$([System.DateTime]::Now.ToString('yyyy')) kavitareader.com (GNU General Public v3)</Copyright>
|
<Copyright>Copyright 2020-$([System.DateTime]::Now.ToString('yyyy')) kavitareader.com (GNU General Public v3)</Copyright>
|
||||||
|
|
||||||
<!-- Should be replaced by CI -->
|
|
||||||
<AssemblyVersion>0.4.1</AssemblyVersion>
|
|
||||||
<AssemblyConfiguration>$(Configuration)-dev</AssemblyConfiguration>
|
<AssemblyConfiguration>$(Configuration)-dev</AssemblyConfiguration>
|
||||||
|
|
||||||
<GenerateAssemblyFileVersionAttribute>false</GenerateAssemblyFileVersionAttribute>
|
<GenerateAssemblyFileVersionAttribute>false</GenerateAssemblyFileVersionAttribute>
|
||||||
@ -75,7 +73,7 @@
|
|||||||
<ProjectReference Include="..\Kavita.Common\Kavita.Common.csproj" />
|
<ProjectReference Include="..\Kavita.Common\Kavita.Common.csproj" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<None Remove="Hangfire-log.db" />
|
<None Remove="Hangfire-log.db" />
|
||||||
|
@ -90,12 +90,17 @@ namespace API.Services.Tasks
|
|||||||
private UpdateNotificationDto CreateDto(GithubReleaseMetadata update)
|
private UpdateNotificationDto CreateDto(GithubReleaseMetadata update)
|
||||||
{
|
{
|
||||||
if (update == null || string.IsNullOrEmpty(update.Tag_Name)) return null;
|
if (update == null || string.IsNullOrEmpty(update.Tag_Name)) return null;
|
||||||
var version = update.Tag_Name.Replace("v", string.Empty);
|
var updateVersion = new Version(update.Tag_Name.Replace("v", string.Empty));
|
||||||
var updateVersion = new Version(version);
|
var currentVersion = BuildInfo.Version.ToString();
|
||||||
|
|
||||||
|
if (updateVersion.Revision == -1)
|
||||||
|
{
|
||||||
|
currentVersion = currentVersion.Substring(0, currentVersion.LastIndexOf("."));
|
||||||
|
}
|
||||||
|
|
||||||
return new UpdateNotificationDto()
|
return new UpdateNotificationDto()
|
||||||
{
|
{
|
||||||
CurrentVersion = version,
|
CurrentVersion = currentVersion,
|
||||||
UpdateVersion = updateVersion.ToString(),
|
UpdateVersion = updateVersion.ToString(),
|
||||||
UpdateBody = _markdown.Transform(update.Body.Trim()),
|
UpdateBody = _markdown.Transform(update.Body.Trim()),
|
||||||
UpdateTitle = update.Name,
|
UpdateTitle = update.Name,
|
||||||
|
@ -1,7 +1,12 @@
|
|||||||
<ng-container *ngFor="let update of updates; let indx = index;">
|
<ng-container *ngFor="let update of updates; let indx = index;">
|
||||||
<div class="card w-100 mb-2" style="width: 18rem;">
|
<div class="card w-100 mb-2" style="width: 18rem;">
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<h5 class="card-title">{{update.updateTitle}} <span class="badge badge-secondary" *ngIf="update.updateVersion === update.currentVersion">Installed</span></h5>
|
<h5 class="card-title">{{update.updateTitle}}
|
||||||
|
<span class="badge badge-secondary" *ngIf="update.updateVersion <= update.currentVersion; else available">Installed</span>
|
||||||
|
<ng-template #available>
|
||||||
|
<span class="badge badge-secondary">Available</span>
|
||||||
|
</ng-template>
|
||||||
|
</h5>
|
||||||
<pre class="card-text update-body" [innerHtml]="update.updateBody | safeHtml"></pre>
|
<pre class="card-text update-body" [innerHtml]="update.updateBody | safeHtml"></pre>
|
||||||
<a *ngIf="!update.isDocker" href="{{update.updateUrl}}" class="btn btn-{{indx === 0 ? 'primary' : 'secondary'}} float-right" target="_blank">Download</a>
|
<a *ngIf="!update.isDocker" href="{{update.updateUrl}}" class="btn btn-{{indx === 0 ? 'primary' : 'secondary'}} float-right" target="_blank">Download</a>
|
||||||
</div>
|
</div>
|
||||||
@ -11,4 +16,4 @@
|
|||||||
|
|
||||||
<div class="spinner-border text-secondary" *ngIf="isLoading" role="status">
|
<div class="spinner-border text-secondary" *ngIf="isLoading" role="status">
|
||||||
<span class="invisible">Loading...</span>
|
<span class="invisible">Loading...</span>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user