1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-13 03:13:21 +08:00

Reimplement missing methods

This commit is contained in:
Dean Herbert 2022-06-16 19:05:25 +09:00
parent 72c5b9009d
commit ce3d3a967c
3 changed files with 14 additions and 6 deletions

View File

@ -359,7 +359,7 @@ namespace osu.Game.Beatmaps
var notification = new ProgressNotification var notification = new ProgressNotification
{ {
Progress = 0, Progress = 0,
Text = $"Preparing to delete all {beatmapImporter.HumanisedModelName} videos...", Text = $"Preparing to delete all {HumanisedModelName} videos...",
CompletionText = "No videos found to delete!", CompletionText = "No videos found to delete!",
State = ProgressNotificationState.Active, State = ProgressNotificationState.Active,
}; };
@ -382,10 +382,10 @@ namespace osu.Game.Beatmaps
{ {
DeleteFile(b, video); DeleteFile(b, video);
deleted++; deleted++;
notification.CompletionText = $"Deleted {deleted} {beatmapImporter.HumanisedModelName} video(s)!"; notification.CompletionText = $"Deleted {deleted} {HumanisedModelName} video(s)!";
} }
notification.Text = $"Deleting videos from {beatmapImporter.HumanisedModelName}s ({deleted} deleted)"; notification.Text = $"Deleting videos from {HumanisedModelName}s ({deleted} deleted)";
notification.Progress = (float)++i / items.Count; notification.Progress = (float)++i / items.Count;
} }
@ -451,6 +451,8 @@ namespace osu.Game.Beatmaps
void IWorkingBeatmapCache.Invalidate(BeatmapSetInfo beatmapSetInfo) => workingBeatmapCache.Invalidate(beatmapSetInfo); void IWorkingBeatmapCache.Invalidate(BeatmapSetInfo beatmapSetInfo) => workingBeatmapCache.Invalidate(beatmapSetInfo);
void IWorkingBeatmapCache.Invalidate(BeatmapInfo beatmapInfo) => workingBeatmapCache.Invalidate(beatmapInfo); void IWorkingBeatmapCache.Invalidate(BeatmapInfo beatmapInfo) => workingBeatmapCache.Invalidate(beatmapInfo);
public override bool IsAvailableLocally(BeatmapSetInfo model) => Realm.Run(realm => realm.All<BeatmapSetInfo>().Any(s => s.OnlineID == model.OnlineID));
#endregion #endregion
#region Implementation of IDisposable #region Implementation of IDisposable
@ -470,5 +472,7 @@ namespace osu.Game.Beatmaps
} }
#endregion #endregion
public override string HumanisedModelName => "beatmap";
} }
} }

View File

@ -199,9 +199,10 @@ namespace osu.Game.Database
}); });
} }
// TODO: implement
public virtual bool IsAvailableLocally(TModel model) => true; public virtual bool IsAvailableLocally(TModel model) => true;
public Action<Notification>? PostNotification { get; set; } public Action<Notification>? PostNotification { get; set; }
public string HumanisedModelName { get; set; } = "wang";
public virtual string HumanisedModelName => $"{typeof(TModel).Name.Replace(@"Info", "").ToLower()}";
} }
} }

View File

@ -253,11 +253,14 @@ namespace osu.Game.Scoring
public Task Import(params ImportTask[] tasks) => scoreImporter.Import(tasks); public Task Import(params ImportTask[] tasks) => scoreImporter.Import(tasks);
public override bool IsAvailableLocally(ScoreInfo model) => Realm.Run(realm => realm.All<ScoreInfo>().Any(s => s.OnlineID == model.OnlineID));
public IEnumerable<string> HandledExtensions => scoreImporter.HandledExtensions; public IEnumerable<string> HandledExtensions => scoreImporter.HandledExtensions;
public Task<IEnumerable<Live<ScoreInfo>>> Import(ProgressNotification notification, params ImportTask[] tasks) => scoreImporter.Import(notification, tasks); public Task<IEnumerable<Live<ScoreInfo>>> Import(ProgressNotification notification, params ImportTask[] tasks) => scoreImporter.Import(notification, tasks);
public Live<ScoreInfo> Import(ScoreInfo item, ArchiveReader archive = null, bool batchImport = false, CancellationToken cancellationToken = default) => scoreImporter.Import(item, archive, batchImport, cancellationToken); public Live<ScoreInfo> Import(ScoreInfo item, ArchiveReader archive = null, bool batchImport = false, CancellationToken cancellationToken = default) =>
scoreImporter.Import(item, archive, batchImport, cancellationToken);
#region Implementation of IPresentImports<ScoreInfo> #region Implementation of IPresentImports<ScoreInfo>