MCPcopy Create free account
hub / github.com/develop202/migu_video / update

Function update

utils/updateData.js:192–241  ·  view source on GitHub ↗

* @param {Number} hours - 更新小时数

(hours)

Source from the content-addressed store, hash-verified

190 * @param {Number} hours - 更新小时数
191 */
192async function update(hours) {
193 // 处理忽略列表
194 if (ignoreCategory != null) {
195 if (ignoreCategory.indexOf(",") !== -1) {
196 const ignoreCategorySplit = ignoreCategory.split(",")
197 for (const categoryString of ignoreCategorySplit) {
198 if (categoryString != "") {
199 if (!ignoreCategorySet.has(categoryString)) {
200 ignoreCategorySet.add(categoryString)
201 }
202 }
203 }
204 } else if (ignoreCategory.indexOf(",") !== -1) {
205 const ignoreCategorySplit = ignoreCategory.split(",")
206 for (const categoryString of ignoreCategorySplit) {
207 if (categoryString != "") {
208 if (!ignoreCategorySet.has(categoryString)) {
209 ignoreCategorySet.add(categoryString)
210 }
211 }
212 }
213 } else {
214 ignoreCategorySet.add(ignoreCategory)
215 }
216 }
217
218 if (!(hours % 720)) {
219 // 每720小时(一个月)刷新token
220 if (userId && token) {
221 if (mrefreshToken) {
222 await refreshToken(userId, token) ? printGreen("token刷新成功") : printRed("token刷新失败")
223 } else {
224 printGreen(`跳过token刷新`)
225 }
226 }
227 }
228
229 // 未设置TV
230 if (ignoreCategorySet.has("TV")) {
231 printYellow(`TV更新已屏蔽`)
232 } else {
233 await updateTV(hours)
234 }
235 // 未设置PE
236 if (ignoreCategorySet.has("PE")) {
237 printYellow(`PE更新已屏蔽`)
238 } else {
239 await updatePE(hours)
240 }
241}
242
243export default update

Callers 1

app.jsFile · 0.85

Calls 6

printGreenFunction · 0.90
printRedFunction · 0.90
printYellowFunction · 0.90
refreshTokenFunction · 0.85
updateTVFunction · 0.85
updatePEFunction · 0.85

Tested by

no test coverage detected