Skip to content

Fill the osu! creator and tags from the simfile - #331

Open
MAX-WiRED wants to merge 1 commit into
uvcat7:betafrom
MAX-WiRED:feat/osu-metadata
Open

Fill the osu! creator and tags from the simfile#331
MAX-WiRED wants to merge 1 commit into
uvcat7:betafrom
MAX-WiRED:feat/osu-metadata

Conversation

@MAX-WiRED

Copy link
Copy Markdown
Contributor

Two fields of the [Metadata] block are written blind:

    Write(out, "Creator", chart ? chart->artist : "Unknown");
    ...
    Write(out, "Tags", "");

so a map exported from here is by Unknown and carries no tags, though the
simfile usually knows both.

Creator

A StepMania file names the author in #CREDIT more often than per chart -
chart->artist is empty in most files - so Unknown is what nearly every
export gets. The creator now falls back to the credit of the song, and is left
empty rather than filled with a placeholder when neither is set.

This is the same value the exported filename uses, so the name of the file and
the field inside it agree.

Tags

#GENRE is the closest thing a simfile has to the keywords osu! puts in
Tags, and it is otherwise dropped on export - nothing else in the .osu
carries it.

What is left alone

BeatmapID:0 and BeatmapSetID:-1 stay as they are: that is what osu! writes
for a map which has not been submitted, which is what an export from here is. I
checked a few hundred local beatmaps to be sure rather than guess - every
unsubmitted one has exactly that pair.

Version also stays as it is. A simfile has no free-form difficulty name to
put there - #SUBTITLE belongs to the song rather than the chart, so using it
would give every difficulty in the set the same Version.

Testing

Built on Windows with clang-tidy and clang-format enforced, as the build does.

A song with #GENRE:witch house, russian, tiktok; and #CREDIT:WiRED;, whose
chart has no step artist, exports as:

[Metadata]
Title:Plak-Plak
TitleUnicode:Плак-Плак
Artist:IC3PEAK
ArtistUnicode:IC3PEAK
Creator:WiRED
Version:Hard
Source:
Tags:witch house, russian, tiktok
BeatmapID:0
BeatmapSetID:-1

Before the change the same file gave Creator:Unknown and an empty Tags.

Two fields of the metadata block are written blind:

    Write(out, "Creator", chart ? chart->artist : "Unknown");
    Write(out, "Tags", "");

so a map exported from here is by "Unknown" and carries no tags, though
the simfile usually knows both.

A StepMania file names the author in #CREDIT more often than per chart,
so the creator falls back to it when the chart itself says nothing, and
is left empty rather than filled with a placeholder when neither does.
That is also what the exported filename uses, so the two agree.

#GENRE is the closest thing a simfile has to the keywords osu! puts in
Tags, and it is otherwise dropped on export.

BeatmapID and BeatmapSetID are left alone: 0 and -1 is what osu! writes
for a map that has not been submitted, which is what these are.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant