Implement new version of download tracker

This commit is contained in:
Dean Herbert
2021-10-27 19:52:41 +09:00
parent 45db99171e
commit 9015ac6ba8
5 changed files with 386 additions and 3 deletions

View File

@ -15,7 +15,7 @@ using osu.Game.Overlays.Notifications;
namespace osu.Game.Database
{
public abstract class ModelDownloader<TModel> : IModelDownloader<TModel>
where TModel : class, IHasPrimaryKey, ISoftDelete, IEquatable<TModel>
where TModel : class, IHasPrimaryKey, ISoftDelete, IEquatable<TModel>, IHasOnlineID
{
public Action<Notification> PostNotification { protected get; set; }
@ -107,7 +107,7 @@ namespace osu.Game.Database
}
}
public ArchiveDownloadRequest<TModel> GetExistingDownload(TModel model) => currentDownloads.Find(r => r.Model.Equals(model));
public ArchiveDownloadRequest<TModel> GetExistingDownload(TModel model) => currentDownloads.Find(r => r.Model.OnlineID == model.OnlineID);
private bool canDownload(TModel model) => GetExistingDownload(model) == null && api != null;