Redmage/api/download_subreddit_images.go

28 lines
662 B
Go
Raw Normal View History

2024-04-09 22:37:26 +07:00
package api
import (
"context"
"errors"
"github.com/tigorlazuardi/redmage/db/queries"
"github.com/tigorlazuardi/redmage/pkg/errs"
)
2024-04-09 22:37:26 +07:00
type DownloadSubredditParams struct {
Countback int
NSFW bool
Devices []queries.Device
2024-04-09 22:37:26 +07:00
}
var (
ErrNoDevices = errors.New("api: downloading subreddit images requires at least one device")
ErrDownloadDirNotSet = errors.New("api: downloading subreddit images require download directory to be set")
)
2024-04-09 22:37:26 +07:00
func (api *API) DownloadSubredditImages(ctx context.Context, subredditName string, params DownloadSubredditParams) error {
if len(params.Devices) == 0 {
return errs.Wrap(ErrNoDevices)
}
2024-04-09 22:37:26 +07:00
return nil
}