package ytdlp import ( "context" "time" "codeberg.org/danjones000/my-log/files" "codeberg.org/danjones000/my-log/models" ) // Drop adds the URL specified by the url to the watched log. 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, now) if err != nil { return log, err } if err := files.Append(log); err != nil { return log, err } return log, nil }