fix: 清理动态

This commit is contained in:
shanmite 2021-05-18 19:15:38 +08:00
parent 583f690040
commit 83dff8ce5c
3 changed files with 12 additions and 7 deletions

View File

@ -58,19 +58,24 @@ async function clear() {
const { type, dynamic_id, createtime } = res;
if (type === 1) {
const { origin_uid } = res;
if ((now - createtime) > 86400 * clear_max_day) {
//移除动态
if (clear_remove_dynamic)
if (clear_remove_all_force
|| (now - createtime) > 86400 * clear_max_day) {
/* 移除动态 */
if (clear_remove_dynamic) {
success = await BiliAPI.rmDynamic(dynamic_id)
}
//取消关注
/* 取消关注 */
if (clear_remove_attention
&& (clear_remove_all_force
|| (before_separate.indexOf(origin_uid) === -1
&& uid_list.indexOf(origin_uid) > -1)))
&& uid_list.indexOf(origin_uid) > -1))) {
success = await BiliAPI.cancelAttention(origin_uid);
}
/* 延时 */
await Base.delay(8e3);
if (!success) break;
} else {
before_separate.push(origin_uid)

View File

@ -1,3 +1,3 @@
#!/bin/bash
npm i
npm run clean
npm run clear

View File

@ -3,7 +3,7 @@ $host.UI.RawUI.BackgroundColor = "Black"
$host.UI.RawUI.WindowTitle = "清理动态"
npm i
npm run clean
npm run clear
# 暂停
pause