百度保证每次使用只会清理一次文件夹
This commit is contained in:
parent
2b88bf1c9d
commit
ed88ad03cf
|
|
@ -23,7 +23,8 @@ object BaiduDrive {
|
||||||
"Referer" to "https://pan.baidu.com/"
|
"Referer" to "https://pan.baidu.com/"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
//是否删除过文件标志
|
||||||
|
private var deleteTag = 0;
|
||||||
private val saveDirName = "TVBOX_BD"
|
private val saveDirName = "TVBOX_BD"
|
||||||
|
|
||||||
private var cookies = BaiDuYunHandler.get().token
|
private var cookies = BaiDuYunHandler.get().token
|
||||||
|
|
@ -165,7 +166,8 @@ object BaiduDrive {
|
||||||
// 处理items
|
// 处理items
|
||||||
items.forEach { item ->
|
items.forEach { item ->
|
||||||
if (item.asJsonObject["isdir"].asInt == 1) {
|
if (item.asJsonObject["isdir"].asInt == 1) {
|
||||||
val folderPath = "/sharelink$uk-${item.asJsonObject["fs_id"].asString}/${item.asJsonObject["server_filename"].asString}"
|
val folderPath =
|
||||||
|
"/sharelink$uk-${item.asJsonObject["fs_id"].asString}/${item.asJsonObject["server_filename"].asString}"
|
||||||
if (folderPath !in seenFolders) {
|
if (folderPath !in seenFolders) {
|
||||||
seenFolders.add(folderPath)
|
seenFolders.add(folderPath)
|
||||||
pendingFolders.add(
|
pendingFolders.add(
|
||||||
|
|
@ -426,9 +428,12 @@ object BaiduDrive {
|
||||||
)
|
)
|
||||||
// 先清空文件夹在创建文件夹
|
// 先清空文件夹在创建文件夹
|
||||||
|
|
||||||
_deleteTransferFile("/$saveDirName")
|
if (deleteTag == 0) {
|
||||||
//创建路径
|
_deleteTransferFile("/$saveDirName")
|
||||||
createSaveDir()
|
//创建路径
|
||||||
|
createSaveDir()
|
||||||
|
deleteTag = 1
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
val data =
|
val data =
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue