From 04172f16140b19014ad8431d8702525a251832d2 Mon Sep 17 00:00:00 2001 From: xuyanling Date: Tue, 9 Jan 2024 00:38:43 +0800 Subject: [PATCH] =?UTF-8?q?ref(sitelist):=20=E4=BC=98=E5=8C=96=E7=AB=99?= =?UTF-8?q?=E7=82=B9=E8=B5=84=E6=BA=90=E9=A1=B5=E9=9D=A2=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=20-=20=E5=8E=BB=E9=99=A4=E6=8F=92=E4=BB=B6=E7=9A=84=E7=AB=99?= =?UTF-8?q?=E7=82=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/indexer/client/builtin.py | 4 ++-- app/indexer/indexer.py | 13 +++++++++---- web/main.py | 2 +- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/app/indexer/client/builtin.py b/app/indexer/client/builtin.py index 6a952cd2..423cba8d 100755 --- a/app/indexer/client/builtin.py +++ b/app/indexer/client/builtin.py @@ -61,7 +61,7 @@ def get_status(self): """ return True - def get_indexers(self, check=True, indexer_id=None, public=True): + def get_indexers(self, check=True, indexer_id=None, public=True, plugin=True): ret_indexers = [] # 选中站点配置 indexer_sites = SystemConfig().get(SystemConfigKey.UserIndexerSites) or [] @@ -107,7 +107,7 @@ def get_indexers(self, check=True, indexer_id=None, public=True): _indexer_domains.append(indexer.get("domain")) ret_indexers.append(IndexerConf(datas=indexer)) # 获取插件站点 - if PluginsSpider.get_indexers(): + if plugin: for indexer in PluginsSpider.get_indexers(): if indexer: if check and (not indexer_sites or indexer.get("id") not in indexer_sites): diff --git a/app/indexer/indexer.py b/app/indexer/indexer.py index 062a6c68..fdc5c01a 100644 --- a/app/indexer/indexer.py +++ b/app/indexer/indexer.py @@ -44,19 +44,24 @@ def __build_class(self, ctype, conf): return None @staticmethod - def get_builtin_indexers(check=True, public=True, indexer_id=None): + def get_builtin_indexers(check=True, public=True, plugin=True, indexer_id=None): """ 获取内置索引器的索引站点 """ - return BuiltinIndexer().get_indexers(check=check, public=public, indexer_id=indexer_id) + return BuiltinIndexer().get_indexers( + check=check, + public=public, + plugin=plugin, + indexer_id=indexer_id + ) - def get_indexers(self, check=False, public=True): + def get_indexers(self, check=False, public=True, plugin=True): """ 获取当前索引器的索引站点 """ if not self._client: return [] - return self._client.get_indexers(check=check, public=public) + return self._client.get_indexers(check=check, public=public, plugin=plugin) def get_user_indexer_dict(self): """ diff --git a/web/main.py b/web/main.py index 099368c3..fde7f6ef 100644 --- a/web/main.py +++ b/web/main.py @@ -453,7 +453,7 @@ def sites(): @App.route('/sitelist', methods=['POST', 'GET']) @login_required def sitelist(): - IndexerSites = Indexer().get_indexers(check=False) + IndexerSites = Indexer().get_indexers(check=False, plugin=False) return render_template("site/sitelist.html", Sites=IndexerSites, Count=len(IndexerSites))