Bugfixes + Potential iOS Webtoon Reader Fix (#2650)
This commit is contained in:
parent
56fa393cf0
commit
f660a1cd06
25 changed files with 157 additions and 197 deletions
|
|
@ -48,6 +48,7 @@ public interface IVersionUpdaterService
|
|||
Task<UpdateNotificationDto?> CheckForUpdate();
|
||||
Task PushUpdate(UpdateNotificationDto update);
|
||||
Task<IEnumerable<UpdateNotificationDto>> GetAllReleases();
|
||||
Task<int> GetNumberOfReleasesBehind();
|
||||
}
|
||||
|
||||
public class VersionUpdaterService : IVersionUpdaterService
|
||||
|
|
@ -87,6 +88,12 @@ public class VersionUpdaterService : IVersionUpdaterService
|
|||
return updates.Select(CreateDto).Where(d => d != null)!;
|
||||
}
|
||||
|
||||
public async Task<int> GetNumberOfReleasesBehind()
|
||||
{
|
||||
var updates = await GetAllReleases();
|
||||
return updates.TakeWhile(update => update.UpdateVersion != update.CurrentVersion).Count();
|
||||
}
|
||||
|
||||
private UpdateNotificationDto? CreateDto(GithubReleaseMetadata? update)
|
||||
{
|
||||
if (update == null || string.IsNullOrEmpty(update.Tag_Name)) return null;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue