41 lines
1.3 KiB
Go
41 lines
1.3 KiB
Go
package resolver
|
|
|
|
// This file will be automatically regenerated based on the schema, any resolver implementations
|
|
// will be copied through when generating and any unknown code will be moved to the end.
|
|
// Code generated by github.com/99designs/gqlgen version v0.17.72
|
|
|
|
import (
|
|
"context"
|
|
|
|
graphql1 "git.kmsign.ru/royalcat/tstor/plugins/qbittorrent/delivery/graphql"
|
|
"git.kmsign.ru/royalcat/tstor/plugins/qbittorrent/delivery/graphql/model"
|
|
)
|
|
|
|
// Cleanup is the resolver for the cleanup field.
|
|
func (r *mutationResolver) Cleanup(ctx context.Context, run bool) (*model.CleanupResponse, error) {
|
|
hahses, err := r.QBitTorrentDaemon.Cleanup(ctx, run)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return &model.CleanupResponse{
|
|
Count: int64(len(hahses)),
|
|
Hashes: hahses,
|
|
}, nil
|
|
}
|
|
|
|
// CleanupUnregistred is the resolver for the cleanupUnregistred field.
|
|
func (r *mutationResolver) CleanupUnregistred(ctx context.Context, run bool) (*model.CleanupUnregistredResponse, error) {
|
|
hahses, err := r.QBitTorrentDaemon.CleanupUnregistred(ctx, run)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return &model.CleanupUnregistredResponse{
|
|
Count: int64(len(hahses)),
|
|
Hashes: hahses,
|
|
}, nil
|
|
}
|
|
|
|
// Mutation returns graphql1.MutationResolver implementation.
|
|
func (r *Resolver) Mutation() graphql1.MutationResolver { return &mutationResolver{r} }
|
|
|
|
type mutationResolver struct{ *Resolver }
|