mirror of
https://github.com/Jerryplusy/rc-plugin.git
synced 2025-10-14 16:19:18 +00:00
🦄 refactor: 重构检索redis代码中
This commit is contained in:
parent
d528d94245
commit
1775a773dd
@ -13,7 +13,6 @@ import { mkdirsSync } from "../utils/file.js";
|
||||
import { downloadBFile, getDownloadUrl, mergeFileToMp4, getDynamic } from "../utils/bilibili.js";
|
||||
import { parseUrl, parseM3u8, downloadM3u8Videos, mergeAcFileToMp4 } from "../utils/acfun.js";
|
||||
import config from "../model/index.js";
|
||||
// import { get, remove, add } from "../utils/redisu.js";
|
||||
|
||||
const transMap = { 中: "zh", 日: "jp", 文: "wyw", 英: "en" };
|
||||
const douyinTypeMap = {
|
||||
|
@ -1,28 +0,0 @@
|
||||
// 批量/单个添加
|
||||
function add (key, values) {
|
||||
if (typeof values instanceof Array) {
|
||||
values.forEach(async (value) => {
|
||||
await redis.set(key, value)
|
||||
})
|
||||
} else {
|
||||
redis.set(key, values)
|
||||
}
|
||||
}
|
||||
|
||||
// 批量/单个删除
|
||||
function remove (key, values) {
|
||||
if (typeof values instanceof Array) {
|
||||
values.forEach(async (values) => {
|
||||
await redis.del(key, values)
|
||||
})
|
||||
} else {
|
||||
redis.del(key, values)
|
||||
}
|
||||
}
|
||||
|
||||
// 批量/单个查询
|
||||
function get (key) {
|
||||
return redis.get(key)
|
||||
}
|
||||
|
||||
export { get, remove, add }
|
Loading…
x
Reference in New Issue
Block a user