mirror of
https://github.com/osukey/osukey.git
synced 2025-08-04 07:06:35 +09:00
Fix most warnings.
This commit is contained in:
@ -20,11 +20,12 @@ namespace osu.Game.Database
|
||||
{
|
||||
public class BeatmapDatabase
|
||||
{
|
||||
private SQLiteConnection connection { get; set; }
|
||||
private SQLiteConnection connection { get; }
|
||||
private Storage storage;
|
||||
public event Action<BeatmapSetInfo> BeatmapSetAdded;
|
||||
public event Action<BeatmapSetInfo> BeatmapSetRemoved;
|
||||
|
||||
// ReSharper disable once NotAccessedField.Local (we should keep a reference to this so it is not finalised)
|
||||
private BeatmapImporter ipc;
|
||||
|
||||
public BeatmapDatabase(Storage storage, GameHost importHost = null)
|
||||
@ -73,7 +74,7 @@ namespace osu.Game.Database
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Logger.Error(e, $@"Could not delete beatmap {b.ToString()}");
|
||||
Logger.Error(e, $@"Could not delete beatmap {b}");
|
||||
}
|
||||
}
|
||||
|
||||
@ -149,7 +150,7 @@ namespace osu.Game.Database
|
||||
catch (Exception e)
|
||||
{
|
||||
e = e.InnerException ?? e;
|
||||
Logger.Error(e, $@"Could not import beatmap set");
|
||||
Logger.Error(e, @"Could not import beatmap set");
|
||||
}
|
||||
|
||||
// Batch commit with multiple sets to database
|
||||
@ -318,8 +319,7 @@ namespace osu.Game.Database
|
||||
return item;
|
||||
}
|
||||
|
||||
readonly Type[] validTypes = new[]
|
||||
{
|
||||
private readonly Type[] validTypes = {
|
||||
typeof(BeatmapSetInfo),
|
||||
typeof(BeatmapInfo),
|
||||
typeof(BeatmapMetadata),
|
||||
@ -329,7 +329,7 @@ namespace osu.Game.Database
|
||||
public void Update<T>(T record, bool cascade = true) where T : class
|
||||
{
|
||||
if (validTypes.All(t => t != typeof(T)))
|
||||
throw new ArgumentException(nameof(T), "Must be a type managed by BeatmapDatabase");
|
||||
throw new ArgumentException("Must be a type managed by BeatmapDatabase", nameof(T));
|
||||
if (cascade)
|
||||
connection.UpdateWithChildren(record);
|
||||
else
|
||||
|
@ -15,9 +15,9 @@ namespace osu.Game.Database
|
||||
[PrimaryKey, AutoIncrement]
|
||||
public int ID { get; set; }
|
||||
|
||||
public int? OnlineBeatmapID { get; set; } = null;
|
||||
public int? OnlineBeatmapID { get; set; }
|
||||
|
||||
public int? OnlineBeatmapSetID { get; set; } = null;
|
||||
public int? OnlineBeatmapSetID { get; set; }
|
||||
|
||||
[ForeignKey(typeof(BeatmapSetInfo))]
|
||||
public int BeatmapSetInfoID { get; set; }
|
||||
@ -57,7 +57,7 @@ namespace osu.Game.Database
|
||||
{
|
||||
get
|
||||
{
|
||||
return StoredBookmarks.Split(',').Select(b => int.Parse(b)).ToArray();
|
||||
return StoredBookmarks.Split(',').Select(int.Parse).ToArray();
|
||||
}
|
||||
set
|
||||
{
|
||||
@ -77,7 +77,7 @@ namespace osu.Game.Database
|
||||
{
|
||||
get
|
||||
{
|
||||
return (starDifficulty < 0) ? (BaseDifficulty?.OverallDifficulty ?? 5) : starDifficulty;
|
||||
return starDifficulty < 0 ? (BaseDifficulty?.OverallDifficulty ?? 5) : starDifficulty;
|
||||
}
|
||||
|
||||
set { starDifficulty = value; }
|
||||
|
@ -10,7 +10,7 @@ namespace osu.Game.Database
|
||||
[PrimaryKey, AutoIncrement]
|
||||
public int ID { get; set; }
|
||||
|
||||
public int? OnlineBeatmapSetID { get; set; } = null;
|
||||
public int? OnlineBeatmapSetID { get; set; }
|
||||
|
||||
public string Title { get; set; }
|
||||
public string TitleUnicode { get; set; }
|
||||
|
@ -12,7 +12,7 @@ namespace osu.Game.Database
|
||||
[PrimaryKey, AutoIncrement]
|
||||
public int ID { get; set; }
|
||||
|
||||
public int? OnlineBeatmapSetID { get; set; } = null;
|
||||
public int? OnlineBeatmapSetID { get; set; }
|
||||
|
||||
[OneToOne(CascadeOperations = CascadeOperation.All)]
|
||||
public BeatmapMetadata Metadata { get; set; }
|
||||
|
Reference in New Issue
Block a user