osu/osu.Game/Online/API/Requests
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
..
Responses Fix missed occurrence 2021-02-17 14:30:52 +09:00
CommentVoteRequest.cs
CreateChannelRequest.cs
CreateNewPrivateMessageRequest.cs
CreateNewPrivateMessageResponse.cs
Cursor.cs
DownloadBeatmapSetRequest.cs Fix temp files from beatmap listing imports not being cleaned up 2021-05-08 17:09:14 +02:00
DownloadReplayRequest.cs
GetBeatmapRequest.cs
GetBeatmapSetRequest.cs Add a testable realtime room manager 2020-12-19 01:17:24 +09:00
GetChangelogBuildRequest.cs
GetChangelogRequest.cs
GetCommentsRequest.cs
GetCountriesResponse.cs
GetCountryRankingsRequest.cs
GetFriendsRequest.cs
GetMessagesRequest.cs
GetNewsRequest.cs
GetNewsResponse.cs
GetRankingsRequest.cs
GetScoresRequest.cs
GetSeasonalBackgroundsRequest.cs Add GetSeasonalBackgroundsRequest 2020-10-22 18:25:01 +02:00
GetSpotlightRankingsRequest.cs
GetSpotlightRankingsResponse.cs
GetSpotlightsRequest.cs
GetTopUsersRequest.cs Rename top user request to make way for new type 2020-11-06 17:00:29 +09:00
GetTopUsersResponse.cs Rename top user request to make way for new type 2020-11-06 17:00:29 +09:00
GetUpdatesRequest.cs
GetUpdatesResponse.cs
GetUserBeatmapsRequest.cs
GetUserKudosuHistoryRequest.cs
GetUserMostPlayedBeatmapsRequest.cs
GetUserRankingsRequest.cs Rename top user request to make way for new type 2020-11-06 17:00:29 +09:00
GetUserRecentActivitiesRequest.cs
GetUserRequest.cs
GetUserScoresRequest.cs
GetUsersRequest.cs Refactor request string logic to avoid linq usage 2020-11-09 12:23:29 +09:00
GetUsersResponse.cs Add and consume multi-lookup API endpoint 2020-11-06 17:00:29 +09:00
JoinChannelRequest.cs
LeaveChannelRequest.cs
ListChannelsRequest.cs
MarkChannelAsReadRequest.cs
PaginatedAPIRequest.cs
PostBeatmapFavouriteRequest.cs
PostMessageRequest.cs
ResponseWithCursor.cs
SearchBeatmapSetsRequest.cs Add new beatmap search filter row "General" 2021-03-25 23:20:10 +01:00
SearchBeatmapSetsResponse.cs