osu/osu.Game/Online/API
Bartłomiej Dach fe86ee629e Fix temp files from beatmap listing imports not being cleaned up
As reported in #12718, it turns out that temporary files from beatmap
set downloads performed via the beatmap listing overlay could remain in
the user's filesystem even after the download has concluded.

The reason for the issue is a failure in component integration.
In the case of online downloads, files are first downloaded to a
temporary directory (`C:/Temp` or `/tmp`), with a randomly generated
filename, which ends in an extension of `.tmp`.

On the other side, `ArchiveModelManager`s have a `ShouldDeleteArchive()`
method, which determines whether a file should be deleted after
importing. At the time of writing, in the case of beatmap imports the
file is only automatically cleaned up if the extension of the file is
equal to `.osz`, which was not the case for temporary files.

As it turns out, `APIDownloadRequest` has a facility for adjusting the
file's extension, via the protected `FileExtension` property. Therefore,
use it in the case of `DownloadBeatmapSetRequest` to specify `.osz`,
which then will make sure that the `ShouldDeleteArchive()` check in
`BeatmapManager` picks it up for clean-up.
2021-05-08 17:09:14 +02:00
..
Requests Fix temp files from beatmap listing imports not being cleaned up 2021-05-08 17:09:14 +02:00
APIAccess.cs Update usages of config with framework changes 2021-03-17 16:10:16 +09:00
APIDownloadRequest.cs Make `TriggerSuccess(filename)` protected and expose in test instead 2021-01-17 22:10:30 +03:00
APIMessagesRequest.cs
APIMod.cs Take current mod settings value into account on equality comparsion 2021-04-12 20:51:13 +03:00
APIRequest.cs Avoid firing any kind of failures after success 2021-03-23 17:50:31 +09:00
ArchiveDownloadRequest.cs Enforce one missed property back to single-floating type 2021-01-18 22:07:25 +03:00
DummyAPIAccess.cs Add return bool to HandleRequest to better trigger failures 2021-03-23 18:17:29 +09:00
IAPIProvider.cs Add missing nullability flag on CreateAccount return value 2021-02-15 17:02:07 +09:00
ModSettingsDictionaryFormatter.cs Extract mod setting value handling to utils class 2021-04-12 03:37:03 +03:00
OAuth.cs
OAuthToken.cs
OsuJsonWebRequest.cs
OsuWebRequest.cs
RegistrationRequest.cs