Run formatter
ci/woodpecker/push/woodpecker Pipeline was successful Details

This commit is contained in:
Elara 2023-07-11 13:15:06 -07:00
parent 7a65835816
commit e8cb614b2e
2 changed files with 9 additions and 8 deletions

View File

@ -25,12 +25,12 @@ import (
"net/http"
"os"
"github.com/go-chi/chi/v5"
"github.com/twitchtv/twirp"
"go.elara.ws/logger"
"go.elara.ws/logger/log"
"go.elara.ws/lure/internal/api"
"go.elara.ws/lure/internal/repos"
"github.com/go-chi/chi/v5"
)
func init() {
@ -61,12 +61,12 @@ func main() {
sigCh := make(chan struct{}, 200)
go repoPullWorker(ctx, sigCh)
apiServer := api.NewAPIServer(
lureWebAPI{db: gdb},
twirp.WithServerPathPrefix(""),
)
r := chi.NewRouter()
r.With(allowAllCORSHandler, withAcceptLanguage).Handle("/*", apiServer)
r.Post("/webhook", handleWebhook(sigCh))

View File

@ -1,19 +1,20 @@
package dl
import (
"errors"
"fmt"
"os"
"os/exec"
"path/filepath"
"regexp"
"strings"
"errors"
)
var urlMatchRegex = regexp.MustCompile(`(magnet|torrent\+https?):.*`)
var ErrAria2NotFound = errors.New("aria2 must be installed for torrent functionality")
var ErrDestinationEmpty = errors.New("the destination directory is empty")
var (
urlMatchRegex = regexp.MustCompile(`(magnet|torrent\+https?):.*`)
ErrAria2NotFound = errors.New("aria2 must be installed for torrent functionality")
ErrDestinationEmpty = errors.New("the destination directory is empty")
)
type TorrentDownloader struct{}