Add date/time flag to command and update functions

This commit is contained in:
Dan Jones 2026-03-01 08:52:59 -06:00
commit 21d27f8068
5 changed files with 13 additions and 10 deletions

View file

@ -2,21 +2,21 @@ package ytdlp
import (
"context"
"time"
"codeberg.org/danjones000/my-log/files"
"codeberg.org/danjones000/my-log/models"
ytd "github.com/lrstanley/go-ytdlp"
)
// Drop adds the URL specified by the url to the watched log.
func Drop(ctx context.Context, url string) (models.Log, error) {
func Drop(ctx context.Context, url string, now time.Time) (models.Log, error) {
select {
case <-ctx.Done():
return models.Log{}, context.Cause(ctx)
default:
}
log, err := GetLog(ctx, url)
log, err := GetLog(ctx, url, now)
if err != nil {
return log, err
}