Compare commits
2 Commits
8efffd0fe4
...
6626077201
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6626077201 | ||
|
|
9c0129f968 |
@@ -56,6 +56,10 @@ func deport(ctx context.Context, p string) error {
|
||||
}
|
||||
|
||||
if err := ffmpeg(ctx, "-y", "-i", ass, srt); err != nil {
|
||||
if ctx.Err() == nil {
|
||||
log.Printf("ffmpeg failed to process %s; removing", ass)
|
||||
os.Remove(ass)
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
|
||||
@@ -50,7 +50,7 @@ func One(ctx context.Context, p string) error {
|
||||
} else if stat, err := os.Stat(p); err != nil {
|
||||
return fmt.Errorf("cannot stat %s: %w", p, err)
|
||||
} else if stat.ModTime() == last.Modified {
|
||||
log.Printf("asses.One(%s) // unmodified since %v", shortp, last.T)
|
||||
//log.Printf("asses.One(%s) // unmodified since %v", shortp, last.T)
|
||||
return nil
|
||||
} else {
|
||||
log.Printf("asses.One(%s) // modified (%v) is now %v", shortp, last.Modified, stat.ModTime())
|
||||
|
||||
@@ -3,6 +3,7 @@ package asses
|
||||
import (
|
||||
"context"
|
||||
"io/fs"
|
||||
"log"
|
||||
"path"
|
||||
"path/filepath"
|
||||
"show-rss/src/asses"
|
||||
@@ -24,7 +25,14 @@ func One(ctx context.Context) error {
|
||||
ctx, can := context.WithDeadline(ctx, asses.Deadline())
|
||||
defer can()
|
||||
|
||||
return OneWith(ctx, rootDs, asses.One)
|
||||
lastD := ""
|
||||
return OneWith(ctx, rootDs, func(ctx context.Context, p string) error {
|
||||
if d := path.Dir(p); d != lastD {
|
||||
log.Printf("asses.One(%s/...)...", d)
|
||||
lastD = d
|
||||
}
|
||||
return asses.One(ctx, p)
|
||||
})
|
||||
}
|
||||
|
||||
func OneWith(ctx context.Context, rootds []string, cb CB) error {
|
||||
|
||||
Reference in New Issue
Block a user