We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 245018a commit cb44425Copy full SHA for cb44425
1 file changed
app/modules/alist2strm/mode.py
@@ -1,9 +1,11 @@
1
from enum import Enum
2
3
+
4
class Alist2StrmMode(Enum):
5
"""
6
模块 alist2strm 的运行模式
7
8
9
AlistURL = "AlistURL"
10
RawURL = "RawURL"
11
AlistPath = "AlistPath"
@@ -17,4 +19,7 @@ def from_str(cls, mode_str: str) -> "Alist2StrmMode":
17
19
:return: Alist2StrmMode 枚举值
18
20
例如,"alisturl" 将返回 Alist2StrmMode.AlistURL
21
- return cls[mode_str.upper()] if mode_str.upper() in cls.__members__ else cls.AlistURL
22
+ for member_name, member_value in cls.__members__.items():
23
+ if member_name.lower() == mode_str.lower():
24
+ return member_value
25
+ return cls.AlistURL
0 commit comments