mirror of
https://github.com/ppy/osu.git
synced 2025-03-05 10:53:10 +08:00
CI fixes
This commit is contained in:
parent
8b048a6706
commit
9670ea9a2a
@ -1,11 +1,9 @@
|
|||||||
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using osu.Framework.IO.Network;
|
using osu.Framework.IO.Network;
|
||||||
using osu.Game.Database;
|
using osu.Game.Database;
|
||||||
using osu.Game.Rulesets.Scoring;
|
|
||||||
|
|
||||||
namespace osu.Game.Online.API.Requests
|
namespace osu.Game.Online.API.Requests
|
||||||
{
|
{
|
||||||
@ -13,25 +11,13 @@ namespace osu.Game.Online.API.Requests
|
|||||||
{
|
{
|
||||||
private readonly BeatmapInfo beatmap;
|
private readonly BeatmapInfo beatmap;
|
||||||
|
|
||||||
private string lookupString;
|
private string lookupString => beatmap.OnlineBeatmapID > 0 ? beatmap.OnlineBeatmapID.ToString() : $@"lookup?checksum={beatmap.Hash}&filename={beatmap.Path}";
|
||||||
|
|
||||||
public GetBeatmapDetailsRequest(BeatmapInfo beatmap)
|
public GetBeatmapDetailsRequest(BeatmapInfo beatmap)
|
||||||
{
|
{
|
||||||
this.beatmap = beatmap;
|
this.beatmap = beatmap;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override WebRequest CreateWebRequest()
|
|
||||||
{
|
|
||||||
if (beatmap.OnlineBeatmapID > 0)
|
|
||||||
lookupString = beatmap.OnlineBeatmapID.ToString();
|
|
||||||
else
|
|
||||||
lookupString = $@"lookup?checksum={beatmap.Hash}&filename={beatmap.Path}";
|
|
||||||
|
|
||||||
var req = base.CreateWebRequest();
|
|
||||||
|
|
||||||
return req;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override string Target => $@"beatmaps/{lookupString}";
|
protected override string Target => $@"beatmaps/{lookupString}";
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -43,8 +29,8 @@ namespace osu.Game.Online.API.Requests
|
|||||||
{
|
{
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
this.Fails = value.Fails;
|
Fails = value.Fails;
|
||||||
this.Retries = value.Retries;
|
Retries = value.Retries;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -54,7 +40,7 @@ namespace osu.Game.Online.API.Requests
|
|||||||
{
|
{
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
this.Ratings = value.Ratings;
|
Ratings = value.Ratings;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -17,7 +17,6 @@ using System.Linq;
|
|||||||
using osu.Game.Online.API;
|
using osu.Game.Online.API;
|
||||||
using osu.Game.Online.API.Requests;
|
using osu.Game.Online.API.Requests;
|
||||||
using osu.Framework.Threading;
|
using osu.Framework.Threading;
|
||||||
using System;
|
|
||||||
|
|
||||||
namespace osu.Game.Screens.Select
|
namespace osu.Game.Screens.Select
|
||||||
{
|
{
|
||||||
@ -83,9 +82,9 @@ namespace osu.Game.Screens.Select
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
requestedBeatmap.Metrics = res;
|
requestedBeatmap.Metrics = res;
|
||||||
Schedule(() => updateMetrics(res, true));
|
Schedule(() => updateMetrics(res));
|
||||||
};
|
};
|
||||||
lookup.Failure += e => updateMetrics(null, true);
|
lookup.Failure += e => updateMetrics(null);
|
||||||
|
|
||||||
api.Queue(lookup);
|
api.Queue(lookup);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user