diff --git a/api/download_subreddit_images.go b/api/download_subreddit_images.go index 30556b3..f4c2a8b 100644 --- a/api/download_subreddit_images.go +++ b/api/download_subreddit_images.go @@ -44,7 +44,7 @@ func (api *API) DownloadSubredditImages(ctx context.Context, subreddit *models.S } if len(devices) == 0 { - return errs.Wrapw(ErrNoDevices, "downloading images requires at least one device configured").Code(http.StatusBadRequest) + return errs.Wrapw(ErrNoDevices, "downloading images requires at least one device configured and enabled").Code(http.StatusBadRequest) } ctx, span := tracer.Start(ctx, "*API.DownloadSubredditImages", trace.WithAttributes(attribute.String("subreddit", subreddit.Name))) diff --git a/api/pubsub_download.go b/api/pubsub_download.go index d10970a..8fe78d0 100644 --- a/api/pubsub_download.go +++ b/api/pubsub_download.go @@ -58,7 +58,7 @@ func (api *API) StartSubredditDownloadPubsub(messages <-chan *message.Message) { log.New(ctx).Err(err).Error("failed to set schedule status", "subreddit", subreddit.Name, "status", ScheduleStatusDownloading.String()) } - devices, err := models.Devices.Query(ctx, api.db).All() + devices, err := models.Devices.Query(ctx, api.db, models.SelectWhere.Devices.Enable.EQ(1)).All() if err != nil { log.New(ctx).Err(err).Error("failed to query devices") return