mirror of
https://github.com/pikami/tiktok-dl.git
synced 2026-04-23 14:58:47 +01:00
Fixed circular dependency issue
This commit is contained in:
@@ -3,6 +3,7 @@ package utils
|
||||
import (
|
||||
models "../models"
|
||||
config "../models/config"
|
||||
fileio "./fileio"
|
||||
log "./log"
|
||||
)
|
||||
|
||||
@@ -18,7 +19,7 @@ func IsItemInArchive(upload models.Upload) bool {
|
||||
func RemoveArchivedItems(uploads []models.Upload) []models.Upload {
|
||||
archiveFilePath := config.Config.ArchiveFilePath
|
||||
|
||||
if archiveFilePath == "" || !CheckIfExists(archiveFilePath) {
|
||||
if archiveFilePath == "" || !fileio.CheckIfExists(archiveFilePath) {
|
||||
return uploads
|
||||
}
|
||||
|
||||
@@ -31,7 +32,7 @@ func RemoveArchivedItems(uploads []models.Upload) []models.Upload {
|
||||
}
|
||||
|
||||
lenBeforeRemoval := len(uploads)
|
||||
ReadFileLineByLine(archiveFilePath, removeArchivedItemsDelegate)
|
||||
fileio.ReadFileLineByLine(archiveFilePath, removeArchivedItemsDelegate)
|
||||
|
||||
removedCount := lenBeforeRemoval - len(uploads)
|
||||
if removedCount > 0 {
|
||||
@@ -49,5 +50,5 @@ func AddItemToArchive(uploadID string) {
|
||||
return
|
||||
}
|
||||
|
||||
AppendToFile(uploadID, archiveFilePath)
|
||||
fileio.AppendToFile(uploadID, archiveFilePath)
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
"io/ioutil"
|
||||
"os"
|
||||
|
||||
checkErr "./checkErr"
|
||||
checkErr "../checkErr"
|
||||
)
|
||||
|
||||
type delegateString func(string)
|
||||
Reference in New Issue
Block a user