mirror of
https://github.com/osukey/osukey.git
synced 2025-07-02 00:40:09 +09:00
Update all existing usages of AuthorString
/AuthorId
Unfortunately the getters need to be left in place else EF breaks.
This commit is contained in:
@ -112,7 +112,7 @@ namespace osu.Game.Tests.Beatmaps.Formats
|
|||||||
Assert.AreEqual("Renatus", metadata.TitleUnicode);
|
Assert.AreEqual("Renatus", metadata.TitleUnicode);
|
||||||
Assert.AreEqual("Soleily", metadata.Artist);
|
Assert.AreEqual("Soleily", metadata.Artist);
|
||||||
Assert.AreEqual("Soleily", metadata.ArtistUnicode);
|
Assert.AreEqual("Soleily", metadata.ArtistUnicode);
|
||||||
Assert.AreEqual("Gamu", metadata.AuthorString);
|
Assert.AreEqual("Gamu", metadata.Author.Username);
|
||||||
Assert.AreEqual("Insane", beatmapInfo.Version);
|
Assert.AreEqual("Insane", beatmapInfo.Version);
|
||||||
Assert.AreEqual(string.Empty, metadata.Source);
|
Assert.AreEqual(string.Empty, metadata.Source);
|
||||||
Assert.AreEqual("MBC7 Unisphere 地球ヤバイEP Chikyu Yabai", metadata.Tags);
|
Assert.AreEqual("MBC7 Unisphere 地球ヤバイEP Chikyu Yabai", metadata.Tags);
|
||||||
@ -547,7 +547,7 @@ namespace osu.Game.Tests.Beatmaps.Formats
|
|||||||
Assert.DoesNotThrow(() => beatmap = decoder.Decode(stream));
|
Assert.DoesNotThrow(() => beatmap = decoder.Decode(stream));
|
||||||
Assert.IsNotNull(beatmap);
|
Assert.IsNotNull(beatmap);
|
||||||
Assert.AreEqual("Beatmap with corrupted header", beatmap.Metadata.Title);
|
Assert.AreEqual("Beatmap with corrupted header", beatmap.Metadata.Title);
|
||||||
Assert.AreEqual("Evil Hacker", beatmap.Metadata.AuthorString);
|
Assert.AreEqual("Evil Hacker", beatmap.Metadata.Author.Username);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -565,7 +565,7 @@ namespace osu.Game.Tests.Beatmaps.Formats
|
|||||||
Assert.DoesNotThrow(() => beatmap = decoder.Decode(stream));
|
Assert.DoesNotThrow(() => beatmap = decoder.Decode(stream));
|
||||||
Assert.IsNotNull(beatmap);
|
Assert.IsNotNull(beatmap);
|
||||||
Assert.AreEqual("Beatmap with no header", beatmap.Metadata.Title);
|
Assert.AreEqual("Beatmap with no header", beatmap.Metadata.Title);
|
||||||
Assert.AreEqual("Incredibly Evil Hacker", beatmap.Metadata.AuthorString);
|
Assert.AreEqual("Incredibly Evil Hacker", beatmap.Metadata.Author.Username);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -583,7 +583,7 @@ namespace osu.Game.Tests.Beatmaps.Formats
|
|||||||
Assert.DoesNotThrow(() => beatmap = decoder.Decode(stream));
|
Assert.DoesNotThrow(() => beatmap = decoder.Decode(stream));
|
||||||
Assert.IsNotNull(beatmap);
|
Assert.IsNotNull(beatmap);
|
||||||
Assert.AreEqual("Empty lines at start", beatmap.Metadata.Title);
|
Assert.AreEqual("Empty lines at start", beatmap.Metadata.Title);
|
||||||
Assert.AreEqual("Edge Case Hunter", beatmap.Metadata.AuthorString);
|
Assert.AreEqual("Edge Case Hunter", beatmap.Metadata.Author.Username);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -601,7 +601,7 @@ namespace osu.Game.Tests.Beatmaps.Formats
|
|||||||
Assert.DoesNotThrow(() => beatmap = decoder.Decode(stream));
|
Assert.DoesNotThrow(() => beatmap = decoder.Decode(stream));
|
||||||
Assert.IsNotNull(beatmap);
|
Assert.IsNotNull(beatmap);
|
||||||
Assert.AreEqual("The dog ate the file header", beatmap.Metadata.Title);
|
Assert.AreEqual("The dog ate the file header", beatmap.Metadata.Title);
|
||||||
Assert.AreEqual("Why does this keep happening", beatmap.Metadata.AuthorString);
|
Assert.AreEqual("Why does this keep happening", beatmap.Metadata.Author.Username);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -619,7 +619,7 @@ namespace osu.Game.Tests.Beatmaps.Formats
|
|||||||
Assert.DoesNotThrow(() => beatmap = decoder.Decode(stream));
|
Assert.DoesNotThrow(() => beatmap = decoder.Decode(stream));
|
||||||
Assert.IsNotNull(beatmap);
|
Assert.IsNotNull(beatmap);
|
||||||
Assert.AreEqual("No empty line delimiting header from contents", beatmap.Metadata.Title);
|
Assert.AreEqual("No empty line delimiting header from contents", beatmap.Metadata.Title);
|
||||||
Assert.AreEqual("Edge Case Hunter", beatmap.Metadata.AuthorString);
|
Assert.AreEqual("Edge Case Hunter", beatmap.Metadata.Author.Username);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -35,7 +35,7 @@ namespace osu.Game.Tests.Beatmaps.Formats
|
|||||||
Assert.AreEqual("Soleily", meta.Artist);
|
Assert.AreEqual("Soleily", meta.Artist);
|
||||||
Assert.AreEqual("Soleily", meta.ArtistUnicode);
|
Assert.AreEqual("Soleily", meta.ArtistUnicode);
|
||||||
Assert.AreEqual("03. Renatus - Soleily 192kbps.mp3", meta.AudioFile);
|
Assert.AreEqual("03. Renatus - Soleily 192kbps.mp3", meta.AudioFile);
|
||||||
Assert.AreEqual("Gamu", meta.AuthorString);
|
Assert.AreEqual("Gamu", meta.Author.Username);
|
||||||
Assert.AreEqual("machinetop_background.jpg", meta.BackgroundFile);
|
Assert.AreEqual("machinetop_background.jpg", meta.BackgroundFile);
|
||||||
Assert.AreEqual(164471, meta.PreviewTime);
|
Assert.AreEqual(164471, meta.PreviewTime);
|
||||||
Assert.AreEqual(string.Empty, meta.Source);
|
Assert.AreEqual(string.Empty, meta.Source);
|
||||||
|
@ -60,7 +60,7 @@ namespace osu.Game.Tests.Beatmaps.IO
|
|||||||
Assert.AreEqual("Soleily", meta.Artist);
|
Assert.AreEqual("Soleily", meta.Artist);
|
||||||
Assert.AreEqual("Soleily", meta.ArtistUnicode);
|
Assert.AreEqual("Soleily", meta.ArtistUnicode);
|
||||||
Assert.AreEqual("03. Renatus - Soleily 192kbps.mp3", meta.AudioFile);
|
Assert.AreEqual("03. Renatus - Soleily 192kbps.mp3", meta.AudioFile);
|
||||||
Assert.AreEqual("Deif", meta.AuthorString);
|
Assert.AreEqual("Deif", meta.Author.Username);
|
||||||
Assert.AreEqual("machinetop_background.jpg", meta.BackgroundFile);
|
Assert.AreEqual("machinetop_background.jpg", meta.BackgroundFile);
|
||||||
Assert.AreEqual(164471, meta.PreviewTime);
|
Assert.AreEqual(164471, meta.PreviewTime);
|
||||||
Assert.AreEqual(string.Empty, meta.Source);
|
Assert.AreEqual(string.Empty, meta.Source);
|
||||||
|
@ -400,7 +400,7 @@ namespace osu.Game.Tests.Visual.SongSelect
|
|||||||
loadBeatmaps();
|
loadBeatmaps();
|
||||||
|
|
||||||
AddStep("Sort by author", () => carousel.Filter(new FilterCriteria { Sort = SortMode.Author }, false));
|
AddStep("Sort by author", () => carousel.Filter(new FilterCriteria { Sort = SortMode.Author }, false));
|
||||||
AddAssert("Check zzzzz is at bottom", () => carousel.BeatmapSets.Last().Metadata.AuthorString == "zzzzz");
|
AddAssert("Check zzzzz is at bottom", () => carousel.BeatmapSets.Last().Metadata.Author.Username == "zzzzz");
|
||||||
AddStep("Sort by artist", () => carousel.Filter(new FilterCriteria { Sort = SortMode.Artist }, false));
|
AddStep("Sort by artist", () => carousel.Filter(new FilterCriteria { Sort = SortMode.Artist }, false));
|
||||||
AddAssert($"Check #{set_count} is at bottom", () => carousel.BeatmapSets.Last().Metadata.Title.EndsWith($"#{set_count}!", StringComparison.Ordinal));
|
AddAssert($"Check #{set_count} is at bottom", () => carousel.BeatmapSets.Last().Metadata.Title.EndsWith($"#{set_count}!", StringComparison.Ordinal));
|
||||||
}
|
}
|
||||||
|
@ -49,7 +49,7 @@ namespace osu.Game.Beatmaps
|
|||||||
[Column("AuthorID")]
|
[Column("AuthorID")]
|
||||||
public int AuthorID
|
public int AuthorID
|
||||||
{
|
{
|
||||||
get => Author.Id;
|
get => Author.Id; // This should not be used, but is required to make EF work correctly.
|
||||||
set => Author.Id = value;
|
set => Author.Id = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -60,7 +60,7 @@ namespace osu.Game.Beatmaps
|
|||||||
[Column("Author")]
|
[Column("Author")]
|
||||||
public string AuthorString
|
public string AuthorString
|
||||||
{
|
{
|
||||||
get => Author.Username;
|
get => Author.Username; // This should not be used, but is required to make EF work correctly.
|
||||||
set => Author.Username = value;
|
set => Author.Username = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -129,7 +129,7 @@ namespace osu.Game.Beatmaps.Formats
|
|||||||
if (!string.IsNullOrEmpty(beatmap.Metadata.TitleUnicode)) writer.WriteLine(FormattableString.Invariant($"TitleUnicode: {beatmap.Metadata.TitleUnicode}"));
|
if (!string.IsNullOrEmpty(beatmap.Metadata.TitleUnicode)) writer.WriteLine(FormattableString.Invariant($"TitleUnicode: {beatmap.Metadata.TitleUnicode}"));
|
||||||
writer.WriteLine(FormattableString.Invariant($"Artist: {beatmap.Metadata.Artist}"));
|
writer.WriteLine(FormattableString.Invariant($"Artist: {beatmap.Metadata.Artist}"));
|
||||||
if (!string.IsNullOrEmpty(beatmap.Metadata.ArtistUnicode)) writer.WriteLine(FormattableString.Invariant($"ArtistUnicode: {beatmap.Metadata.ArtistUnicode}"));
|
if (!string.IsNullOrEmpty(beatmap.Metadata.ArtistUnicode)) writer.WriteLine(FormattableString.Invariant($"ArtistUnicode: {beatmap.Metadata.ArtistUnicode}"));
|
||||||
writer.WriteLine(FormattableString.Invariant($"Creator: {beatmap.Metadata.AuthorString}"));
|
writer.WriteLine(FormattableString.Invariant($"Creator: {beatmap.Metadata.Author.Username}"));
|
||||||
writer.WriteLine(FormattableString.Invariant($"Version: {beatmap.BeatmapInfo.Version}"));
|
writer.WriteLine(FormattableString.Invariant($"Version: {beatmap.BeatmapInfo.Version}"));
|
||||||
if (!string.IsNullOrEmpty(beatmap.Metadata.Source)) writer.WriteLine(FormattableString.Invariant($"Source: {beatmap.Metadata.Source}"));
|
if (!string.IsNullOrEmpty(beatmap.Metadata.Source)) writer.WriteLine(FormattableString.Invariant($"Source: {beatmap.Metadata.Source}"));
|
||||||
if (!string.IsNullOrEmpty(beatmap.Metadata.Tags)) writer.WriteLine(FormattableString.Invariant($"Tags: {beatmap.Metadata.Tags}"));
|
if (!string.IsNullOrEmpty(beatmap.Metadata.Tags)) writer.WriteLine(FormattableString.Invariant($"Tags: {beatmap.Metadata.Tags}"));
|
||||||
|
@ -46,7 +46,7 @@ namespace osu.Game.Screens.Edit.Setup
|
|||||||
|
|
||||||
Empty(),
|
Empty(),
|
||||||
|
|
||||||
creatorTextBox = createTextBox<LabelledTextBox>("Creator", metadata.AuthorString),
|
creatorTextBox = createTextBox<LabelledTextBox>("Creator", metadata.Author.Username),
|
||||||
difficultyTextBox = createTextBox<LabelledTextBox>("Difficulty Name", Beatmap.BeatmapInfo.Version),
|
difficultyTextBox = createTextBox<LabelledTextBox>("Difficulty Name", Beatmap.BeatmapInfo.Version),
|
||||||
sourceTextBox = createTextBox<LabelledTextBox>("Source", metadata.Source),
|
sourceTextBox = createTextBox<LabelledTextBox>("Source", metadata.Source),
|
||||||
tagsTextBox = createTextBox<LabelledTextBox>("Tags", metadata.Tags)
|
tagsTextBox = createTextBox<LabelledTextBox>("Tags", metadata.Tags)
|
||||||
|
@ -164,7 +164,7 @@ namespace osu.Game.Screens.Play
|
|||||||
new Drawable[]
|
new Drawable[]
|
||||||
{
|
{
|
||||||
new MetadataLineLabel("Mapper"),
|
new MetadataLineLabel("Mapper"),
|
||||||
new MetadataLineInfo(metadata.AuthorString)
|
new MetadataLineInfo(metadata.Author.Username)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -49,7 +49,7 @@ namespace osu.Game.Screens.Select.Carousel
|
|||||||
match &= !criteria.BeatDivisor.HasFilter || criteria.BeatDivisor.IsInRange(BeatmapInfo.BeatDivisor);
|
match &= !criteria.BeatDivisor.HasFilter || criteria.BeatDivisor.IsInRange(BeatmapInfo.BeatDivisor);
|
||||||
match &= !criteria.OnlineStatus.HasFilter || criteria.OnlineStatus.IsInRange(BeatmapInfo.Status);
|
match &= !criteria.OnlineStatus.HasFilter || criteria.OnlineStatus.IsInRange(BeatmapInfo.Status);
|
||||||
|
|
||||||
match &= !criteria.Creator.HasFilter || criteria.Creator.Matches(BeatmapInfo.Metadata.AuthorString);
|
match &= !criteria.Creator.HasFilter || criteria.Creator.Matches(BeatmapInfo.Metadata.Author.Username);
|
||||||
match &= !criteria.Artist.HasFilter || criteria.Artist.Matches(BeatmapInfo.Metadata.Artist) ||
|
match &= !criteria.Artist.HasFilter || criteria.Artist.Matches(BeatmapInfo.Metadata.Artist) ||
|
||||||
criteria.Artist.Matches(BeatmapInfo.Metadata.ArtistUnicode);
|
criteria.Artist.Matches(BeatmapInfo.Metadata.ArtistUnicode);
|
||||||
|
|
||||||
|
@ -77,6 +77,6 @@ namespace osu.Game.Skinning
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static SkinInfo createSkinInfo(BeatmapInfo beatmapInfo) =>
|
private static SkinInfo createSkinInfo(BeatmapInfo beatmapInfo) =>
|
||||||
new SkinInfo { Name = beatmapInfo.ToString(), Creator = beatmapInfo.Metadata?.AuthorString };
|
new SkinInfo { Name = beatmapInfo.ToString(), Creator = beatmapInfo.Metadata?.Author.Username };
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -240,8 +240,8 @@ namespace osu.Game.Stores
|
|||||||
ArtistUnicode = decoded.Metadata.ArtistUnicode,
|
ArtistUnicode = decoded.Metadata.ArtistUnicode,
|
||||||
Author =
|
Author =
|
||||||
{
|
{
|
||||||
OnlineID = decoded.Metadata.AuthorID,
|
OnlineID = decoded.Metadata.Author.Id,
|
||||||
Username = decoded.Metadata.AuthorString
|
Username = decoded.Metadata.Author.Username
|
||||||
},
|
},
|
||||||
Source = decoded.Metadata.Source,
|
Source = decoded.Metadata.Source,
|
||||||
Tags = decoded.Metadata.Tags,
|
Tags = decoded.Metadata.Tags,
|
||||||
|
@ -216,8 +216,6 @@ namespace osu.Game.Tests.Visual
|
|||||||
Artist = beatmap.BeatmapSet.Metadata.Artist,
|
Artist = beatmap.BeatmapSet.Metadata.Artist,
|
||||||
ArtistUnicode = beatmap.BeatmapSet.Metadata.ArtistUnicode,
|
ArtistUnicode = beatmap.BeatmapSet.Metadata.ArtistUnicode,
|
||||||
Author = beatmap.BeatmapSet.Metadata.Author,
|
Author = beatmap.BeatmapSet.Metadata.Author,
|
||||||
AuthorID = beatmap.BeatmapSet.Metadata.AuthorID,
|
|
||||||
AuthorString = beatmap.BeatmapSet.Metadata.AuthorString,
|
|
||||||
Source = beatmap.BeatmapSet.Metadata.Source,
|
Source = beatmap.BeatmapSet.Metadata.Source,
|
||||||
Tags = beatmap.BeatmapSet.Metadata.Tags,
|
Tags = beatmap.BeatmapSet.Metadata.Tags,
|
||||||
Beatmaps = new[]
|
Beatmaps = new[]
|
||||||
@ -228,7 +226,7 @@ namespace osu.Game.Tests.Visual
|
|||||||
OnlineBeatmapSetID = beatmap.BeatmapSet.OnlineID,
|
OnlineBeatmapSetID = beatmap.BeatmapSet.OnlineID,
|
||||||
Status = beatmap.Status,
|
Status = beatmap.Status,
|
||||||
Checksum = beatmap.MD5Hash,
|
Checksum = beatmap.MD5Hash,
|
||||||
AuthorID = beatmap.Metadata.AuthorID,
|
AuthorID = beatmap.Metadata.Author.OnlineID,
|
||||||
RulesetID = beatmap.RulesetID,
|
RulesetID = beatmap.RulesetID,
|
||||||
StarRating = beatmap.StarDifficulty,
|
StarRating = beatmap.StarDifficulty,
|
||||||
DifficultyName = beatmap.Version,
|
DifficultyName = beatmap.Version,
|
||||||
|
Reference in New Issue
Block a user