-
Notifications
You must be signed in to change notification settings - Fork 46
Expand file tree
/
Copy path__init__.py
More file actions
199 lines (182 loc) · 6.76 KB
/
__init__.py
File metadata and controls
199 lines (182 loc) · 6.76 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
import uuid
from pathlib import Path
from typing import Dict, List
from hoshino import Service, priv
from hoshino.config import NICKNAME
from hoshino.log import new_logger
### 必须
log = new_logger('maimaiDX')
loga = new_logger('maimaiDXArcade')
BOTNAME = NICKNAME if isinstance(NICKNAME, str) else list(NICKNAME)[0]
SV_HELP = '请使用 帮助maimaiDX 查看帮助'
sv = Service('maimaiDX', manage_priv=priv.ADMIN, enable_on_default=True, help_=SV_HELP)
public_addr = 'https://www.yuzuchan.moe/vote'
# ws
UUID = uuid.uuid1()
# echartsjs
SNAPSHOT_JS = (
"echarts.getInstanceByDom(document.querySelector('div[_echarts_instance_]'))."
"getDataURL({type: 'PNG', pixelRatio: 2, excludeComponents: ['toolbox']})"
)
# 文件路径
Root: Path = Path(__file__).parent
static: Path = Root / 'static'
arcades_json: Path = static / 'arcades.json' # 机厅
config_json: Path = static / 'config.json' # token
alias_file: Path = static / 'music_alias.json' # 别名暂存文件
local_alias_file: Path = static / 'local_music_alias.json' # 本地别名文件
music_file: Path = static / 'music_data.json' # 曲目暂存文件
chart_file: Path = static / 'music_chart.json' # 谱面数据暂存文件
guess_file: Path = static / 'group_guess_switch.json' # 猜歌开关群文件
group_alias_file: Path = static / 'group_alias_switch.json' # 别名推送开关群文件
pie_html_file: Path = static / 'temp_pie.html' # 饼图html文件
# 静态资源路径
maimaidir: Path = static / 'mai' / 'pic'
coverdir: Path = static / 'mai' / 'cover'
ratingdir: Path = static / 'mai' / 'rating'
platedir: Path = static / 'mai' / 'plate'
# 字体路径
SIYUAN: Path = static / 'ResourceHanRoundedCN-Bold.ttf'
SHANGGUMONO: Path = static / 'ShangguMonoSC-Regular.otf'
TBFONT: Path = static / 'Torus SemiBold.otf'
# 常用变量
SONGS_PER_PAGE: int = 25
scoreRank: List[str] = ['d', 'c', 'b', 'bb', 'bbb', 'a', 'aa', 'aaa', 's', 's+', 'ss', 'ss+', 'sss', 'sss+']
score_Rank: List[str] = ['d', 'c', 'b', 'bb', 'bbb', 'a', 'aa', 'aaa', 's', 'sp', 'ss', 'ssp', 'sss', 'sssp']
score_Rank_l: Dict[str, str] = {
'd': 'D',
'c': 'C',
'b': 'B',
'bb': 'BB',
'bbb': 'BBB',
'a': 'A',
'aa': 'AA',
'aaa': 'AAA',
's': 'S',
'sp': 'Sp',
'ss': 'SS',
'ssp': 'SSp',
'sss': 'SSS',
'sssp': 'SSSp'
}
comboRank: List[str] = ['fc', 'fc+', 'ap', 'ap+']
combo_rank: List[str] = ['fc', 'fcp', 'ap', 'app']
syncRank: List[str] = ['fs', 'fs+', 'fdx', 'fdx+']
sync_rank: List[str] = ['fs', 'fsp', 'fsd', 'fsdp']
sync_rank_p: List[str] = ['fs', 'fsp', 'fdx', 'fdxp']
diffs: List[str] = ['Basic', 'Advanced', 'Expert', 'Master', 'Re:Master']
levelList: List[str] = [
'1',
'2',
'3',
'4',
'5',
'6',
'7',
'7+',
'8',
'8+',
'9',
'9+',
'10',
'10+',
'11',
'11+',
'12',
'12+',
'13',
'13+',
'14',
'14+',
'15'
]
achievementList: List[float] = [50.0, 60.0, 70.0, 75.0, 80.0, 90.0, 94.0, 97.0, 98.0, 99.0, 99.5, 100.0, 100.5]
BaseRaSpp: List[float] = [7.0, 8.0, 9.6, 11.2, 12.0, 13.6, 15.2, 16.8, 20.0, 20.3, 20.8, 21.1, 21.6, 22.4]
fcl: Dict[str, str] = {'fc': 'FC', 'fcp': 'FCp', 'ap': 'AP', 'app': 'APp'}
fsl: Dict[str, str] = {'fs': 'FS', 'fsp': 'FSp', 'fsd': 'FSD', 'fdx': 'FSD', 'fsdp': 'FSDp', 'fdxp': 'FSDp', 'sync': 'Sync'}
plate_to_sd_version: Dict[str, str] = {
'初': 'maimai',
'真': 'maimai PLUS',
'超': 'maimai GreeN',
'檄': 'maimai GreeN PLUS',
'橙': 'maimai ORANGE',
'暁': 'maimai ORANGE PLUS',
'晓': 'maimai ORANGE PLUS',
'桃': 'maimai PiNK',
'櫻': 'maimai PiNK PLUS',
'樱': 'maimai PiNK PLUS',
'紫': 'maimai MURASAKi',
'菫': 'maimai MURASAKi PLUS',
'堇': 'maimai MURASAKi PLUS',
'白': 'maimai MiLK',
'雪': 'MiLK PLUS',
'輝': 'maimai FiNALE',
'辉': 'maimai FiNALE'
}
plate_to_dx_version: Dict[str, str] = {
**plate_to_sd_version,
'熊': 'maimai でらっくす',
'華': 'maimai でらっくす PLUS',
'华': 'maimai でらっくす PLUS',
'爽': 'maimai でらっくす Splash',
'煌': 'maimai でらっくす Splash PLUS',
'宙': 'maimai でらっくす UNiVERSE',
'星': 'maimai でらっくす UNiVERSE PLUS',
'祭': 'maimai でらっくす FESTiVAL',
'祝': 'maimai でらっくす FESTiVAL PLUS',
'双': 'maimai でらっくす BUDDiES',
'宴': 'maimai でらっくす BUDDiES PLUS',
'镜': 'maimai でらっくす PRiSM',
'彩': 'maimai でらっくす PRiSM PLUS'
}
version_map = {
'真': ([plate_to_dx_version['真'], plate_to_dx_version['初']], '真'),
'超': ([plate_to_sd_version['超']], '超'),
'檄': ([plate_to_sd_version['檄']], '檄'),
'橙': ([plate_to_sd_version['橙']], '橙'),
'暁': ([plate_to_sd_version['暁']], '暁'),
'桃': ([plate_to_sd_version['桃']], '桃'),
'櫻': ([plate_to_sd_version['櫻']], '櫻'),
'紫': ([plate_to_sd_version['紫']], '紫'),
'菫': ([plate_to_sd_version['菫']], '菫'),
'白': ([plate_to_sd_version['白']], '白'),
'雪': ([plate_to_sd_version['雪']], '雪'),
'輝': ([plate_to_sd_version['輝']], '輝'),
'霸': (list(set(plate_to_sd_version.values())), '舞'),
'舞': (list(set(plate_to_sd_version.values())), '舞'),
'熊': ([plate_to_dx_version['熊']], '熊&华'),
'华': ([plate_to_dx_version['熊']], '熊&华'),
'華': ([plate_to_dx_version['熊']], '熊&华'),
'爽': ([plate_to_dx_version['爽']], '爽&煌'),
'煌': ([plate_to_dx_version['爽']], '爽&煌'),
'宙': ([plate_to_dx_version['宙']], '宙&星'),
'星': ([plate_to_dx_version['宙']], '宙&星'),
'祭': ([plate_to_dx_version['祭']], '祭&祝'),
'祝': ([plate_to_dx_version['祭']], '祭&祝'),
'双': ([plate_to_dx_version['双']], '双&宴'),
'宴': ([plate_to_dx_version['双']], '双&宴'),
'镜': ([plate_to_dx_version['镜']], '镜&彩'),
'彩': ([plate_to_dx_version['镜']], '镜&彩')
}
platecn = {
'晓': '暁',
'樱': '櫻',
'堇': '菫',
'辉': '輝',
'华': '華'
}
category: Dict[str, str] = {
'流行&动漫': 'anime',
'舞萌': 'maimai',
'niconico & VOCALOID': 'niconico',
'东方Project': 'touhou',
'其他游戏': 'game',
'音击&中二节奏': 'ongeki',
'POPSアニメ': 'anime',
'maimai': 'maimai',
'niconicoボーカロイド': 'niconico',
'東方Project': 'touhou',
'ゲームバラエティ': 'game',
'オンゲキCHUNITHM': 'ongeki',
'宴会場': '宴会场'
}