Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add BeatmapInfo.LastUpdate to track the time of local changes #19530

Merged
merged 4 commits into from
Aug 16, 2022

Conversation

peppy
Copy link
Member

@peppy peppy commented Aug 1, 2022

Also fix DateAdded not being set to a sane value when creating a new beatmap in the editor.

Note that this date is not currently used, but I figure it will be useful for showing a user's own creations (which would default to "last modified" for sure).

@peppy peppy added the realm deals with local realm database label Aug 1, 2022
Copy link
Collaborator

@bdach bdach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This'll need conflict resolution (looks to be trivial) - but while I'm at it...

Comment on lines 105 to 113
/// <summary>
/// The last time of a local modification (via the editor).
/// </summary>
public DateTimeOffset? LastUpdated { get; set; }

/// <summary>
/// The last time online metadata was applied to this beatmap.
/// </summary>
public DateTimeOffset? LastOnlineUpdate { get; set; }
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure how to feel about having both DateTimeOffset? BeatmapInfo.LastUpdated (added here) and DateTimeOffset? BeatmapInfo.LastOnlineUpdate (already present). Can we rename the former to something like LastLocalUpdate or something for clarity?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking back at this, I'm wondering if we can just have a single property to handle both? I can't think of a case where we'd use the online value if there are local modifications. And it would be reset to the correct value the next time an update is applied (restoring to a non-modified state).

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maaaybe? I'm not sure I have a well formed opinion on that. LastOnlineUpdate is being used in a few places that have online-specific checks, so I'm not sure merging is possible on technical merit, but I'm not very familiar with the beatmap update flow anymore.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, best to keep separate for now. We can complicate things later if required.

I'll rename to LastLocalUpdate for now.

@pull-request-size pull-request-size bot added size/S and removed size/M labels Aug 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
realm deals with local realm database size/S
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants