Skip to content

Commit

Permalink
skip videos that failed processing
Browse files Browse the repository at this point in the history
  • Loading branch information
tommyblue committed Aug 27, 2024
1 parent ac0d6c2 commit c51c491
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
9 changes: 7 additions & 2 deletions api.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,13 @@ func (w *Worker) saveVideo(image albumImage, folder string) error {
}
dest := fmt.Sprintf("%s/%s", folder, image.Name())

if image.Processing && !w.cfg.ForceVideoDownload { // Skip videos if under processing
return fmt.Errorf("skipping video %s because under processing, %#v", image.Name(), image)
if image.Processing {
if image.Status == "Preprocess" && image.SubStatus == "CanNotProcess" {
return fmt.Errorf("skipping video %s because cannot be processed, %#v", image.Name(), image)
}
if !w.cfg.ForceVideoDownload { // Skip videos if under processing
return fmt.Errorf("skipping video %s because under processing, %#v", image.Name(), image)
}
}

var v albumVideo
Expand Down
2 changes: 2 additions & 0 deletions json_structs.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ type albumImage struct {
Keywords string `json:"Keywords"`
Latitude string `json:"Latitude"`
Longitude string `json:"Longitude"`
Status string `json:"Status"`
SubStatus string `json:"SubStatus"`
Uris struct {
ImageMetadata struct {
Uri string `json:"Uri"`
Expand Down

0 comments on commit c51c491

Please sign in to comment.