Skip to content

Commit

Permalink
fix: prevent duplicated names in clash
Browse files Browse the repository at this point in the history
  • Loading branch information
ImMohammad20000 committed Aug 7, 2024
1 parent eb84a09 commit e37a3da
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions app/subscription/clash.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,12 @@

from app.subscription.funcs import get_grpc_gun
from app.templates import render_template
from config import (CLASH_SETTINGS_TEMPLATE, CLASH_SUBSCRIPTION_TEMPLATE,
MUX_TEMPLATE, USER_AGENT_TEMPLATE)
from config import (
CLASH_SETTINGS_TEMPLATE,
CLASH_SUBSCRIPTION_TEMPLATE,
MUX_TEMPLATE,
USER_AGENT_TEMPLATE
)


class ClashConfiguration(object):
Expand Down Expand Up @@ -173,6 +177,7 @@ def make_node(self,
is_httpupgrade = False

remark = self._remark_validation(name)
self.proxy_remarks.append(remark)
node = {
'name': remark,
'type': type,
Expand Down Expand Up @@ -284,7 +289,6 @@ def add(self, remark: str, address: str, inbound: dict, settings: dict):
return

self.data['proxies'].append(node)
self.proxy_remarks.append(remark)


class ClashMetaConfiguration(ClashConfiguration):
Expand Down Expand Up @@ -379,4 +383,3 @@ def add(self, remark: str, address: str, inbound: dict, settings: dict):
return

self.data['proxies'].append(node)
self.proxy_remarks.append(remark)

0 comments on commit e37a3da

Please sign in to comment.