1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-23 13:27:25 +08:00
osu-lazer/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 Implement CommentVoteRequest and adjust UI 2019-10-17 15:04:30 +03:00
CreateChannelRequest.cs Fetch existing private message channels on re-joining 2020-06-08 17:54:26 +09:00
CreateNewPrivateMessageRequest.cs Update licence header (and remove year) 2019-01-24 17:43:03 +09:00
CreateNewPrivateMessageResponse.cs Update licence header (and remove year) 2019-01-24 17:43:03 +09:00
Cursor.cs Initialise some response parameters 2020-07-31 20:55:44 +09:00
DownloadBeatmapSetRequest.cs Fix temp files from beatmap listing imports not being cleaned up 2021-05-08 17:09:14 +02:00
DownloadReplayRequest.cs Code quality fixes 2019-06-29 12:29:12 +05:30
GetBeatmapRequest.cs Fix beatmap lookups failing for beatmaps with no local path 2019-11-23 20:55:42 +09:00
GetBeatmapSetRequest.cs Add a testable realtime room manager 2020-12-19 01:17:24 +09:00
GetChangelogBuildRequest.cs Initial pass to make work with real API 2019-05-13 16:24:32 +09:00
GetChangelogRequest.cs Initial pass to make work with real API 2019-05-13 16:24:32 +09:00
GetCommentsRequest.cs Remove duplicated api request 2020-02-21 19:27:25 +09:00
GetCountriesResponse.cs Refactor API logic 2019-11-27 21:56:22 +03:00
GetCountryRankingsRequest.cs Update API with latest web changes 2019-11-01 21:49:50 +03:00
GetFriendsRequest.cs Update licence header (and remove year) 2019-01-24 17:43:03 +09:00
GetMessagesRequest.cs Update licence header (and remove year) 2019-01-24 17:43:03 +09:00
GetNewsRequest.cs Implement news api request 2020-07-08 17:58:09 +03:00
GetNewsResponse.cs Implement news api request 2020-07-08 17:58:09 +03:00
GetRankingsRequest.cs Remove stray newline 2020-03-30 16:17:42 +09:00
GetScoresRequest.cs Decouple APILegacyScoreInfo from ScoreInfo 2019-12-03 15:31:11 +09:00
GetSeasonalBackgroundsRequest.cs Add GetSeasonalBackgroundsRequest 2020-10-22 18:25:01 +02:00
GetSpotlightRankingsRequest.cs Make sort changes affect request result 2020-07-14 18:09:09 +03:00
GetSpotlightRankingsResponse.cs API implementation 2020-02-04 16:04:06 +03:00
GetSpotlightsRequest.cs Apply suggestions 2020-01-10 20:46:35 +03:00
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 Update licence header (and remove year) 2019-01-24 17:43:03 +09:00
GetUpdatesResponse.cs Update licence header (and remove year) 2019-01-24 17:43:03 +09:00
GetUserBeatmapsRequest.cs Add loved section 2019-08-01 11:06:29 +03:00
GetUserKudosuHistoryRequest.cs Move enum to response class 2019-09-02 15:57:55 +09:00
GetUserMostPlayedBeatmapsRequest.cs Simplify offset calculation 2019-07-19 16:02:33 +09:00
GetUserRankingsRequest.cs Rename top user request to make way for new type 2020-11-06 17:00:29 +09:00
GetUserRecentActivitiesRequest.cs Add loved enum on BeatmapApproval 2019-11-28 21:59:57 +07:00
GetUserRequest.cs More testing 2020-04-17 19:57:39 +03:00
GetUserScoresRequest.cs Expand requests 2019-08-06 17:47:31 +03:00
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 Fix some web requests retrieving the user too early 2020-07-14 13:07:17 +09:00
LeaveChannelRequest.cs Fix some web requests retrieving the user too early 2020-07-14 13:07:17 +09:00
ListChannelsRequest.cs Update licence header (and remove year) 2019-01-24 17:43:03 +09:00
MarkChannelAsReadRequest.cs Add HTTP method 2020-01-04 00:45:51 +01:00
PaginatedAPIRequest.cs Keep provided IDs where possible if not online 2020-03-30 15:07:39 +09:00
PostBeatmapFavouriteRequest.cs Implement PostBeatmapFavouriteRequest 2019-10-07 15:36:23 +03:00
PostMessageRequest.cs Update licence header (and remove year) 2019-01-24 17:43:03 +09:00
ResponseWithCursor.cs Remove unnecessary generic specification on cursor 2020-05-14 16:01:07 +09:00
SearchBeatmapSetsRequest.cs Add new beatmap search filter row "General" 2021-03-25 23:20:10 +01:00
SearchBeatmapSetsResponse.cs Remove unnecessary generic specification on cursor 2020-05-14 16:01:07 +09:00