From a06990c8c25d660262a627b7a3028c3bd35404ee Mon Sep 17 00:00:00 2001 From: immisterio <96652250+immisterio@users.noreply.github.com> Date: Wed, 4 Oct 2023 13:53:50 +0300 Subject: [PATCH] fix search --- SISI/Controllers/BongaCams/ListController.cs | 5 ++++- SISI/Controllers/Chaturbate/ListController.cs | 5 ++++- SISI/Controllers/Ebalovo/ListController.cs | 2 +- SISI/Controllers/Eporner/ListController.cs | 2 +- SISI/Controllers/HQporner/ListController.cs | 2 +- SISI/Controllers/PornHub/ListController.cs | 4 ++-- SISI/Controllers/Porntrex/ListController.cs | 2 +- SISI/Controllers/Spankbang/ListController.cs | 2 +- SISI/Controllers/Xhamster/ListController.cs | 2 +- SISI/Controllers/Xnxx/ListController.cs | 2 +- SISI/Controllers/Xvideos/ListController.cs | 2 +- SISI/SisiApi.cs | 4 ++-- 12 files changed, 20 insertions(+), 14 deletions(-) diff --git a/SISI/Controllers/BongaCams/ListController.cs b/SISI/Controllers/BongaCams/ListController.cs index 33900635..d9065c5d 100644 --- a/SISI/Controllers/BongaCams/ListController.cs +++ b/SISI/Controllers/BongaCams/ListController.cs @@ -15,11 +15,14 @@ public class ListController : BaseSisiController { [HttpGet] [Route("bgs")] - async public Task Index(string sort, int pg = 1) + async public Task Index(string search, string sort, int pg = 1) { if (!AppInit.conf.BongaCams.enable) return OnError("disable"); + if (!string.IsNullOrEmpty(search)) + return OnError("no search"); + var proxyManager = new ProxyManager("bgs", AppInit.conf.BongaCams); var proxy = proxyManager.Get(); diff --git a/SISI/Controllers/Chaturbate/ListController.cs b/SISI/Controllers/Chaturbate/ListController.cs index c0690430..6d38ddb1 100644 --- a/SISI/Controllers/Chaturbate/ListController.cs +++ b/SISI/Controllers/Chaturbate/ListController.cs @@ -15,11 +15,14 @@ public class ListController : BaseSisiController { [HttpGet] [Route("chu")] - async public Task Index(string sort, int pg = 1) + async public Task Index(string search, string sort, int pg = 1) { if (!AppInit.conf.Chaturbate.enable) return OnError("disable"); + if (!string.IsNullOrEmpty(search)) + return OnError("no search"); + string memKey = $"Chaturbate:list:{sort}:{pg}"; if (!memoryCache.TryGetValue(memKey, out List playlists)) { diff --git a/SISI/Controllers/Ebalovo/ListController.cs b/SISI/Controllers/Ebalovo/ListController.cs index 6be667c6..a1ec9569 100644 --- a/SISI/Controllers/Ebalovo/ListController.cs +++ b/SISI/Controllers/Ebalovo/ListController.cs @@ -38,7 +38,7 @@ async public Task Index(string search, string sort, string c, int pg memoryCache.Set(memKey, playlists, DateTime.Now.AddMinutes(AppInit.conf.multiaccess ? 10 : 2)); } - return OnResult(playlists, EbalovoTo.Menu(host, sort, c)); + return OnResult(playlists, string.IsNullOrEmpty(search) ? EbalovoTo.Menu(host, sort, c) : null); } } } diff --git a/SISI/Controllers/Eporner/ListController.cs b/SISI/Controllers/Eporner/ListController.cs index bcabfa03..7239de3c 100644 --- a/SISI/Controllers/Eporner/ListController.cs +++ b/SISI/Controllers/Eporner/ListController.cs @@ -39,7 +39,7 @@ async public Task Index(string search, string sort, string c, int pg memoryCache.Set(memKey, playlists, DateTime.Now.AddMinutes(AppInit.conf.multiaccess ? 10 : 2)); } - return OnResult(playlists, EpornerTo.Menu(host, sort, c)); + return OnResult(playlists, string.IsNullOrEmpty(search) ? EpornerTo.Menu(host, sort, c) : null); } } } diff --git a/SISI/Controllers/HQporner/ListController.cs b/SISI/Controllers/HQporner/ListController.cs index 058db31a..565d8580 100644 --- a/SISI/Controllers/HQporner/ListController.cs +++ b/SISI/Controllers/HQporner/ListController.cs @@ -38,7 +38,7 @@ async public Task Index(string search, string sort, string c, int pg memoryCache.Set(memKey, playlists, DateTime.Now.AddMinutes(AppInit.conf.multiaccess ? 10 : 2)); } - return OnResult(playlists, HQpornerTo.Menu(host, sort, c)); + return OnResult(playlists, string.IsNullOrEmpty(search) ? HQpornerTo.Menu(host, sort, c) : null); } } } diff --git a/SISI/Controllers/PornHub/ListController.cs b/SISI/Controllers/PornHub/ListController.cs index 10f0b5bd..e045b80e 100644 --- a/SISI/Controllers/PornHub/ListController.cs +++ b/SISI/Controllers/PornHub/ListController.cs @@ -65,7 +65,7 @@ async public Task Index(string search, string sort, int c, int pg = memoryCache.Set(memKey, playlists, DateTime.Now.AddMinutes(AppInit.conf.multiaccess ? 10 : 2)); } - return OnResult(playlists, PornHubTo.Menu(host, plugin, sort, c)); + return OnResult(playlists, string.IsNullOrEmpty(search) ? PornHubTo.Menu(host, plugin, sort, c) : null); } @@ -94,7 +94,7 @@ async public Task Prem(string search, string sort, string hd, int c, memoryCache.Set(memKey, playlists, DateTime.Now.AddMinutes(AppInit.conf.multiaccess ? 10 : 2)); } - return OnResult(playlists, PornHubTo.Menu(host, "pornhubpremium", sort, c, hd)); + return OnResult(playlists, string.IsNullOrEmpty(search) ? PornHubTo.Menu(host, "pornhubpremium", sort, c, hd) : null); } } } diff --git a/SISI/Controllers/Porntrex/ListController.cs b/SISI/Controllers/Porntrex/ListController.cs index 0eef7f72..0fb71169 100644 --- a/SISI/Controllers/Porntrex/ListController.cs +++ b/SISI/Controllers/Porntrex/ListController.cs @@ -38,7 +38,7 @@ async public Task Index(string search, string sort, string c, int pg memoryCache.Set(memKey, playlists, DateTime.Now.AddMinutes(AppInit.conf.multiaccess ? 10 : 2)); } - return OnResult(playlists, PorntrexTo.Menu(host, sort, c), headers: new List<(string name, string val)> { ("referer", AppInit.conf.Porntrex.host) }); + return OnResult(playlists, string.IsNullOrEmpty(search) ? PorntrexTo.Menu(host, sort, c) : null, headers: new List<(string name, string val)> { ("referer", AppInit.conf.Porntrex.host) }); } } } diff --git a/SISI/Controllers/Spankbang/ListController.cs b/SISI/Controllers/Spankbang/ListController.cs index 32340aa4..2b46d699 100644 --- a/SISI/Controllers/Spankbang/ListController.cs +++ b/SISI/Controllers/Spankbang/ListController.cs @@ -54,7 +54,7 @@ async public Task Index(string search, string sort, int pg = 1) memoryCache.Set(memKey, playlists, DateTime.Now.AddMinutes(AppInit.conf.multiaccess ? 10 : 2)); } - return OnResult(playlists, SpankbangTo.Menu(host, sort)); + return OnResult(playlists, string.IsNullOrEmpty(search) ? SpankbangTo.Menu(host, sort) : null); } } } diff --git a/SISI/Controllers/Xhamster/ListController.cs b/SISI/Controllers/Xhamster/ListController.cs index c7722cd8..8a3ee944 100644 --- a/SISI/Controllers/Xhamster/ListController.cs +++ b/SISI/Controllers/Xhamster/ListController.cs @@ -44,7 +44,7 @@ async public Task Index(string search, string c, string q, string so memoryCache.Set(memKey, playlists, DateTime.Now.AddMinutes(AppInit.conf.multiaccess ? 10 : 2)); } - return OnResult(playlists, XhamsterTo.Menu(host, plugin, c, q, sort)); + return OnResult(playlists, string.IsNullOrEmpty(search) ? XhamsterTo.Menu(host, plugin, c, q, sort) : null); } } } diff --git a/SISI/Controllers/Xnxx/ListController.cs b/SISI/Controllers/Xnxx/ListController.cs index 4a087cb0..671b2f9f 100644 --- a/SISI/Controllers/Xnxx/ListController.cs +++ b/SISI/Controllers/Xnxx/ListController.cs @@ -38,7 +38,7 @@ async public Task Index(string search, int pg = 1) memoryCache.Set(memKey, playlists, DateTime.Now.AddMinutes(AppInit.conf.multiaccess ? 10 : 2)); } - return OnResult(playlists, XnxxTo.Menu(host)); + return OnResult(playlists, string.IsNullOrEmpty(search) ? XnxxTo.Menu(host) : null); } } } diff --git a/SISI/Controllers/Xvideos/ListController.cs b/SISI/Controllers/Xvideos/ListController.cs index af09becf..bc1ad8c1 100644 --- a/SISI/Controllers/Xvideos/ListController.cs +++ b/SISI/Controllers/Xvideos/ListController.cs @@ -43,7 +43,7 @@ async public Task Index(string search, string sort, string c, int pg memoryCache.Set(memKey, playlists, DateTime.Now.AddMinutes(AppInit.conf.multiaccess ? 10 : 2)); } - return OnResult(playlists, XvideosTo.Menu(host, plugin, sort, c)); + return OnResult(playlists, string.IsNullOrEmpty(search) ? XvideosTo.Menu(host, plugin, sort, c) : null); } } } diff --git a/SISI/SisiApi.cs b/SISI/SisiApi.cs index 47c81c80..8634d96a 100644 --- a/SISI/SisiApi.cs +++ b/SISI/SisiApi.cs @@ -57,8 +57,8 @@ public ActionResult Index() { channels.Add(new { - title = "Sexy Time", - playlist_url = "http://vi.sisi.am/xdb" + title = "faphouse.com", + playlist_url = "https://vi.sisi.am/fph" }); }