Skip to content

Commit 54ec906

Browse files
committed
148.1
1 parent 142471f commit 54ec906

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

Online/Controllers/VoKino.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ async public ValueTask<ActionResult> Index(bool checksearch, long kinopoisk_id,
5555
if (kinopoisk_id == 0 || string.IsNullOrEmpty(init.token))
5656
return OnError();
5757

58-
if (balancer is "filmix" or "ashdi" or "vibix" or "monframe")
58+
if (balancer is "filmix" or "ashdi" or "monframe")
5959
init.streamproxy = false;
6060

6161
if (checksearch && balancer != "vokino")

Shared/BaseController.cs

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ public class BaseController : Controller, IDisposable
2626
{
2727
IServiceScope serviceScope;
2828

29-
public static string appversion => "147";
29+
public static string appversion => "148";
3030

31-
public static string minorversion => "18";
31+
public static string minorversion => "1";
3232

3333
public HybridCache hybridCache { get; private set; }
3434

@@ -52,23 +52,26 @@ public BaseController()
5252
}
5353

5454
#region mylocalip
55+
static string lastMyIp = null;
56+
5557
async public ValueTask<string> mylocalip()
5658
{
5759
string key = "BaseController:mylocalip";
58-
if (!hybridCache.TryGetValue(key, out string userIp))
60+
if (!memoryCache.TryGetValue(key, out string userIp))
5961
{
6062
userIp = await InvkEvent.MyLocalIp(new EventMyLocalIp(requestInfo, HttpContext.Request, HttpContext, hybridCache));
6163

62-
if (string.IsNullOrWhiteSpace(userIp))
64+
if (string.IsNullOrEmpty(userIp))
6365
{
6466
var myip = await Http.Get<JObject>("https://api.ipify.org/?format=json");
65-
if (myip == null || string.IsNullOrWhiteSpace(myip.Value<string>("ip")))
66-
return null;
67+
if (myip == null || string.IsNullOrEmpty(myip.Value<string>("ip")))
68+
return lastMyIp;
6769

6870
userIp = myip.Value<string>("ip");
71+
lastMyIp = userIp;
6972
}
7073

71-
hybridCache.Set(key, userIp, DateTime.Now.AddMinutes(15));
74+
memoryCache.Set(key, userIp, DateTime.Now.AddMinutes(5));
7275
}
7376

7477
return userIp;

0 commit comments

Comments
 (0)