mirror of
https://github.com/Alvin-Zilverstand/Twitter-X-Media-Batch-Downloader.git
synced 2026-12-02 19:11:28 +01:00
v4.5
This commit is contained in:
1 parent
84b067ebd4
commit
e67d09a248
47 files changed
+3688
-958
No files matched your search
+8
-4
@@ -175,6 +175,12 @@ func DownloadMediaWithMetadataProgressAndStatus(items []MediaItem, outputDir str
|
||||
}
|
||||
|
||||
var status string
|
||||
markCompleted := func() {
|
||||
completed := atomic.AddInt64(&completedCount, 1)
|
||||
if progress != nil {
|
||||
progress(int(completed), total)
|
||||
}
|
||||
}
|
||||
|
||||
if _, err := os.Stat(task.outputPath); err == nil {
|
||||
status = "skipped"
|
||||
@@ -183,6 +189,7 @@ func DownloadMediaWithMetadataProgressAndStatus(items []MediaItem, outputDir str
|
||||
itemStatus(task.item.TweetID, task.index, status)
|
||||
}
|
||||
atomic.AddInt64(&skippedCount, 1)
|
||||
markCompleted()
|
||||
continue
|
||||
} else if task.item.Type == "text" {
|
||||
|
||||
@@ -214,10 +221,7 @@ func DownloadMediaWithMetadataProgressAndStatus(items []MediaItem, outputDir str
|
||||
itemStatus(task.item.TweetID, task.index, status)
|
||||
}
|
||||
|
||||
completed := atomic.AddInt64(&completedCount, 1)
|
||||
if progress != nil {
|
||||
progress(int(completed), total)
|
||||
}
|
||||
markCompleted()
|
||||
}
|
||||
}()
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user