osu/osu.Game
Bartłomiej Dach 0e52797f29
Prefer not deleted models when picking model instances for reuse when importing
This fell out while investigating why the issue with online IDs
mismatching in the `.osu` could be worked around by importing the map
three times in total when starting from it not being available locally.

Here follows an explanation of why that "helped".

Import 1:
- The beatmap set is imported normally.
- Online metadata population sees the online ID mismatch and resets it
  on the problematic beatmap.

Import 2:
- The existing beatmap set is found, but deemed not reusable
  because of the single beatmap having its ID reset to -1.
- The existing beatmap set is marked deleted, and all the IDs of
  its beatmaps are reset to -1.
- The beatmap set is reimported afresh.
- Online metadata population still sees the online ID mismatch
  and resets it on the problematic beatmap.

Note that at this point the first import *is still physically present
in the database* but marked deleted.

Import 3:
- When trying to find the existing beatmap set to see if it can be
  reused, *the one pending deletion and with its IDs reset -
  - the remnant from import 1 - is returned*.
- Because of this, `validateOnlineIds()` resets online IDs
  *on the model representing the current reimport*.
- The beatmap set is reimported yet again.
- With the online ID reset, the online metadata population check for
  online ID mismatch does not run because *the IDs were reset to -1*
  earlier.

Preferring undeleted models when picking the model instance for reuse
prevents this scenario.
2024-10-30 08:18:44 +01:00
..
Audio Implement auto additions editor-only 2024-10-01 16:40:48 +09:00
Beatmaps Only use MD5 when performing metadata lookups 2024-10-30 08:12:30 +01:00
Collections Fix delete dialogs having generic "Caution" header text 2024-10-07 16:46:53 +09:00
Configuration Keep editor sidebars expanded by default 2024-10-22 20:08:50 +09:00
Database Prefer not deleted models when picking model instances for reuse when importing 2024-10-30 08:18:44 +01:00
Extensions
Graphics Fix redundant array type specification 2024-10-25 19:58:31 +02:00
Input Merge branch 'master' into grids 2024-10-16 09:55:27 +02:00
IO
IPC
Localisation Keep editor sidebars expanded by default 2024-10-22 20:08:50 +09:00
Models
Online Only use MD5 when performing metadata lookups 2024-10-30 08:12:30 +01:00
Overlays Also add source prefix 2024-10-23 16:21:28 +09:00
Performance
Properties
Replays
Rulesets Merge pull request #30387 from peppy/editor-sidebars-always-expanded 2024-10-25 19:46:35 +02:00
Scoring Expose no-op constructors as protected 2024-10-18 13:30:29 +09:00
Screens Merge pull request #30424 from bdach/wtf-wtf-wtf-wtf 2024-10-28 17:14:19 +09:00
Skinning Fix old looping samples not stopping when replacing a SkinnableSound's Samples 2024-10-22 14:35:21 +02:00
Storyboards
Tests Only use MD5 when performing metadata lookups 2024-10-30 08:12:30 +01:00
Updater
Users
Utils Merge branch 'master' into taikostatacc 2024-10-07 14:15:29 +02:00
.editorconfig
FodyWeavers.xml
osu!.res
osu.Game.csproj Update framework 2024-10-25 16:09:08 +09:00
OsuGame.cs Revert 'Fix any and all migration attempts dying on MusicController' 2024-10-09 11:55:59 +02:00
OsuGameBase_Importing.cs
OsuGameBase.cs Revert 'Fix any and all migration attempts dying on MusicController' 2024-10-09 11:55:59 +02:00
PerformFromMenuRunner.cs