Compare commits

..

1 Commits

Author SHA1 Message Date
Simon Ding
0954632b65 AI intergration WIP 2025-01-07 10:27:18 +08:00
167 changed files with 2663 additions and 9160 deletions

View File

@@ -1,11 +0,0 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
version: 2
updates:
- package-ecosystem: "gomod" # See documentation for possible values
directory: "/" # Location of package manifests
schedule:
interval: "weekly"

View File

@@ -58,6 +58,4 @@ jobs:
platforms: linux/amd64
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: |
TMDB_API_KEY=${{ secrets.TMDB_API_KEY }}

View File

@@ -66,8 +66,6 @@ jobs:
platforms: linux/amd64,linux/arm64,linux/arm/v7,linux/386,linux/s390x,linux/ppc64le
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: |
TMDB_API_KEY=${{ secrets.TMDB_API_KEY }}
- name: Generate artifact attestation
uses: actions/attest-build-provenance@v1

View File

@@ -1,13 +1,11 @@
FROM golang:1.24 as builder
FROM golang:1.23 as builder
# 启用go module
ENV GO111MODULE=on
#GOPROXY=https://goproxy.cn,direct
ENV GO111MODULE=on \
GOPROXY=https://goproxy.cn,direct
WORKDIR /app
ARG TMDB_API_KEY
COPY go.mod .
COPY go.sum .
RUN go mod download
@@ -15,7 +13,7 @@ RUN go mod download
COPY . .
# 指定OS等并go build
RUN CGO_ENABLED=0 go build -o polaris -ldflags="-X polaris/db.Version=$(git describe --tags --long) -X polaris/db.DefaultTmdbApiKey=$(echo $TMDB_API_KEY)" ./cmd/polaris
RUN CGO_ENABLED=0 go build -o polaris -ldflags="-X polaris/db.Version=$(git describe --tags --long)" ./cmd/
FROM debian:stable-slim
@@ -34,4 +32,4 @@ RUN chmod +x /app/entrypoint.sh
VOLUME /app/data
EXPOSE 8080
ENTRYPOINT ["tini","./entrypoint.sh"]
ENTRYPOINT ["tini","./entrypoint.sh"]

View File

@@ -1,6 +0,0 @@
.PHONY: windows
windows:
@echo "Building for Windows..."
go build -tags lib -ldflags="-X polaris/db.Version=$(git describe --tags --long)" -buildmode=c-shared -o ui/windows/libpolaris.dll ./cmd/binding
cd ui && flutter build windows

View File

@@ -21,14 +21,7 @@
## 快速开始
若要体验请确保本机有docker环境然后执行
```bash
docker run -p 8080:8080 ghcr.io/simon-ding/polaris:latest
```
随后访问 http://127.0.0.1:8080 即可快速体验Polaris的功能
正式部署请参考 [【快速开始】](./doc/quick_start.md)
使用此程序参考 [【快速开始】](./doc/quick_start.md)
## Features
@@ -54,10 +47,6 @@ docker run -p 8080:8080 ghcr.io/simon-ding/polaris:latest
- linux/s390x
- linux/ppc64le
## FAQ
- [常见问题 FAQ](./doc/faq.md)
## Todos

View File

@@ -17,7 +17,7 @@ type TMDB struct {
func LoadConfig() (*Config, error) {
viper.SetConfigName("config") // name of config file (without extension)
viper.SetConfigType("yml") // REQUIRED if the config file does not have the extension in the name
viper.SetConfigType("yml") // REQUIRED if the config file does not have the extension in the name
viper.AddConfigPath(".")
viper.AddConfigPath("/app/data")

View File

@@ -1,46 +0,0 @@
package main
import "C"
import (
"polaris/db"
"polaris/log"
"polaris/server"
)
func main() {}
var srv *server.Server
var port int
//export Start
func Start() (C.int, *C.char) {
if srv != nil {
return C.int(port), nil
}
log.InitLogger(true)
log.Infof("------------------- Starting Polaris ---------------------")
dbClient, err := db.Open()
if err != nil {
log.Panicf("init db error: %v", err)
return C.int(0), C.CString(err.Error())
}
s := server.NewServer(dbClient)
if p, err := s.Start(""); err != nil {
return C.int(0), C.CString(err.Error())
} else {
port = p
srv = s
return C.int(p), C.CString("")
}
}
//export Stop
func Stop() {
if srv != nil {
srv.Stop()
}
srv = nil
}

View File

@@ -1 +0,0 @@
package cmd

View File

@@ -1,26 +1,30 @@
package main
import (
"os"
"polaris/db"
"polaris/log"
"polaris/server"
)
func main() {
if os.Getenv("GIN_MODE") == "release" {
log.InitLogger(true)
}
log.Infof("------------------- Starting Polaris ---------------------")
//utils.MaxPermission()
dbClient, err := db.Open()
if err != nil {
log.Panicf("init db error: %v", err)
}
// go func() {
// time.Sleep(2 * time.Second)
// if err := utils.OpenURL("http://127.0.0.1:8080"); err != nil {
// log.Errorf("open url error: %v", err)
// }
// }()
s := server.NewServer(dbClient)
if _, err := s.Start(":8080"); err != nil {
if err := s.Serve(); err != nil {
log.Errorf("server start error: %v", err)
}
select {} //wait indefinitely
}

View File

@@ -1,14 +1,8 @@
package db
import (
"polaris/ent/media"
"polaris/pkg/utils"
)
import "polaris/ent/media"
var (
Version = "undefined"
DefaultTmdbApiKey = ""
)
var Version = "undefined"
const (
SettingTmdbApiKey = "tmdb_api_key"
@@ -30,6 +24,8 @@ const (
SettingMovieSizeLimiter = "movie_size_limiter"
SettingAcceptedVideoFormats = "accepted_video_formats"
SettingAcceptedSubtitleFormats = "accepted_subtitle_formats"
SettingAIConfig = "ai_config"
)
const (
@@ -40,12 +36,9 @@ const (
const (
IndexerTorznabImpl = "torznab"
)
var (
DataPath = utils.GetUserDataDir()
ImgPath = DataPath + "/img"
LogPath = DataPath + "/logs"
DataPath = "./data"
ImgPath = DataPath + "/img"
LogPath = DataPath + "/logs"
)
const (
@@ -106,3 +99,9 @@ type ProwlarrSetting struct {
ApiKey string `json:"api_key"`
URL string `json:"url"`
}
type AIConfig struct {
Enabled bool `json:"enabled"`
GeminiApiKey string `json:"gemini_api_key"`
GeminiModelName string `json:"gemini_model_name"`
}

330
db/db.go
View File

@@ -6,7 +6,6 @@ import (
"fmt"
"os"
"polaris/ent"
"polaris/ent/blacklist"
"polaris/ent/downloadclients"
"polaris/ent/episode"
"polaris/ent/history"
@@ -18,7 +17,6 @@ import (
"polaris/ent/storage"
"polaris/log"
"polaris/pkg/utils"
"slices"
"strings"
"time"
@@ -29,31 +27,30 @@ import (
"github.com/pkg/errors"
)
type client struct {
type Client struct {
ent *ent.Client
}
func Open() (Database, error) {
func Open() (*Client, error) {
os.Mkdir(DataPath, 0777)
cl, err := ent.Open(dialect.SQLite, fmt.Sprintf("file:%v/polaris.db?cache=shared&_fk=1", DataPath))
client, err := ent.Open(dialect.SQLite, fmt.Sprintf("file:%v/polaris.db?cache=shared&_fk=1", DataPath))
if err != nil {
return nil, errors.Wrap(err, "failed opening connection to sqlite")
}
//defer client.Close()
c := &client{
ent: cl,
}
// Run the auto migration tool.
if err := c.migrate(); err != nil {
return nil, errors.Wrap(err, "migrate")
if err := client.Schema.Create(context.Background()); err != nil {
return nil, errors.Wrap(err, "failed creating schema resources")
}
c := &Client{
ent: client,
}
c.init()
return c, nil
}
func (c *client) init() {
func (c *Client) init() {
c.generateJwtSerectIfNotExist()
if err := c.generateDefaultLocalStorage(); err != nil {
log.Errorf("generate default storage: %v", err)
@@ -69,36 +66,17 @@ func (c *client) init() {
log.Infof("set default log level")
c.SetSetting(SettingLogLevel, "info")
}
c.initBuildinClient()
if tr := c.GetAllDonloadClients(); len(tr) == 0 {
log.Warnf("no download client, set default download client")
c.SaveDownloader(&ent.DownloadClients{
Name: "transmission",
Implementation: downloadclients.ImplementationTransmission,
URL: "http://transmission:9091",
})
}
}
func (c *client) initBuildinClient() {
hasBuildin := false
tr := c.GetAllDonloadClients()
for _, d := range tr {
if d.Implementation == downloadclients.ImplementationBuildin {
hasBuildin = true
break
}
}
if !hasBuildin {
log.Warnf("no buildin download client, set default download client")
if err := c.SaveDownloader(&ent.DownloadClients{
Enable: true,
Name: "内建下载器",
Implementation: downloadclients.ImplementationBuildin,
URL: "buildin",
Priority1: 50,
RemoveCompletedDownloads: true,
RemoveFailedDownloads: true,
}); err != nil {
log.Warnf("add buildin client error: %v", err)
}
}
}
func (c *client) generateJwtSerectIfNotExist() {
func (c *Client) generateJwtSerectIfNotExist() {
v := c.GetSetting(JwtSerectKey)
if v == "" {
log.Infof("generate jwt serect")
@@ -107,7 +85,7 @@ func (c *client) generateJwtSerectIfNotExist() {
}
}
func (c *client) generateDefaultLocalStorage() error {
func (c *Client) generateDefaultLocalStorage() error {
n, _ := c.ent.Storage.Query().Count(context.TODO())
if n != 0 {
return nil
@@ -122,7 +100,7 @@ func (c *client) generateDefaultLocalStorage() error {
})
}
func (c *client) GetSetting(key string) string {
func (c *Client) GetSetting(key string) string {
v, err := c.ent.Settings.Query().Where(settings.Key(key)).Only(context.TODO())
if err != nil {
log.Debugf("get setting by key: %s error: %v", key, err)
@@ -131,7 +109,7 @@ func (c *client) GetSetting(key string) string {
return v.Value
}
func (c *client) SetSetting(key, value string) error {
func (c *Client) SetSetting(key, value string) error {
v, err := c.ent.Settings.Query().Where(settings.Key(key)).Only(context.TODO())
if err != nil {
log.Infof("create new setting")
@@ -142,7 +120,7 @@ func (c *client) SetSetting(key, value string) error {
return err
}
func (c *client) GetLanguage() string {
func (c *Client) GetLanguage() string {
lang := c.GetSetting(SettingLanguage)
log.Infof("get application language: %s", lang)
if lang == "" {
@@ -151,7 +129,7 @@ func (c *client) GetLanguage() string {
return lang
}
func (c *client) AddMediaWatchlist(m *ent.Media, episodes []int) (*ent.Media, error) {
func (c *Client) AddMediaWatchlist(m *ent.Media, episodes []int) (*ent.Media, error) {
count := c.ent.Media.Query().Where(media.TmdbID(m.TmdbID)).CountX(context.Background())
if count > 0 {
return nil, fmt.Errorf("tv series %s already in watchlist", m.NameEn)
@@ -186,7 +164,7 @@ func (c *client) AddMediaWatchlist(m *ent.Media, episodes []int) (*ent.Media, er
}
func (c *client) GetMediaWatchlist(mediaType media.MediaType) []*ent.Media {
func (c *Client) GetMediaWatchlist(mediaType media.MediaType) []*ent.Media {
list, err := c.ent.Media.Query().Where(media.MediaTypeEQ(mediaType)).Order(ent.Desc(media.FieldID)).All(context.TODO())
if err != nil {
log.Infof("query wtach list error: %v", err)
@@ -195,19 +173,19 @@ func (c *client) GetMediaWatchlist(mediaType media.MediaType) []*ent.Media {
return list
}
func (c *client) GetEpisode(seriesId, seasonNum, episodeNum int) (*ent.Episode, error) {
func (c *Client) GetEpisode(seriesId, seasonNum, episodeNum int) (*ent.Episode, error) {
return c.ent.Episode.Query().Where(episode.MediaID(seriesId), episode.SeasonNumber(seasonNum),
episode.EpisodeNumber(episodeNum)).First(context.TODO())
}
func (c *client) GetEpisodeByID(epID int) (*ent.Episode, error) {
func (c *Client) GetEpisodeByID(epID int) (*ent.Episode, error) {
return c.ent.Episode.Query().Where(episode.ID(epID)).First(context.TODO())
}
func (c *client) UpdateEpiode(episodeId int, name, overview string) error {
func (c *Client) UpdateEpiode(episodeId int, name, overview string) error {
return c.ent.Episode.Update().Where(episode.ID(episodeId)).SetTitle(name).SetOverview(overview).Exec(context.TODO())
}
func (c *client) UpdateEpiode2(episodeId int, name, overview, airdate string) error {
func (c *Client) UpdateEpiode2(episodeId int, name, overview, airdate string) error {
return c.ent.Episode.Update().Where(episode.ID(episodeId)).SetTitle(name).SetOverview(overview).SetAirDate(airdate).Exec(context.TODO())
}
@@ -216,10 +194,11 @@ type MediaDetails struct {
Episodes []*ent.Episode `json:"episodes"`
}
func (c *client) GetMediaDetails(id int) (*MediaDetails, error) {
func (c *Client) GetMediaDetails(id int) *MediaDetails {
se, err := c.ent.Media.Query().Where(media.ID(id)).First(context.TODO())
if err != nil {
return nil, errors.Errorf("get series %d: %v", id, err)
log.Errorf("get series %d: %v", id, err)
return nil
}
var md = &MediaDetails{
Media: se,
@@ -227,18 +206,19 @@ func (c *client) GetMediaDetails(id int) (*MediaDetails, error) {
ep, err := se.QueryEpisodes().All(context.Background())
if err != nil {
return nil, errors.Errorf("get episodes %d: %v", id, err)
log.Errorf("get episodes %d: %v", id, err)
return nil
}
md.Episodes = ep
return md, nil
return md
}
func (c *client) GetMedia(id int) (*ent.Media, error) {
func (c *Client) GetMedia(id int) (*ent.Media, error) {
return c.ent.Media.Query().Where(media.ID(id)).First(context.TODO())
}
func (c *client) DeleteMedia(id int) error {
func (c *Client) DeleteMedia(id int) error {
_, err := c.ent.Episode.Delete().Where(episode.MediaID(id)).Exec(context.TODO())
if err != nil {
return err
@@ -250,7 +230,7 @@ func (c *client) DeleteMedia(id int) error {
return c.CleanAllDanglingEpisodes()
}
func (c *client) SaveEposideDetail(d *ent.Episode) (int, error) {
func (c *Client) SaveEposideDetail(d *ent.Episode) (int, error) {
ep, err := c.ent.Episode.Create().
SetAirDate(d.AirDate).
SetSeasonNumber(d.SeasonNumber).
@@ -264,7 +244,7 @@ func (c *client) SaveEposideDetail(d *ent.Episode) (int, error) {
return ep.ID, nil
}
func (c *client) SaveEposideDetail2(d *ent.Episode) (int, error) {
func (c *Client) SaveEposideDetail2(d *ent.Episode) (int, error) {
ep, err := c.ent.Episode.Create().
SetAirDate(d.AirDate).
SetSeasonNumber(d.SeasonNumber).
@@ -283,24 +263,22 @@ type TorznabSetting struct {
ApiKey string `json:"api_key"`
}
func (c *client) SaveIndexer(in *ent.Indexers) error {
func (c *Client) SaveIndexer(in *ent.Indexers) error {
count := c.ent.Indexers.Query().Where(indexers.Name(in.Name)).CountX(context.TODO())
if count > 0 {
if in.ID != 0 {
//update setting
return c.ent.Indexers.Update().Where(indexers.Name(in.Name)).SetName(in.Name).SetImplementation(in.Implementation).
SetPriority(in.Priority).SetSeedRatio(in.SeedRatio).SetDisabled(in.Disabled).
SetTvSearch(in.TvSearch).SetMovieSearch(in.MovieSearch).SetSettings("").SetSynced(in.Synced).
SetAPIKey(in.APIKey).SetURL(in.URL).
Exec(context.Background())
return c.ent.Indexers.Update().Where(indexers.ID(in.ID)).SetName(in.Name).SetImplementation(in.Implementation).
SetPriority(in.Priority).SetSettings(in.Settings).SetSeedRatio(in.SeedRatio).SetDisabled(in.Disabled).Exec(context.Background())
}
//create new one
count := c.ent.Indexers.Query().Where(indexers.Name(in.Name)).CountX(context.TODO())
if count > 0 {
return fmt.Errorf("name already esxits: %v", in.Name)
}
_, err := c.ent.Indexers.Create().
SetName(in.Name).SetImplementation(in.Implementation).SetPriority(in.Priority).SetSeedRatio(in.SeedRatio).
SetTvSearch(in.TvSearch).SetMovieSearch(in.MovieSearch).SetSettings("").SetSynced(in.Synced).
SetAPIKey(in.APIKey).SetURL(in.URL).SetDisabled(in.Disabled).Save(context.TODO())
SetName(in.Name).SetImplementation(in.Implementation).SetPriority(in.Priority).SetSettings(in.Settings).SetSeedRatio(in.SeedRatio).
SetDisabled(in.Disabled).Save(context.TODO())
if err != nil {
return errors.Wrap(err, "save db")
}
@@ -308,37 +286,62 @@ func (c *client) SaveIndexer(in *ent.Indexers) error {
return nil
}
func (c *client) DeleteIndexer(id int) {
func (c *Client) DeleteTorznab(id int) {
c.ent.Indexers.Delete().Where(indexers.ID(id)).Exec(context.TODO())
}
func (c *client) GetIndexer(id int) (*ent.Indexers, error) {
func (c *Client) GetIndexer(id int) (*TorznabInfo, error) {
res, err := c.ent.Indexers.Query().Where(indexers.ID(id)).First(context.TODO())
if err != nil {
return nil, err
}
return res, nil
var ss TorznabSetting
err = json.Unmarshal([]byte(res.Settings), &ss)
if err != nil {
return nil, fmt.Errorf("unmarshal torznab %s error: %v", res.Name, err)
}
return &TorznabInfo{Indexers: res, TorznabSetting: ss}, nil
}
func (c *client) GetAllIndexers() []*ent.Indexers {
res := c.ent.Indexers.Query().Where(indexers.Implementation(IndexerTorznabImpl)).Order(ent.Asc(indexers.FieldID)).AllX(context.TODO())
return res
type TorznabInfo struct {
*ent.Indexers
TorznabSetting
}
func (c *client) SaveDownloader(downloader *ent.DownloadClients) error {
func (c *Client) GetAllTorznabInfo() []*TorznabInfo {
res := c.ent.Indexers.Query().Where(indexers.Implementation(IndexerTorznabImpl)).AllX(context.TODO())
var l = make([]*TorznabInfo, 0, len(res))
for _, r := range res {
var ss TorznabSetting
err := json.Unmarshal([]byte(r.Settings), &ss)
if err != nil {
log.Errorf("unmarshal torznab %s error: %v", r.Name, err)
continue
}
l = append(l, &TorznabInfo{
Indexers: r,
TorznabSetting: ss,
})
}
return l
}
func (c *Client) SaveDownloader(downloader *ent.DownloadClients) error {
count := c.ent.DownloadClients.Query().Where(downloadclients.Name(downloader.Name)).CountX(context.TODO())
if count != 0 {
err := c.ent.DownloadClients.Update().Where(downloadclients.Name(downloader.Name)).SetImplementation(downloader.Implementation).
SetURL(downloader.URL).SetUser(downloader.User).SetUseNatTraversal(downloader.UseNatTraversal).SetPassword(downloader.Password).SetPriority1(downloader.Priority1).Exec(context.TODO())
SetURL(downloader.URL).SetUser(downloader.User).SetPassword(downloader.Password).SetPriority1(downloader.Priority1).Exec(context.TODO())
return err
}
_, err := c.ent.DownloadClients.Create().SetEnable(true).SetImplementation(downloader.Implementation).SetUseNatTraversal(downloader.UseNatTraversal).
_, err := c.ent.DownloadClients.Create().SetEnable(true).SetImplementation(downloader.Implementation).
SetName(downloader.Name).SetURL(downloader.URL).SetUser(downloader.User).SetPriority1(downloader.Priority1).SetPassword(downloader.Password).Save(context.TODO())
return err
}
func (c *client) GetAllDonloadClients() []*ent.DownloadClients {
func (c *Client) GetAllDonloadClients() []*ent.DownloadClients {
cc, err := c.ent.DownloadClients.Query().Order(ent.Asc(downloadclients.FieldPriority1)).All(context.TODO())
if err != nil {
log.Errorf("no download client")
@@ -347,8 +350,8 @@ func (c *client) GetAllDonloadClients() []*ent.DownloadClients {
return cc
}
func (c *client) DeleteDownloadCLient(id int) { //not delete buildin client
c.ent.DownloadClients.Delete().Where(downloadclients.ID(id), downloadclients.ImplementationNEQ(downloadclients.ImplementationBuildin)).Exec(context.TODO())
func (c *Client) DeleteDownloadCLient(id int) {
c.ent.DownloadClients.Delete().Where(downloadclients.ID(id)).Exec(context.TODO())
}
// Storage is the model entity for the Storage schema.
@@ -389,14 +392,12 @@ type WebdavSetting struct {
ChangeFileHash string `json:"change_file_hash"`
}
func (c *client) AddStorage(st *StorageInfo) error {
if st.Implementation != storage.ImplementationLocal.String() { //add seperator if not local storage
if !strings.HasSuffix(st.TvPath, "/") {
st.TvPath += "/"
}
if !strings.HasSuffix(st.MoviePath, "/") {
st.MoviePath += "/"
}
func (c *Client) AddStorage(st *StorageInfo) error {
if !strings.HasSuffix(st.TvPath, "/") {
st.TvPath += "/"
}
if !strings.HasSuffix(st.MoviePath, "/") {
st.MoviePath += "/"
}
if st.Settings == nil {
st.Settings = map[string]string{}
@@ -428,7 +429,7 @@ func (c *client) AddStorage(st *StorageInfo) error {
return nil
}
func (c *client) GetAllStorage() []*ent.Storage {
func (c *Client) GetAllStorage() []*ent.Storage {
data, err := c.ent.Storage.Query().Where(storage.Deleted(false)).All(context.TODO())
if err != nil {
log.Errorf("get storage: %v", err)
@@ -450,7 +451,7 @@ func (s *Storage) ToWebDavSetting() WebdavSetting {
return webdavSetting
}
func (c *client) GetStorage(id int) *Storage {
func (c *Client) GetStorage(id int) *Storage {
r, err := c.ent.Storage.Query().Where(storage.ID(id)).First(context.TODO())
if err != nil {
//use default storage
@@ -460,11 +461,11 @@ func (c *client) GetStorage(id int) *Storage {
return &Storage{*r}
}
func (c *client) DeleteStorage(id int) error {
func (c *Client) DeleteStorage(id int) error {
return c.ent.Storage.Update().Where(storage.ID(id)).SetDeleted(true).Exec(context.TODO())
}
func (c *client) SetDefaultStorage(id int) error {
func (c *Client) SetDefaultStorage(id int) error {
err := c.ent.Storage.Update().Where(storage.ID(id)).SetDefault(true).Exec(context.TODO())
if err != nil {
return err
@@ -473,7 +474,7 @@ func (c *client) SetDefaultStorage(id int) error {
return err
}
func (c *client) SetDefaultStorageByName(name string) error {
func (c *Client) SetDefaultStorageByName(name string) error {
err := c.ent.Storage.Update().Where(storage.Name(name)).SetDefault(true).Exec(context.TODO())
if err != nil {
return err
@@ -482,18 +483,26 @@ func (c *client) SetDefaultStorageByName(name string) error {
return err
}
func (c *client) SaveHistoryRecord(h ent.History) (*ent.History, error) {
return c.ent.History.Create().SetMediaID(h.MediaID).SetDate(time.Now()).
func (c *Client) SaveHistoryRecord(h ent.History) (*ent.History, error) {
if h.Link != "" {
r, err := utils.Link2Magnet(h.Link)
if err != nil {
log.Warnf("convert link to magnet error, link %v, error: %v", h.Link, err)
} else {
h.Link = r
}
}
return c.ent.History.Create().SetMediaID(h.MediaID).SetEpisodeID(h.EpisodeID).SetDate(time.Now()).
SetStatus(h.Status).SetTargetDir(h.TargetDir).SetSourceTitle(h.SourceTitle).SetIndexerID(h.IndexerID).
SetDownloadClientID(h.DownloadClientID).SetSize(h.Size).SetSeasonNum(h.SeasonNum).
SetEpisodeNums(h.EpisodeNums).SetHash(h.Hash).SetLink(h.Link).Save(context.TODO())
SetDownloadClientID(h.DownloadClientID).SetSize(h.Size).SetSaved(h.Saved).SetSeasonNum(h.SeasonNum).
SetEpisodeNums(h.EpisodeNums).SetLink(h.Link).Save(context.TODO())
}
func (c *client) SetHistoryStatus(id int, status history.Status) error {
func (c *Client) SetHistoryStatus(id int, status history.Status) error {
return c.ent.History.Update().Where(history.ID(id)).SetStatus(status).Exec(context.TODO())
}
func (c *client) GetHistories() ent.Histories {
func (c *Client) GetHistories() ent.Histories {
h, err := c.ent.History.Query().Order(history.ByID(sql.OrderDesc())).All(context.TODO())
if err != nil {
return nil
@@ -501,7 +510,7 @@ func (c *client) GetHistories() ent.Histories {
return h
}
func (c *client) GetRunningHistories() ent.Histories {
func (c *Client) GetRunningHistories() ent.Histories {
h, err := c.ent.History.Query().Where(history.Or(history.StatusEQ(history.StatusRunning),
history.StatusEQ(history.StatusUploading), history.StatusEQ(history.StatusSeeding))).All(context.TODO())
if err != nil {
@@ -510,16 +519,16 @@ func (c *client) GetRunningHistories() ent.Histories {
return h
}
func (c *client) GetHistory(id int) *ent.History {
func (c *Client) GetHistory(id int) *ent.History {
return c.ent.History.Query().Where(history.ID(id)).FirstX(context.TODO())
}
func (c *client) DeleteHistory(id int) error {
err := c.ent.History.Update().Where(history.ID(id)).SetStatus(history.StatusRemoved).Exec(context.Background())
func (c *Client) DeleteHistory(id int) error {
_, err := c.ent.History.Delete().Where(history.ID(id)).Exec(context.Background())
return err
}
func (c *client) GetDownloadDir() string {
func (c *Client) GetDownloadDir() string {
r, err := c.ent.Settings.Query().Where(settings.Key(SettingDownloadDir)).First(context.TODO())
if err != nil {
return "/downloads"
@@ -527,7 +536,7 @@ func (c *client) GetDownloadDir() string {
return r.Value
}
func (c *client) UpdateEpisodeStatus(mediaID int, seasonNum, episodeNum int) error {
func (c *Client) UpdateEpisodeStatus(mediaID int, seasonNum, episodeNum int) error {
ep, err := c.ent.Episode.Query().Where(episode.MediaID(mediaID)).Where(episode.EpisodeNumber(episodeNum)).
Where(episode.SeasonNumber(seasonNum)).First(context.TODO())
if err != nil {
@@ -536,37 +545,33 @@ func (c *client) UpdateEpisodeStatus(mediaID int, seasonNum, episodeNum int) err
return ep.Update().SetStatus(episode.StatusDownloaded).Exec(context.TODO())
}
func (c *client) SetEpisodeStatus(id int, status episode.Status) error {
func (c *Client) SetEpisodeStatus(id int, status episode.Status) error {
return c.ent.Episode.Update().Where(episode.ID(id)).SetStatus(status).Exec(context.TODO())
}
func (c *client) IsEpisodeDownloadingOrDownloaded(id int) bool {
ep, _ := c.GetEpisodeByID(id)
his := c.ent.History.Query().Where(history.MediaID(ep.MediaID), history.SeasonNum(ep.SeasonNumber), history.StatusNEQ(history.StatusRemoved), history.StatusNEQ(history.StatusFail)).AllX(context.Background())
func (c *Client) IsEpisodeDownloadingOrDownloaded(id int) bool {
his := c.ent.History.Query().Where(history.EpisodeID(id)).AllX(context.Background())
for _, h := range his {
if len(h.EpisodeNums) == 0 { //season pack download
return true
}
if slices.Contains(h.EpisodeNums, ep.EpisodeNumber) {
if h.Status != history.StatusFail {
return true
}
}
return false
}
func (c *client) SetSeasonAllEpisodeStatus(mediaID, seasonNum int, status episode.Status) error {
func (c *Client) SetSeasonAllEpisodeStatus(mediaID, seasonNum int, status episode.Status) error {
return c.ent.Episode.Update().Where(episode.MediaID(mediaID), episode.SeasonNumber(seasonNum)).SetStatus(status).Exec(context.TODO())
}
func (c *client) TmdbIdInWatchlist(tmdb_id int) bool {
func (c *Client) TmdbIdInWatchlist(tmdb_id int) bool {
return c.ent.Media.Query().Where(media.TmdbID(tmdb_id)).CountX(context.TODO()) > 0
}
func (c *client) GetDownloadHistory(mediaID int) ([]*ent.History, error) {
func (c *Client) GetDownloadHistory(mediaID int) ([]*ent.History, error) {
return c.ent.History.Query().Where(history.MediaID(mediaID)).All(context.TODO())
}
func (c *client) GetMovieDummyEpisode(movieId int) (*ent.Episode, error) {
func (c *Client) GetMovieDummyEpisode(movieId int) (*ent.Episode, error) {
_, err := c.ent.Media.Query().Where(media.ID(movieId), media.MediaTypeEQ(media.MediaTypeMovie)).First(context.TODO())
if err != nil {
return nil, errors.Wrap(err, "get movie")
@@ -578,11 +583,11 @@ func (c *client) GetMovieDummyEpisode(movieId int) (*ent.Episode, error) {
return ep, nil
}
func (c *client) GetDownloadClient(id int) (*ent.DownloadClients, error) {
func (c *Client) GetDownloadClient(id int) (*ent.DownloadClients, error) {
return c.ent.DownloadClients.Query().Where(downloadclients.ID(id)).First(context.Background())
}
func (c *client) SetEpisodeMonitoring(id int, b bool) error {
func (c *Client) SetEpisodeMonitoring(id int, b bool) error {
return c.ent.Episode.Update().Where(episode.ID(id)).SetMonitored(b).Exec(context.Background())
}
@@ -593,24 +598,24 @@ type EditMediaData struct {
Limiter schema.MediaLimiter `json:"limiter"`
}
func (c *client) EditMediaMetadata(in EditMediaData) error {
func (c *Client) EditMediaMetadata(in EditMediaData) error {
return c.ent.Media.Update().Where(media.ID(in.ID)).SetResolution(in.Resolution).SetTargetDir(in.TargetDir).SetLimiter(in.Limiter).
Exec(context.Background())
}
func (c *client) UpdateEpisodeTargetFile(id int, filename string) error {
func (c *Client) UpdateEpisodeTargetFile(id int, filename string) error {
return c.ent.Episode.Update().Where(episode.ID(id)).SetTargetFile(filename).Exec(context.Background())
}
func (c *client) GetSeasonEpisodes(mediaId, seasonNum int) ([]*ent.Episode, error) {
func (c *Client) GetSeasonEpisodes(mediaId, seasonNum int) ([]*ent.Episode, error) {
return c.ent.Episode.Query().Where(episode.MediaID(mediaId), episode.SeasonNumber(seasonNum)).All(context.Background())
}
func (c *client) GetAllImportLists() ([]*ent.ImportList, error) {
func (c *Client) GetAllImportLists() ([]*ent.ImportList, error) {
return c.ent.ImportList.Query().All(context.Background())
}
func (c *client) AddImportlist(il *ent.ImportList) error {
func (c *Client) AddImportlist(il *ent.ImportList) error {
count, err := c.ent.ImportList.Query().Where(importlist.Name(il.Name)).Count(context.Background())
if err != nil {
return err
@@ -624,11 +629,11 @@ func (c *client) AddImportlist(il *ent.ImportList) error {
SetType(il.Type).Exec(context.Background())
}
func (c *client) DeleteImportlist(id int) error {
func (c *Client) DeleteImportlist(id int) error {
return c.ent.ImportList.DeleteOneID(id).Exec(context.TODO())
}
func (c *client) GetSizeLimiter(mediaType string) (*MediaSizeLimiter, error) {
func (c *Client) GetSizeLimiter(mediaType string) (*MediaSizeLimiter, error) {
var v string
if mediaType == "tv" {
v = c.GetSetting(SettingTvSizeLimiter)
@@ -647,7 +652,7 @@ func (c *client) GetSizeLimiter(mediaType string) (*MediaSizeLimiter, error) {
return &limiter, err
}
func (c *client) SetSizeLimiter(mediaType string, limiter *MediaSizeLimiter) error {
func (c *Client) SetSizeLimiter(mediaType string, limiter *MediaSizeLimiter) error {
data, err := json.Marshal(limiter)
if err != nil {
return err
@@ -662,7 +667,7 @@ func (c *client) SetSizeLimiter(mediaType string, limiter *MediaSizeLimiter) err
}
func (c *client) GetTvNamingFormat() string {
func (c *Client) GetTvNamingFormat() string {
s := c.GetSetting(SettingTvNamingFormat)
if s == "" {
return DefaultNamingFormat
@@ -670,7 +675,7 @@ func (c *client) GetTvNamingFormat() string {
return s
}
func (c *client) GetMovingNamingFormat() string {
func (c *Client) GetMovingNamingFormat() string {
s := c.GetSetting(SettingMovieNamingFormat)
if s == "" {
return DefaultNamingFormat
@@ -678,11 +683,16 @@ func (c *client) GetMovingNamingFormat() string {
return s
}
func (c *client) CleanAllDanglingEpisodes() error {
func (c *Client) CleanAllDanglingEpisodes() error {
_, err := c.ent.Episode.Delete().Where(episode.Not(episode.HasMedia())).Exec(context.Background())
return err
}
func (c *client) GetProwlarrSetting() (*ProwlarrSetting, error) {
func (c *Client) AddBlacklistItem(item *ent.Blacklist) error {
return c.ent.Blacklist.Create().SetType(item.Type).SetValue(item.Value).SetNotes(item.Notes).Exec(context.Background())
}
func (c *Client) GetProwlarrSetting() (*ProwlarrSetting, error) {
s := c.GetSetting(SettingProwlarrInfo)
if s == "" {
return nil, errors.New("prowlarr setting not set")
@@ -694,7 +704,7 @@ func (c *client) GetProwlarrSetting() (*ProwlarrSetting, error) {
return &se, nil
}
func (c *client) SaveProwlarrSetting(se *ProwlarrSetting) error {
func (c *Client) SaveProwlarrSetting(se *ProwlarrSetting) error {
data, err := json.Marshal(se)
if err != nil {
return err
@@ -702,7 +712,8 @@ func (c *client) SaveProwlarrSetting(se *ProwlarrSetting) error {
return c.SetSetting(SettingProwlarrInfo, string(data))
}
func (c *client) getAcceptedFormats(key string) ([]string, error) {
func (c *Client) getAcceptedFormats(key string) ([]string, error) {
v := c.GetSetting(key)
if v == "" {
return nil, nil
@@ -713,15 +724,15 @@ func (c *client) getAcceptedFormats(key string) ([]string, error) {
return res, err
}
func (c *client) setAcceptedFormats(key string, v []string) error {
func (c *Client) setAcceptedFormats(key string, v []string) error {
data, err := json.Marshal(v)
if err != nil {
return err
}
return c.SetSetting(key, string(data))
}
}
func (c *client) GetAcceptedVideoFormats() ([]string, error) {
func (c *Client) GetAcceptedVideoFormats() ([]string, error) {
res, err := c.getAcceptedFormats(SettingAcceptedVideoFormats)
if err != nil {
return nil, err
@@ -732,45 +743,42 @@ func (c *client) GetAcceptedVideoFormats() ([]string, error) {
return res, nil
}
func (c *client) SetAcceptedVideoFormats(key string, v []string) error {
func (c *Client) SetAcceptedVideoFormats(key string, v []string) error {
return c.setAcceptedFormats(SettingAcceptedVideoFormats, v)
}
func (c *client) GetAcceptedSubtitleFormats() ([]string, error) {
func (c *Client) GetAcceptedSubtitleFormats() ([]string, error) {
res, err := c.getAcceptedFormats(SettingAcceptedSubtitleFormats)
if err != nil {
return nil, err
}
if res == nil {
if res== nil {
return defaultAcceptedSubtitleFormats, nil
}
return res, nil
}
func (c *client) SetAcceptedSubtitleFormats(key string, v []string) error {
func (c *Client) SetAcceptedSubtitleFormats(key string, v []string) error {
return c.setAcceptedFormats(SettingAcceptedSubtitleFormats, v)
}
func (c *client) GetTmdbApiKey() string {
k := c.GetSetting(SettingTmdbApiKey)
if k == "" {
return DefaultTmdbApiKey
func (c *Client) GetAIConfig() (AIConfig, error) {
cfg := c.GetSetting(SettingAIConfig)
var ai AIConfig
if cfg == "" {
return ai, nil
}
return k
err := json.Unmarshal([]byte(cfg), &ai)
if err != nil {
return AIConfig{}, err
}
return ai, nil
}
func (c *client) AddTorrent2Blacklist(hash, name string, mediaId int) error {
count := c.ent.Blacklist.Query().Where(blacklist.TorrentHash(hash), blacklist.MediaID(mediaId)).CountX(context.TODO())
if count > 0 { //already exist
log.Infof("torrent %s already in blacklist", hash)
return nil
func (c *Client) SetAIConfig(cfg *AIConfig) error {
if data, err := json.Marshal(cfg); err != nil {
return err
} else {
return c.SetSetting(SettingAIConfig, string(data))
}
return c.ent.Blacklist.Create().SetType(blacklist.TypeTorrent).SetTorrentHash(hash).SetTorrentName(name).SetMediaID(mediaId).Exec(context.Background())
}
func (c *client) GetTorrentBlacklist() (ent.Blacklists, error) {
return c.ent.Blacklist.Query().Where(blacklist.TypeEQ(blacklist.TypeTorrent)).All(context.Background())
}
func (c *client) DeleteTorrentBlacklist(id int) error {
return c.ent.Blacklist.DeleteOneID(id).Exec(context.Background())
}
}

View File

@@ -1,112 +0,0 @@
package db
import (
"polaris/ent"
"polaris/ent/episode"
"polaris/ent/history"
"polaris/ent/media"
)
type Database interface {
Settings
MediaApis
EpisodeApis
IndexerApis
HistoryApis
SaveDownloader(downloader *ent.DownloadClients) error
GetAllDonloadClients() []*ent.DownloadClients
DeleteDownloadCLient(id int)
GetDownloadClient(id int) (*ent.DownloadClients, error)
AddStorage(st *StorageInfo) error
GetAllStorage() []*ent.Storage
GetStorage(id int) *Storage
DeleteStorage(id int) error
SetDefaultStorage(id int) error
SetDefaultStorageByName(name string) error
GetAllImportLists() ([]*ent.ImportList, error)
AddImportlist(il *ent.ImportList) error
DeleteImportlist(id int) error
GetAllNotificationClients2() ([]*ent.NotificationClient, error)
GetAllNotificationClients() ([]*NotificationClient, error)
AddNotificationClient(name, service string, setting string, enabled bool) error
DeleteNotificationClient(id int) error
GetNotificationClient(id int) (*NotificationClient, error)
AddTorrent2Blacklist(hash, name string, mediaId int) error
GetTorrentBlacklist() (ent.Blacklists, error)
DeleteTorrentBlacklist(id int) error
}
type Settings interface {
GetSetting(key string) string
SetSetting(key, value string) error
GetLanguage() string
GetDownloadDir() string
GetTvNamingFormat() string
GetMovingNamingFormat() string
GetProwlarrSetting() (*ProwlarrSetting, error)
SaveProwlarrSetting(se *ProwlarrSetting) error
GetAcceptedVideoFormats() ([]string, error)
SetAcceptedVideoFormats(key string, v []string) error
GetAcceptedSubtitleFormats() ([]string, error)
SetAcceptedSubtitleFormats(key string, v []string) error
GetTmdbApiKey() string
}
type MediaApis interface {
AddMediaWatchlist(m *ent.Media, episodes []int) (*ent.Media, error)
GetMediaWatchlist(mediaType media.MediaType) []*ent.Media
GetMediaDetails(id int) (*MediaDetails, error)
GetMedia(id int) (*ent.Media, error)
DeleteMedia(id int) error
TmdbIdInWatchlist(tmdb_id int) bool
EditMediaMetadata(in EditMediaData) error
GetSizeLimiter(mediaType string) (*MediaSizeLimiter, error)
SetSizeLimiter(mediaType string, limiter *MediaSizeLimiter) error
}
type EpisodeApis interface {
GetEpisode(seriesId, seasonNum, episodeNum int) (*ent.Episode, error)
GetEpisodeByID(epID int) (*ent.Episode, error)
UpdateEpiode(episodeId int, name, overview string) error
UpdateEpiode2(episodeId int, name, overview, airdate string) error
SaveEposideDetail(d *ent.Episode) (int, error)
SaveEposideDetail2(d *ent.Episode) (int, error)
UpdateEpisodeStatus(mediaID int, seasonNum, episodeNum int) error
SetEpisodeStatus(id int, status episode.Status) error
IsEpisodeDownloadingOrDownloaded(id int) bool
SetSeasonAllEpisodeStatus(mediaID, seasonNum int, status episode.Status) error
SetEpisodeMonitoring(id int, b bool) error
UpdateEpisodeTargetFile(id int, filename string) error
GetSeasonEpisodes(mediaId, seasonNum int) ([]*ent.Episode, error)
CleanAllDanglingEpisodes() error
}
type IndexerApis interface {
SaveIndexer(in *ent.Indexers) error
DeleteIndexer(id int)
GetIndexer(id int) (*ent.Indexers, error)
GetAllIndexers() []*ent.Indexers
}
type HistoryApis interface {
SaveHistoryRecord(h ent.History) (*ent.History, error)
SetHistoryStatus(id int, status history.Status) error
GetRunningHistories() ent.Histories
GetHistory(id int) *ent.History
GetHistories() ent.Histories
DeleteHistory(id int) error
GetDownloadHistory(mediaID int) ([]*ent.History, error)
GetMovieDummyEpisode(movieId int) (*ent.Episode, error)
}

View File

@@ -1,46 +0,0 @@
package db
import (
"context"
"encoding/json"
"polaris/log"
"github.com/pkg/errors"
)
func (c *client) migrate() error {
// Run the auto migration tool.
if err := c.ent.Schema.Create(context.Background()); err != nil {
return errors.Wrap(err, "failed creating schema resources")
}
if err := c.migrateIndexerSetting(); err != nil {
return errors.Wrap(err, "migrate indexer setting")
}
return nil
}
func (c *client) migrateIndexerSetting() error {
indexers := c.GetAllIndexers()
for _, in := range indexers {
if in.Settings == "" {
continue
}
if in.APIKey != "" && in.URL != "" {
continue
}
var setting TorznabSetting
err := json.Unmarshal([]byte(in.Settings), &setting)
if err != nil {
return err
}
in.APIKey = setting.ApiKey
in.URL = setting.URL
if err := c.SaveIndexer(in); err != nil {
return errors.Wrap(err, "save indexer")
}
log.Infof("success migrate indexer setting field: %s", in.Name)
}
return nil
}

View File

@@ -11,11 +11,11 @@ import (
"github.com/pkg/errors"
)
func (c *client) GetAllNotificationClients2() ([]*ent.NotificationClient, error) {
func (c *Client) GetAllNotificationClients2() ([]*ent.NotificationClient, error) {
return c.ent.NotificationClient.Query().All(context.TODO())
}
func (c *client) GetAllNotificationClients() ([]*NotificationClient, error) {
func (c *Client) GetAllNotificationClients() ([]*NotificationClient, error) {
all, err := c.ent.NotificationClient.Query().All(context.TODO())
if err != nil {
return nil, errors.Wrap(err, "query db")
@@ -31,7 +31,7 @@ func (c *client) GetAllNotificationClients() ([]*NotificationClient, error) {
return all1, nil
}
func (c *client) AddNotificationClient(name, service string, setting string, enabled bool) error {
func (c *Client) AddNotificationClient(name, service string, setting string, enabled bool) error {
// data, err := json.Marshal(setting)
// if err != nil {
// return errors.Wrap(err, "json")
@@ -48,12 +48,12 @@ func (c *client) AddNotificationClient(name, service string, setting string, ena
SetSettings(setting).SetEnabled(enabled).Exec(context.Background())
}
func (c *client) DeleteNotificationClient(id int) error {
func (c *Client) DeleteNotificationClient(id int) error {
_, err := c.ent.NotificationClient.Delete().Where(notificationclient.ID(id)).Exec(context.Background())
return err
}
func (c *client) GetNotificationClient(id int) (*NotificationClient, error) {
func (c *Client) GetNotificationClient(id int) (*NotificationClient, error) {
noti, err := c.ent.NotificationClient.Query().Where(notificationclient.ID(id)).First(context.Background())
if err != nil {
return nil, errors.Wrap(err, "query")
@@ -73,8 +73,6 @@ func toNotificationClient(cl *ent.NotificationClient) (*NotificationClient, erro
settings = notifier.TelegramConfig{}
case "bark":
settings = notifier.BarkConfig{}
case "serverchan":
settings = notifier.ServerChanConfig{}
}
err := json.Unmarshal([]byte(cl.Settings), &settings)
if err != nil {

View File

@@ -1,14 +0,0 @@
# FAQ
## 1. Polaris 能否使用硬链接代替直接拷贝来节省空间?
可以。
使用本地存储时,默认使用硬链接移动文件,如果下载路径和媒体路径不在同一个挂载路径,硬链接会失败,然后会尝试使用拷贝的方式移动文件。
基于这一点我们只需要改造一下docker挂载路径既可以实现硬链接功能。
1. 媒体路径e.g. /data同时挂载到polaris和下载器容器
2. polaris *设置 -> 下载路径* 设为媒体路径下面的文件夹 e.g. /data/downloads
然后Polaris就是使用硬连接而非拷贝的方式

View File

@@ -134,6 +134,4 @@ docker compose up -d
详细配置请看 [配置篇](./configuration.md)
## 6. FAQ
- [常见问题 FAQ](./faq.md)

View File

@@ -1,9 +0,0 @@
# 利用STUN进行NAT内网穿透
可以在下载器选项里打开 *使用内置STUN NAT穿透* 功能即使处在NAT网络环境下BT/PT也可以满速上传。打开后Polaris自动更改下载客户端的监听端口并代理BT的上传流量。
要想正常使用此功能,需要具备以下几个条件:
1. 所在的NAT网络非对称NATSymmetric NAT可以使用 [NatTypeTester](https://github.com/HMBSbige/NatTypeTester/releases/) 检查自己的网络的NAT类型
2. 下载器设置选项中下载器地址为下载器docker的实际地址而非映射地址。达到这一目标可以使用host网络创建下载器也可以利用docker-compose自带的域名解析来实现

View File

@@ -1,238 +0,0 @@
package engine
import (
"polaris/db"
"polaris/ent"
"polaris/ent/downloadclients"
"polaris/log"
"polaris/pkg"
"polaris/pkg/buildin"
"polaris/pkg/qbittorrent"
"polaris/pkg/tmdb"
"polaris/pkg/transmission"
"polaris/pkg/utils"
"github.com/pkg/errors"
"github.com/robfig/cron"
)
func NewEngine(db db.Database, language string) *Engine {
return &Engine{
db: db,
cron: cron.New(),
tasks: utils.Map[int, *Task]{},
schedulers: utils.Map[string, scheduler]{},
language: language,
}
}
type scheduler struct {
cron string
f func() error
}
type Engine struct {
db db.Database
cron *cron.Cron
tasks utils.Map[int, *Task]
language string
schedulers utils.Map[string, scheduler]
buildin *buildin.Downloader
}
func (c *Engine) registerCronJob(name string, cron string, f func() error) {
c.schedulers.Store(name, scheduler{
cron: cron,
f: f,
})
}
func (c *Engine) Init() {
go c.reloadTasks()
c.addSysCron()
go c.checkW500PosterOnStartup()
}
func (c *Engine) GetTask(id int) (*Task, bool) {
return c.tasks.Load(id)
}
func (c *Engine) reloadUsingBuildinDownloader(h *ent.History) error {
cl, err := c.buildInDownloader()
if err != nil {
log.Warnf("buildin downloader error: %v", err)
}
t, err := cl.Download(h.Link, h.Hash, c.db.GetDownloadDir())
if err != nil {
return errors.Wrap(err, "download torrent")
}
t.Start()
c.tasks.Store(h.ID, &Task{Torrent: t})
return nil
}
func (c *Engine) reloadTasks() {
allTasks := c.db.GetRunningHistories()
for _, t := range allTasks {
if t.DownloadClientID == 0 {
log.Warnf("assume buildin downloader: %v", t.SourceTitle)
err := c.reloadUsingBuildinDownloader(t)
if err != nil {
log.Warnf("buildin downloader error: %v", err)
} else {
log.Infof("success reloading buildin task: %v", t.SourceTitle)
}
continue
}
dl, err := c.db.GetDownloadClient(t.DownloadClientID)
if err != nil {
log.Warnf("no download client related: %v", t.SourceTitle)
continue
}
if dl.Implementation == downloadclients.ImplementationTransmission {
if t.Hash != "" { //优先使用hash
to, err := transmission.NewTorrentHash(transmission.Config{
URL: dl.URL,
User: dl.User,
Password: dl.Password,
}, t.Hash)
if err != nil {
log.Warnf("get task error: %v", err)
continue
}
c.tasks.Store(t.ID, &Task{Torrent: to})
} else if t.Link != "" {
to, err := transmission.NewTorrent(transmission.Config{
URL: dl.URL,
User: dl.User,
Password: dl.Password,
}, t.Link)
if err != nil {
log.Warnf("get task error: %v", err)
continue
}
c.tasks.Store(t.ID, &Task{Torrent: to})
}
} else if dl.Implementation == downloadclients.ImplementationQbittorrent {
if t.Hash != "" {
to, err := qbittorrent.NewTorrentHash(qbittorrent.Info{
URL: dl.URL,
User: dl.User,
Password: dl.Password,
}, t.Hash)
if err != nil {
log.Warnf("get task error: %v", err)
continue
}
c.tasks.Store(t.ID, &Task{Torrent: to})
} else if t.Link != "" {
to, err := qbittorrent.NewTorrent(qbittorrent.Info{
URL: dl.URL,
User: dl.User,
Password: dl.Password,
}, t.Link)
if err != nil {
log.Warnf("get task error: %v", err)
continue
}
c.tasks.Store(t.ID, &Task{Torrent: to})
}
} else if dl.Implementation == downloadclients.ImplementationBuildin {
err := c.reloadUsingBuildinDownloader(t)
if err != nil {
log.Warnf("buildin downloader error: %v", err)
} else {
log.Infof("success reloading buildin task: %v", t.SourceTitle)
}
}
}
log.Infof("------ task reloading done ------")
}
func (c *Engine) buildInDownloader() (pkg.Downloader, error) {
if c.buildin != nil {
return c.buildin, nil
}
dir := c.db.GetDownloadDir()
d, err := buildin.NewDownloader(dir)
if err != nil {
return nil, errors.Wrap(err, "buildin downloader")
}
c.buildin = d
return d, nil
}
func (c *Engine) GetDownloadClient() (pkg.Downloader, *ent.DownloadClients, error) {
downloaders := c.db.GetAllDonloadClients()
for _, d := range downloaders {
if !d.Enable {
continue
}
if d.Implementation == downloadclients.ImplementationTransmission {
trc, err := transmission.NewClient(transmission.Config{
URL: d.URL,
User: d.User,
Password: d.Password,
})
if err != nil {
log.Warnf("connect to download client error: %v", d.URL)
continue
}
return trc, d, nil
} else if d.Implementation == downloadclients.ImplementationQbittorrent {
qbt, err := qbittorrent.NewClient(d.URL, d.User, d.Password)
if err != nil {
log.Warnf("connect to download client error: %v", d.URL)
continue
}
return qbt, d, nil
} else if d.Implementation == downloadclients.ImplementationBuildin {
bin, err := c.buildInDownloader()
if err != nil {
log.Warnf("connect to download client error: %v", err)
continue
}
return bin, d, nil
}
}
return nil, nil, errors.Errorf("no available download client")
}
func (c *Engine) TMDB() (*tmdb.Client, error) {
api := c.db.GetTmdbApiKey()
if api == "" {
return nil, errors.New("TMDB apiKey not set")
}
proxy := c.db.GetSetting(db.SettingProxy)
adult := c.db.GetSetting(db.SettingEnableTmdbAdultContent)
return tmdb.NewClient(api, proxy, adult == "true")
}
func (c *Engine) MustTMDB() *tmdb.Client {
t, err := c.TMDB()
if err != nil {
log.Panicf("get tmdb: %v", err)
}
return t
}
func (c *Engine) RemoveTaskAndTorrent(id int) error {
torrent, ok := c.tasks.Load(id)
if ok {
if err := torrent.Remove(); err != nil {
return errors.Wrap(err, "remove torrent")
}
c.tasks.Delete(id)
}
return nil
}
func (c *Engine) GetTasks() *utils.Map[int, *Task] {
return &c.tasks
}

View File

@@ -1 +0,0 @@
package engine

View File

@@ -1,79 +0,0 @@
package engine
import (
"polaris/ent"
"polaris/log"
"polaris/pkg/prowlarr"
"strings"
"github.com/pkg/errors"
)
const prowlarrPrefix = "Prowlarr_"
func (c *Engine) SyncProwlarrIndexers(apiKey, url string) error {
client := prowlarr.New(apiKey, url)
if ins, err := client.GetIndexers(); err != nil {
return errors.Wrap(err, "connect to prowlarr error")
} else {
var prowlarrNames = make(map[string]bool, len(ins))
for _, in := range ins {
prowlarrNames[in.Name] = true
}
all := c.db.GetAllIndexers()
for _, index := range all {
if index.Synced {
if !prowlarrNames[strings.TrimPrefix(index.Name, prowlarrPrefix)] {
c.db.DeleteIndexer(index.ID) //remove deleted indexers
}
}
}
for _, indexer := range ins {
if err := c.db.SaveIndexer(&ent.Indexers{
Disabled: indexer.Disabled,
Name: prowlarrPrefix + indexer.Name,
Priority: indexer.Priority,
SeedRatio: indexer.SeedRatio,
//Settings: indexer.Settings,
Implementation: "torznab",
APIKey: indexer.APIKey,
URL: indexer.URL,
TvSearch: indexer.TvSearch,
MovieSearch: indexer.MovieSearch,
Synced: true,
}); err != nil {
return errors.Wrap(err, "save prowlarr indexers")
}
log.Debugf("synced prowlarr indexer to db: %v", indexer.Name)
}
}
return nil
}
func (c *Engine) syncProwlarr() error {
p, err := c.db.GetProwlarrSetting()
if err != nil {
return errors.Wrap(err, "db")
}
if p.Disabled {
return nil
}
if err := c.SyncProwlarrIndexers(p.ApiKey, p.URL); err != nil {
return errors.Wrap(err, "sync prowlarr indexers")
}
return nil
}
func (c *Engine) DeleteAllProwlarrIndexers() error {
all := c.db.GetAllIndexers()
for _, index := range all {
if index.Synced {
c.db.DeleteIndexer(index.ID)
log.Debugf("success delete prowlarr indexer: %s", index.Name)
}
}
return nil
}

View File

@@ -1,246 +0,0 @@
package engine
import (
"bytes"
"fmt"
"polaris/ent"
"polaris/ent/episode"
"polaris/ent/history"
"polaris/ent/media"
"polaris/log"
"polaris/pkg/metadata"
"polaris/pkg/notifier/message"
"polaris/pkg/torznab"
"polaris/pkg/utils"
"github.com/pkg/errors"
)
func (c *Engine) DownloadEpisodeTorrent(r1 torznab.Result, op DownloadOptions) (*string, error) {
series, err := c.db.GetMedia(op.MediaId)
if err != nil {
return nil, fmt.Errorf("no tv series of id %v", op.MediaId)
}
return c.downloadTorrent(series, r1, op)
}
/*
tmdb 校验获取的资源名如果用资源名在tmdb搜索出来的结果能匹配上想要的资源则认为资源有效否则无效
解决名称过于简单的影视会匹配过多资源的问题, 例如:梦魇绝镇 FROM
*/
func (c *Engine) checkBtReourceWithTmdb(r *torznab.Result, seriesId int) bool {
m := metadata.ParseTv(r.Name)
se, err := c.MustTMDB().SearchMedia(m.NameEn, "", 1)
if err != nil {
log.Warnf("tmdb search error, consider this torrent ok: %v", err)
return true
} else {
if len(se.Results) == 0 {
log.Debugf("tmdb search no result, consider this torrent ok: %s", r.Name) //because tv name parse is not accurate
return true
}
series, err := c.db.GetMediaDetails(seriesId)
if err != nil {
log.Warnf("get media details error: %v", err)
return false
}
se0 := se.Results[0]
if se0.ID != int64(series.TmdbID) {
log.Warnf("bt reosurce name not match tmdb id: %s", r.Name)
return false
} else { //resource tmdb id match
return true
}
}
}
func (c *Engine) SearchAndDownload(seriesId, seasonNum int, episodeNums ...int) ([]string, error) {
res, err := SearchTvSeries(c.db, &SearchParam{
MediaId: seriesId,
SeasonNum: seasonNum,
Episodes: episodeNums,
CheckFileSize: true,
CheckResolution: true,
})
if err != nil {
return nil, err
}
wanted := make(map[int]bool, len(episodeNums))
for _, ep := range episodeNums {
wanted[ep] = true
}
var torrentNames []string
lo:
for _, r := range res {
if !c.checkBtReourceWithTmdb(&r, seriesId) {
continue
}
m := metadata.ParseTv(r.Name)
m.ParseExtraDescription(r.Description)
if len(episodeNums) == 0 { //want season pack
if m.IsSeasonPack {
name, err := c.DownloadEpisodeTorrent(r, DownloadOptions{
SeasonNum: seasonNum,
MediaId: seriesId,
HashFilterFn: c.hashInBlacklist,
})
if err != nil {
log.Warnf("download season pack error, continue next item: %v", err)
continue lo
}
torrentNames = append(torrentNames, *name)
break lo
}
} else {
torrentEpisodes := make([]int, 0)
for i := m.StartEpisode; i <= m.EndEpisode; i++ {
if !wanted[i] { //torrent has episode not wanted
continue lo
}
torrentEpisodes = append(torrentEpisodes, i)
}
name, err := c.DownloadEpisodeTorrent(r, DownloadOptions{
SeasonNum: seasonNum,
MediaId: seriesId,
EpisodeNums: torrentEpisodes,
HashFilterFn: c.hashInBlacklist,
})
if err != nil {
log.Warnf("download episode error, continue next item: %v", err)
continue lo
}
torrentNames = append(torrentNames, *name)
for _, num := range torrentEpisodes {
delete(wanted, num) //delete downloaded episode from wanted
}
}
}
if len(wanted) > 0 {
log.Warnf("still wanted but not downloaded episodes: %v", wanted)
}
return torrentNames, nil
}
func (c *Engine) DownloadMovie(m *ent.Media, r1 torznab.Result) (*string, error) {
return c.downloadTorrent(m, r1, DownloadOptions{
SeasonNum: 0,
MediaId: m.ID,
})
}
func (c *Engine) hashInBlacklist(hash string) bool {
blacklist, err := c.db.GetTorrentBlacklist()
if err!= nil {
log.Warnf("get torrent blacklist error: %v", err)
return false
}
for _, b := range blacklist {
if b.TorrentHash == hash {
return true
}
}
return false
}
func (c *Engine) downloadTorrent(m *ent.Media, r1 torznab.Result, op DownloadOptions) (*string, error) {
trc, dlc, err := c.GetDownloadClient()
if err != nil {
return nil, errors.Wrap(err, "get download client")
}
downloadDir := c.db.GetDownloadDir()
//due to reported bug by user, this will be temporarily disabled
// size := utils.AvailableSpace(downloadDir)
// if size < uint64(r1.Size) {
// log.Errorf("space available %v, space needed %v", size, r1.Size)
// return nil, errors.New("not enough space")
// }
var name = r1.Name
var targetDir = m.TargetDir
if m.MediaType == media.MediaTypeTv { //tv download
targetDir = fmt.Sprintf("%s/Season %02d/", m.TargetDir, op.SeasonNum)
if len(op.EpisodeNums) > 0 {
for _, epNum := range op.EpisodeNums {
ep, err := c.db.GetEpisode(m.ID, op.SeasonNum, epNum)
if err != nil {
return nil, errors.Errorf("no episode of season %d episode %d", op.SeasonNum, epNum)
}
if ep.Status == episode.StatusMissing {
c.db.SetEpisodeStatus(ep.ID, episode.StatusDownloading)
}
}
buff := &bytes.Buffer{}
for i, ep := range op.EpisodeNums {
if i != 0 {
buff.WriteString(",")
}
buff.WriteString(fmt.Sprint(ep))
}
name = fmt.Sprintf("第%s集 (%s)", buff.String(), name)
} else { //season package download
name = fmt.Sprintf("全集 (%s)", name)
c.db.SetSeasonAllEpisodeStatus(m.ID, op.SeasonNum, episode.StatusDownloading)
}
} else {//movie download
ep, _ := c.db.GetMovieDummyEpisode(m.ID)
if ep.Status == episode.StatusMissing {
c.db.SetEpisodeStatus(ep.ID, episode.StatusDownloading)
}
}
link, hash, err := utils.GetRealLinkAndHash(r1.Link)
if err != nil {
return nil, errors.Wrap(err, "get hash")
}
if op.HashFilterFn != nil && op.HashFilterFn(hash) {
return nil, errors.Errorf("hash is filtered: %s", hash)
}
r1.Link = link
history, err := c.db.SaveHistoryRecord(ent.History{
MediaID: m.ID,
EpisodeNums: op.EpisodeNums,
SeasonNum: op.SeasonNum,
SourceTitle: r1.Name,
TargetDir: targetDir,
Status: history.StatusRunning,
Size: int(r1.Size),
//Saved: torrent.Save(),
Link: r1.Link,
Hash: hash,
DownloadClientID: dlc.ID,
IndexerID: r1.IndexerId,
})
if err != nil {
return nil, errors.Wrap(err, "save record")
}
torrent, err := trc.Download(r1.Link, hash, downloadDir)
if err != nil {
return nil, errors.Wrap(err, "downloading")
}
torrent.Start()
c.tasks.Store(history.ID, &Task{Torrent: torrent})
c.sendMsg(fmt.Sprintf(message.BeginDownload, name))
log.Infof("success add %s to download task", r1.Name)
return &r1.Name, nil
}

View File

@@ -1,56 +0,0 @@
package engine
import (
"fmt"
"net/url"
"polaris/ent/downloadclients"
"polaris/log"
"polaris/pkg/nat"
"polaris/pkg/qbittorrent"
"github.com/pion/stun/v3"
)
func (s *Engine) stunProxyDownloadClient() error {
return s.StartStunProxy("")
}
func (s *Engine) StartStunProxy(name string) error {
downloaders := s.db.GetAllDonloadClients()
for _, d := range downloaders {
if !d.Enable {
continue
}
if !d.UseNatTraversal {
continue
}
if name != "" && d.Name != name {
continue
}
if d.Implementation != downloadclients.ImplementationQbittorrent { //TODO only support qbittorrent for now
continue
}
qbt, err := qbittorrent.NewClient(d.URL, d.User, d.Password)
if err != nil {
return fmt.Errorf("connect to download client error: %v", d.URL)
}
u, err := url.Parse(d.URL)
if err != nil {
return err
}
log.Infof("start stun proxy for %s", d.Name)
n, err := nat.NewNatTraversal(func(xa stun.XORMappedAddress) error {
return qbt.SetListenPort(xa.Port)
}, u.Hostname())
if err != nil {
return err
}
n.StartProxy()
}
return nil
}

View File

@@ -3,10 +3,11 @@
package ent
import (
"encoding/json"
"fmt"
"polaris/ent/blacklist"
"polaris/ent/schema"
"strings"
"time"
"entgo.io/ent"
"entgo.io/ent/dialect/sql"
@@ -19,14 +20,8 @@ type Blacklist struct {
ID int `json:"id,omitempty"`
// Type holds the value of the "type" field.
Type blacklist.Type `json:"type,omitempty"`
// TorrentHash holds the value of the "torrent_hash" field.
TorrentHash string `json:"torrent_hash,omitempty"`
// TorrentName holds the value of the "torrent_name" field.
TorrentName string `json:"torrent_name,omitempty"`
// MediaID holds the value of the "media_id" field.
MediaID int `json:"media_id,omitempty"`
// CreateTime holds the value of the "create_time" field.
CreateTime time.Time `json:"create_time,omitempty"`
// Value holds the value of the "value" field.
Value schema.BlacklistValue `json:"value,omitempty"`
// Notes holds the value of the "notes" field.
Notes string `json:"notes,omitempty"`
selectValues sql.SelectValues
@@ -37,12 +32,12 @@ func (*Blacklist) scanValues(columns []string) ([]any, error) {
values := make([]any, len(columns))
for i := range columns {
switch columns[i] {
case blacklist.FieldID, blacklist.FieldMediaID:
case blacklist.FieldValue:
values[i] = new([]byte)
case blacklist.FieldID:
values[i] = new(sql.NullInt64)
case blacklist.FieldType, blacklist.FieldTorrentHash, blacklist.FieldTorrentName, blacklist.FieldNotes:
case blacklist.FieldType, blacklist.FieldNotes:
values[i] = new(sql.NullString)
case blacklist.FieldCreateTime:
values[i] = new(sql.NullTime)
default:
values[i] = new(sql.UnknownType)
}
@@ -70,29 +65,13 @@ func (b *Blacklist) assignValues(columns []string, values []any) error {
} else if value.Valid {
b.Type = blacklist.Type(value.String)
}
case blacklist.FieldTorrentHash:
if value, ok := values[i].(*sql.NullString); !ok {
return fmt.Errorf("unexpected type %T for field torrent_hash", values[i])
} else if value.Valid {
b.TorrentHash = value.String
}
case blacklist.FieldTorrentName:
if value, ok := values[i].(*sql.NullString); !ok {
return fmt.Errorf("unexpected type %T for field torrent_name", values[i])
} else if value.Valid {
b.TorrentName = value.String
}
case blacklist.FieldMediaID:
if value, ok := values[i].(*sql.NullInt64); !ok {
return fmt.Errorf("unexpected type %T for field media_id", values[i])
} else if value.Valid {
b.MediaID = int(value.Int64)
}
case blacklist.FieldCreateTime:
if value, ok := values[i].(*sql.NullTime); !ok {
return fmt.Errorf("unexpected type %T for field create_time", values[i])
} else if value.Valid {
b.CreateTime = value.Time
case blacklist.FieldValue:
if value, ok := values[i].(*[]byte); !ok {
return fmt.Errorf("unexpected type %T for field value", values[i])
} else if value != nil && len(*value) > 0 {
if err := json.Unmarshal(*value, &b.Value); err != nil {
return fmt.Errorf("unmarshal field value: %w", err)
}
}
case blacklist.FieldNotes:
if value, ok := values[i].(*sql.NullString); !ok {
@@ -107,9 +86,9 @@ func (b *Blacklist) assignValues(columns []string, values []any) error {
return nil
}
// Value returns the ent.Value that was dynamically selected and assigned to the Blacklist.
// GetValue returns the ent.Value that was dynamically selected and assigned to the Blacklist.
// This includes values selected through modifiers, order, etc.
func (b *Blacklist) Value(name string) (ent.Value, error) {
func (b *Blacklist) GetValue(name string) (ent.Value, error) {
return b.selectValues.Get(name)
}
@@ -139,17 +118,8 @@ func (b *Blacklist) String() string {
builder.WriteString("type=")
builder.WriteString(fmt.Sprintf("%v", b.Type))
builder.WriteString(", ")
builder.WriteString("torrent_hash=")
builder.WriteString(b.TorrentHash)
builder.WriteString(", ")
builder.WriteString("torrent_name=")
builder.WriteString(b.TorrentName)
builder.WriteString(", ")
builder.WriteString("media_id=")
builder.WriteString(fmt.Sprintf("%v", b.MediaID))
builder.WriteString(", ")
builder.WriteString("create_time=")
builder.WriteString(b.CreateTime.Format(time.ANSIC))
builder.WriteString("value=")
builder.WriteString(fmt.Sprintf("%v", b.Value))
builder.WriteString(", ")
builder.WriteString("notes=")
builder.WriteString(b.Notes)

View File

@@ -4,7 +4,7 @@ package blacklist
import (
"fmt"
"time"
"polaris/ent/schema"
"entgo.io/ent/dialect/sql"
)
@@ -16,14 +16,8 @@ const (
FieldID = "id"
// FieldType holds the string denoting the type field in the database.
FieldType = "type"
// FieldTorrentHash holds the string denoting the torrent_hash field in the database.
FieldTorrentHash = "torrent_hash"
// FieldTorrentName holds the string denoting the torrent_name field in the database.
FieldTorrentName = "torrent_name"
// FieldMediaID holds the string denoting the media_id field in the database.
FieldMediaID = "media_id"
// FieldCreateTime holds the string denoting the create_time field in the database.
FieldCreateTime = "create_time"
// FieldValue holds the string denoting the value field in the database.
FieldValue = "value"
// FieldNotes holds the string denoting the notes field in the database.
FieldNotes = "notes"
// Table holds the table name of the blacklist in the database.
@@ -34,10 +28,7 @@ const (
var Columns = []string{
FieldID,
FieldType,
FieldTorrentHash,
FieldTorrentName,
FieldMediaID,
FieldCreateTime,
FieldValue,
FieldNotes,
}
@@ -52,16 +43,13 @@ func ValidColumn(column string) bool {
}
var (
// DefaultCreateTime holds the default value on creation for the "create_time" field.
DefaultCreateTime func() time.Time
// DefaultValue holds the default value on creation for the "value" field.
DefaultValue schema.BlacklistValue
)
// Type defines the type for the "type" enum field.
type Type string
// TypeTorrent is the default value of the Type enum.
const DefaultType = TypeTorrent
// Type values.
const (
TypeMedia Type = "media"
@@ -95,26 +83,6 @@ func ByType(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldType, opts...).ToFunc()
}
// ByTorrentHash orders the results by the torrent_hash field.
func ByTorrentHash(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldTorrentHash, opts...).ToFunc()
}
// ByTorrentName orders the results by the torrent_name field.
func ByTorrentName(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldTorrentName, opts...).ToFunc()
}
// ByMediaID orders the results by the media_id field.
func ByMediaID(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldMediaID, opts...).ToFunc()
}
// ByCreateTime orders the results by the create_time field.
func ByCreateTime(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldCreateTime, opts...).ToFunc()
}
// ByNotes orders the results by the notes field.
func ByNotes(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldNotes, opts...).ToFunc()

View File

@@ -4,7 +4,6 @@ package blacklist
import (
"polaris/ent/predicate"
"time"
"entgo.io/ent/dialect/sql"
)
@@ -54,26 +53,6 @@ func IDLTE(id int) predicate.Blacklist {
return predicate.Blacklist(sql.FieldLTE(FieldID, id))
}
// TorrentHash applies equality check predicate on the "torrent_hash" field. It's identical to TorrentHashEQ.
func TorrentHash(v string) predicate.Blacklist {
return predicate.Blacklist(sql.FieldEQ(FieldTorrentHash, v))
}
// TorrentName applies equality check predicate on the "torrent_name" field. It's identical to TorrentNameEQ.
func TorrentName(v string) predicate.Blacklist {
return predicate.Blacklist(sql.FieldEQ(FieldTorrentName, v))
}
// MediaID applies equality check predicate on the "media_id" field. It's identical to MediaIDEQ.
func MediaID(v int) predicate.Blacklist {
return predicate.Blacklist(sql.FieldEQ(FieldMediaID, v))
}
// CreateTime applies equality check predicate on the "create_time" field. It's identical to CreateTimeEQ.
func CreateTime(v time.Time) predicate.Blacklist {
return predicate.Blacklist(sql.FieldEQ(FieldCreateTime, v))
}
// Notes applies equality check predicate on the "notes" field. It's identical to NotesEQ.
func Notes(v string) predicate.Blacklist {
return predicate.Blacklist(sql.FieldEQ(FieldNotes, v))
@@ -99,256 +78,6 @@ func TypeNotIn(vs ...Type) predicate.Blacklist {
return predicate.Blacklist(sql.FieldNotIn(FieldType, vs...))
}
// TorrentHashEQ applies the EQ predicate on the "torrent_hash" field.
func TorrentHashEQ(v string) predicate.Blacklist {
return predicate.Blacklist(sql.FieldEQ(FieldTorrentHash, v))
}
// TorrentHashNEQ applies the NEQ predicate on the "torrent_hash" field.
func TorrentHashNEQ(v string) predicate.Blacklist {
return predicate.Blacklist(sql.FieldNEQ(FieldTorrentHash, v))
}
// TorrentHashIn applies the In predicate on the "torrent_hash" field.
func TorrentHashIn(vs ...string) predicate.Blacklist {
return predicate.Blacklist(sql.FieldIn(FieldTorrentHash, vs...))
}
// TorrentHashNotIn applies the NotIn predicate on the "torrent_hash" field.
func TorrentHashNotIn(vs ...string) predicate.Blacklist {
return predicate.Blacklist(sql.FieldNotIn(FieldTorrentHash, vs...))
}
// TorrentHashGT applies the GT predicate on the "torrent_hash" field.
func TorrentHashGT(v string) predicate.Blacklist {
return predicate.Blacklist(sql.FieldGT(FieldTorrentHash, v))
}
// TorrentHashGTE applies the GTE predicate on the "torrent_hash" field.
func TorrentHashGTE(v string) predicate.Blacklist {
return predicate.Blacklist(sql.FieldGTE(FieldTorrentHash, v))
}
// TorrentHashLT applies the LT predicate on the "torrent_hash" field.
func TorrentHashLT(v string) predicate.Blacklist {
return predicate.Blacklist(sql.FieldLT(FieldTorrentHash, v))
}
// TorrentHashLTE applies the LTE predicate on the "torrent_hash" field.
func TorrentHashLTE(v string) predicate.Blacklist {
return predicate.Blacklist(sql.FieldLTE(FieldTorrentHash, v))
}
// TorrentHashContains applies the Contains predicate on the "torrent_hash" field.
func TorrentHashContains(v string) predicate.Blacklist {
return predicate.Blacklist(sql.FieldContains(FieldTorrentHash, v))
}
// TorrentHashHasPrefix applies the HasPrefix predicate on the "torrent_hash" field.
func TorrentHashHasPrefix(v string) predicate.Blacklist {
return predicate.Blacklist(sql.FieldHasPrefix(FieldTorrentHash, v))
}
// TorrentHashHasSuffix applies the HasSuffix predicate on the "torrent_hash" field.
func TorrentHashHasSuffix(v string) predicate.Blacklist {
return predicate.Blacklist(sql.FieldHasSuffix(FieldTorrentHash, v))
}
// TorrentHashIsNil applies the IsNil predicate on the "torrent_hash" field.
func TorrentHashIsNil() predicate.Blacklist {
return predicate.Blacklist(sql.FieldIsNull(FieldTorrentHash))
}
// TorrentHashNotNil applies the NotNil predicate on the "torrent_hash" field.
func TorrentHashNotNil() predicate.Blacklist {
return predicate.Blacklist(sql.FieldNotNull(FieldTorrentHash))
}
// TorrentHashEqualFold applies the EqualFold predicate on the "torrent_hash" field.
func TorrentHashEqualFold(v string) predicate.Blacklist {
return predicate.Blacklist(sql.FieldEqualFold(FieldTorrentHash, v))
}
// TorrentHashContainsFold applies the ContainsFold predicate on the "torrent_hash" field.
func TorrentHashContainsFold(v string) predicate.Blacklist {
return predicate.Blacklist(sql.FieldContainsFold(FieldTorrentHash, v))
}
// TorrentNameEQ applies the EQ predicate on the "torrent_name" field.
func TorrentNameEQ(v string) predicate.Blacklist {
return predicate.Blacklist(sql.FieldEQ(FieldTorrentName, v))
}
// TorrentNameNEQ applies the NEQ predicate on the "torrent_name" field.
func TorrentNameNEQ(v string) predicate.Blacklist {
return predicate.Blacklist(sql.FieldNEQ(FieldTorrentName, v))
}
// TorrentNameIn applies the In predicate on the "torrent_name" field.
func TorrentNameIn(vs ...string) predicate.Blacklist {
return predicate.Blacklist(sql.FieldIn(FieldTorrentName, vs...))
}
// TorrentNameNotIn applies the NotIn predicate on the "torrent_name" field.
func TorrentNameNotIn(vs ...string) predicate.Blacklist {
return predicate.Blacklist(sql.FieldNotIn(FieldTorrentName, vs...))
}
// TorrentNameGT applies the GT predicate on the "torrent_name" field.
func TorrentNameGT(v string) predicate.Blacklist {
return predicate.Blacklist(sql.FieldGT(FieldTorrentName, v))
}
// TorrentNameGTE applies the GTE predicate on the "torrent_name" field.
func TorrentNameGTE(v string) predicate.Blacklist {
return predicate.Blacklist(sql.FieldGTE(FieldTorrentName, v))
}
// TorrentNameLT applies the LT predicate on the "torrent_name" field.
func TorrentNameLT(v string) predicate.Blacklist {
return predicate.Blacklist(sql.FieldLT(FieldTorrentName, v))
}
// TorrentNameLTE applies the LTE predicate on the "torrent_name" field.
func TorrentNameLTE(v string) predicate.Blacklist {
return predicate.Blacklist(sql.FieldLTE(FieldTorrentName, v))
}
// TorrentNameContains applies the Contains predicate on the "torrent_name" field.
func TorrentNameContains(v string) predicate.Blacklist {
return predicate.Blacklist(sql.FieldContains(FieldTorrentName, v))
}
// TorrentNameHasPrefix applies the HasPrefix predicate on the "torrent_name" field.
func TorrentNameHasPrefix(v string) predicate.Blacklist {
return predicate.Blacklist(sql.FieldHasPrefix(FieldTorrentName, v))
}
// TorrentNameHasSuffix applies the HasSuffix predicate on the "torrent_name" field.
func TorrentNameHasSuffix(v string) predicate.Blacklist {
return predicate.Blacklist(sql.FieldHasSuffix(FieldTorrentName, v))
}
// TorrentNameIsNil applies the IsNil predicate on the "torrent_name" field.
func TorrentNameIsNil() predicate.Blacklist {
return predicate.Blacklist(sql.FieldIsNull(FieldTorrentName))
}
// TorrentNameNotNil applies the NotNil predicate on the "torrent_name" field.
func TorrentNameNotNil() predicate.Blacklist {
return predicate.Blacklist(sql.FieldNotNull(FieldTorrentName))
}
// TorrentNameEqualFold applies the EqualFold predicate on the "torrent_name" field.
func TorrentNameEqualFold(v string) predicate.Blacklist {
return predicate.Blacklist(sql.FieldEqualFold(FieldTorrentName, v))
}
// TorrentNameContainsFold applies the ContainsFold predicate on the "torrent_name" field.
func TorrentNameContainsFold(v string) predicate.Blacklist {
return predicate.Blacklist(sql.FieldContainsFold(FieldTorrentName, v))
}
// MediaIDEQ applies the EQ predicate on the "media_id" field.
func MediaIDEQ(v int) predicate.Blacklist {
return predicate.Blacklist(sql.FieldEQ(FieldMediaID, v))
}
// MediaIDNEQ applies the NEQ predicate on the "media_id" field.
func MediaIDNEQ(v int) predicate.Blacklist {
return predicate.Blacklist(sql.FieldNEQ(FieldMediaID, v))
}
// MediaIDIn applies the In predicate on the "media_id" field.
func MediaIDIn(vs ...int) predicate.Blacklist {
return predicate.Blacklist(sql.FieldIn(FieldMediaID, vs...))
}
// MediaIDNotIn applies the NotIn predicate on the "media_id" field.
func MediaIDNotIn(vs ...int) predicate.Blacklist {
return predicate.Blacklist(sql.FieldNotIn(FieldMediaID, vs...))
}
// MediaIDGT applies the GT predicate on the "media_id" field.
func MediaIDGT(v int) predicate.Blacklist {
return predicate.Blacklist(sql.FieldGT(FieldMediaID, v))
}
// MediaIDGTE applies the GTE predicate on the "media_id" field.
func MediaIDGTE(v int) predicate.Blacklist {
return predicate.Blacklist(sql.FieldGTE(FieldMediaID, v))
}
// MediaIDLT applies the LT predicate on the "media_id" field.
func MediaIDLT(v int) predicate.Blacklist {
return predicate.Blacklist(sql.FieldLT(FieldMediaID, v))
}
// MediaIDLTE applies the LTE predicate on the "media_id" field.
func MediaIDLTE(v int) predicate.Blacklist {
return predicate.Blacklist(sql.FieldLTE(FieldMediaID, v))
}
// MediaIDIsNil applies the IsNil predicate on the "media_id" field.
func MediaIDIsNil() predicate.Blacklist {
return predicate.Blacklist(sql.FieldIsNull(FieldMediaID))
}
// MediaIDNotNil applies the NotNil predicate on the "media_id" field.
func MediaIDNotNil() predicate.Blacklist {
return predicate.Blacklist(sql.FieldNotNull(FieldMediaID))
}
// CreateTimeEQ applies the EQ predicate on the "create_time" field.
func CreateTimeEQ(v time.Time) predicate.Blacklist {
return predicate.Blacklist(sql.FieldEQ(FieldCreateTime, v))
}
// CreateTimeNEQ applies the NEQ predicate on the "create_time" field.
func CreateTimeNEQ(v time.Time) predicate.Blacklist {
return predicate.Blacklist(sql.FieldNEQ(FieldCreateTime, v))
}
// CreateTimeIn applies the In predicate on the "create_time" field.
func CreateTimeIn(vs ...time.Time) predicate.Blacklist {
return predicate.Blacklist(sql.FieldIn(FieldCreateTime, vs...))
}
// CreateTimeNotIn applies the NotIn predicate on the "create_time" field.
func CreateTimeNotIn(vs ...time.Time) predicate.Blacklist {
return predicate.Blacklist(sql.FieldNotIn(FieldCreateTime, vs...))
}
// CreateTimeGT applies the GT predicate on the "create_time" field.
func CreateTimeGT(v time.Time) predicate.Blacklist {
return predicate.Blacklist(sql.FieldGT(FieldCreateTime, v))
}
// CreateTimeGTE applies the GTE predicate on the "create_time" field.
func CreateTimeGTE(v time.Time) predicate.Blacklist {
return predicate.Blacklist(sql.FieldGTE(FieldCreateTime, v))
}
// CreateTimeLT applies the LT predicate on the "create_time" field.
func CreateTimeLT(v time.Time) predicate.Blacklist {
return predicate.Blacklist(sql.FieldLT(FieldCreateTime, v))
}
// CreateTimeLTE applies the LTE predicate on the "create_time" field.
func CreateTimeLTE(v time.Time) predicate.Blacklist {
return predicate.Blacklist(sql.FieldLTE(FieldCreateTime, v))
}
// CreateTimeIsNil applies the IsNil predicate on the "create_time" field.
func CreateTimeIsNil() predicate.Blacklist {
return predicate.Blacklist(sql.FieldIsNull(FieldCreateTime))
}
// CreateTimeNotNil applies the NotNil predicate on the "create_time" field.
func CreateTimeNotNil() predicate.Blacklist {
return predicate.Blacklist(sql.FieldNotNull(FieldCreateTime))
}
// NotesEQ applies the EQ predicate on the "notes" field.
func NotesEQ(v string) predicate.Blacklist {
return predicate.Blacklist(sql.FieldEQ(FieldNotes, v))

View File

@@ -7,7 +7,7 @@ import (
"errors"
"fmt"
"polaris/ent/blacklist"
"time"
"polaris/ent/schema"
"entgo.io/ent/dialect/sql/sqlgraph"
"entgo.io/ent/schema/field"
@@ -26,66 +26,16 @@ func (bc *BlacklistCreate) SetType(b blacklist.Type) *BlacklistCreate {
return bc
}
// SetNillableType sets the "type" field if the given value is not nil.
func (bc *BlacklistCreate) SetNillableType(b *blacklist.Type) *BlacklistCreate {
if b != nil {
bc.SetType(*b)
}
// SetValue sets the "value" field.
func (bc *BlacklistCreate) SetValue(sv schema.BlacklistValue) *BlacklistCreate {
bc.mutation.SetValue(sv)
return bc
}
// SetTorrentHash sets the "torrent_hash" field.
func (bc *BlacklistCreate) SetTorrentHash(s string) *BlacklistCreate {
bc.mutation.SetTorrentHash(s)
return bc
}
// SetNillableTorrentHash sets the "torrent_hash" field if the given value is not nil.
func (bc *BlacklistCreate) SetNillableTorrentHash(s *string) *BlacklistCreate {
if s != nil {
bc.SetTorrentHash(*s)
}
return bc
}
// SetTorrentName sets the "torrent_name" field.
func (bc *BlacklistCreate) SetTorrentName(s string) *BlacklistCreate {
bc.mutation.SetTorrentName(s)
return bc
}
// SetNillableTorrentName sets the "torrent_name" field if the given value is not nil.
func (bc *BlacklistCreate) SetNillableTorrentName(s *string) *BlacklistCreate {
if s != nil {
bc.SetTorrentName(*s)
}
return bc
}
// SetMediaID sets the "media_id" field.
func (bc *BlacklistCreate) SetMediaID(i int) *BlacklistCreate {
bc.mutation.SetMediaID(i)
return bc
}
// SetNillableMediaID sets the "media_id" field if the given value is not nil.
func (bc *BlacklistCreate) SetNillableMediaID(i *int) *BlacklistCreate {
if i != nil {
bc.SetMediaID(*i)
}
return bc
}
// SetCreateTime sets the "create_time" field.
func (bc *BlacklistCreate) SetCreateTime(t time.Time) *BlacklistCreate {
bc.mutation.SetCreateTime(t)
return bc
}
// SetNillableCreateTime sets the "create_time" field if the given value is not nil.
func (bc *BlacklistCreate) SetNillableCreateTime(t *time.Time) *BlacklistCreate {
if t != nil {
bc.SetCreateTime(*t)
// SetNillableValue sets the "value" field if the given value is not nil.
func (bc *BlacklistCreate) SetNillableValue(sv *schema.BlacklistValue) *BlacklistCreate {
if sv != nil {
bc.SetValue(*sv)
}
return bc
}
@@ -139,13 +89,9 @@ func (bc *BlacklistCreate) ExecX(ctx context.Context) {
// defaults sets the default values of the builder before save.
func (bc *BlacklistCreate) defaults() {
if _, ok := bc.mutation.GetType(); !ok {
v := blacklist.DefaultType
bc.mutation.SetType(v)
}
if _, ok := bc.mutation.CreateTime(); !ok {
v := blacklist.DefaultCreateTime()
bc.mutation.SetCreateTime(v)
if _, ok := bc.mutation.Value(); !ok {
v := blacklist.DefaultValue
bc.mutation.SetValue(v)
}
}
@@ -159,6 +105,9 @@ func (bc *BlacklistCreate) check() error {
return &ValidationError{Name: "type", err: fmt.Errorf(`ent: validator failed for field "Blacklist.type": %w`, err)}
}
}
if _, ok := bc.mutation.Value(); !ok {
return &ValidationError{Name: "value", err: errors.New(`ent: missing required field "Blacklist.value"`)}
}
return nil
}
@@ -189,21 +138,9 @@ func (bc *BlacklistCreate) createSpec() (*Blacklist, *sqlgraph.CreateSpec) {
_spec.SetField(blacklist.FieldType, field.TypeEnum, value)
_node.Type = value
}
if value, ok := bc.mutation.TorrentHash(); ok {
_spec.SetField(blacklist.FieldTorrentHash, field.TypeString, value)
_node.TorrentHash = value
}
if value, ok := bc.mutation.TorrentName(); ok {
_spec.SetField(blacklist.FieldTorrentName, field.TypeString, value)
_node.TorrentName = value
}
if value, ok := bc.mutation.MediaID(); ok {
_spec.SetField(blacklist.FieldMediaID, field.TypeInt, value)
_node.MediaID = value
}
if value, ok := bc.mutation.CreateTime(); ok {
_spec.SetField(blacklist.FieldCreateTime, field.TypeTime, value)
_node.CreateTime = value
if value, ok := bc.mutation.Value(); ok {
_spec.SetField(blacklist.FieldValue, field.TypeJSON, value)
_node.Value = value
}
if value, ok := bc.mutation.Notes(); ok {
_spec.SetField(blacklist.FieldNotes, field.TypeString, value)

View File

@@ -8,6 +8,7 @@ import (
"fmt"
"polaris/ent/blacklist"
"polaris/ent/predicate"
"polaris/ent/schema"
"entgo.io/ent/dialect/sql"
"entgo.io/ent/dialect/sql/sqlgraph"
@@ -41,73 +42,20 @@ func (bu *BlacklistUpdate) SetNillableType(b *blacklist.Type) *BlacklistUpdate {
return bu
}
// SetTorrentHash sets the "torrent_hash" field.
func (bu *BlacklistUpdate) SetTorrentHash(s string) *BlacklistUpdate {
bu.mutation.SetTorrentHash(s)
// SetValue sets the "value" field.
func (bu *BlacklistUpdate) SetValue(sv schema.BlacklistValue) *BlacklistUpdate {
bu.mutation.SetValue(sv)
return bu
}
// SetNillableTorrentHash sets the "torrent_hash" field if the given value is not nil.
func (bu *BlacklistUpdate) SetNillableTorrentHash(s *string) *BlacklistUpdate {
if s != nil {
bu.SetTorrentHash(*s)
// SetNillableValue sets the "value" field if the given value is not nil.
func (bu *BlacklistUpdate) SetNillableValue(sv *schema.BlacklistValue) *BlacklistUpdate {
if sv != nil {
bu.SetValue(*sv)
}
return bu
}
// ClearTorrentHash clears the value of the "torrent_hash" field.
func (bu *BlacklistUpdate) ClearTorrentHash() *BlacklistUpdate {
bu.mutation.ClearTorrentHash()
return bu
}
// SetTorrentName sets the "torrent_name" field.
func (bu *BlacklistUpdate) SetTorrentName(s string) *BlacklistUpdate {
bu.mutation.SetTorrentName(s)
return bu
}
// SetNillableTorrentName sets the "torrent_name" field if the given value is not nil.
func (bu *BlacklistUpdate) SetNillableTorrentName(s *string) *BlacklistUpdate {
if s != nil {
bu.SetTorrentName(*s)
}
return bu
}
// ClearTorrentName clears the value of the "torrent_name" field.
func (bu *BlacklistUpdate) ClearTorrentName() *BlacklistUpdate {
bu.mutation.ClearTorrentName()
return bu
}
// SetMediaID sets the "media_id" field.
func (bu *BlacklistUpdate) SetMediaID(i int) *BlacklistUpdate {
bu.mutation.ResetMediaID()
bu.mutation.SetMediaID(i)
return bu
}
// SetNillableMediaID sets the "media_id" field if the given value is not nil.
func (bu *BlacklistUpdate) SetNillableMediaID(i *int) *BlacklistUpdate {
if i != nil {
bu.SetMediaID(*i)
}
return bu
}
// AddMediaID adds i to the "media_id" field.
func (bu *BlacklistUpdate) AddMediaID(i int) *BlacklistUpdate {
bu.mutation.AddMediaID(i)
return bu
}
// ClearMediaID clears the value of the "media_id" field.
func (bu *BlacklistUpdate) ClearMediaID() *BlacklistUpdate {
bu.mutation.ClearMediaID()
return bu
}
// SetNotes sets the "notes" field.
func (bu *BlacklistUpdate) SetNotes(s string) *BlacklistUpdate {
bu.mutation.SetNotes(s)
@@ -185,29 +133,8 @@ func (bu *BlacklistUpdate) sqlSave(ctx context.Context) (n int, err error) {
if value, ok := bu.mutation.GetType(); ok {
_spec.SetField(blacklist.FieldType, field.TypeEnum, value)
}
if value, ok := bu.mutation.TorrentHash(); ok {
_spec.SetField(blacklist.FieldTorrentHash, field.TypeString, value)
}
if bu.mutation.TorrentHashCleared() {
_spec.ClearField(blacklist.FieldTorrentHash, field.TypeString)
}
if value, ok := bu.mutation.TorrentName(); ok {
_spec.SetField(blacklist.FieldTorrentName, field.TypeString, value)
}
if bu.mutation.TorrentNameCleared() {
_spec.ClearField(blacklist.FieldTorrentName, field.TypeString)
}
if value, ok := bu.mutation.MediaID(); ok {
_spec.SetField(blacklist.FieldMediaID, field.TypeInt, value)
}
if value, ok := bu.mutation.AddedMediaID(); ok {
_spec.AddField(blacklist.FieldMediaID, field.TypeInt, value)
}
if bu.mutation.MediaIDCleared() {
_spec.ClearField(blacklist.FieldMediaID, field.TypeInt)
}
if bu.mutation.CreateTimeCleared() {
_spec.ClearField(blacklist.FieldCreateTime, field.TypeTime)
if value, ok := bu.mutation.Value(); ok {
_spec.SetField(blacklist.FieldValue, field.TypeJSON, value)
}
if value, ok := bu.mutation.Notes(); ok {
_spec.SetField(blacklist.FieldNotes, field.TypeString, value)
@@ -249,73 +176,20 @@ func (buo *BlacklistUpdateOne) SetNillableType(b *blacklist.Type) *BlacklistUpda
return buo
}
// SetTorrentHash sets the "torrent_hash" field.
func (buo *BlacklistUpdateOne) SetTorrentHash(s string) *BlacklistUpdateOne {
buo.mutation.SetTorrentHash(s)
// SetValue sets the "value" field.
func (buo *BlacklistUpdateOne) SetValue(sv schema.BlacklistValue) *BlacklistUpdateOne {
buo.mutation.SetValue(sv)
return buo
}
// SetNillableTorrentHash sets the "torrent_hash" field if the given value is not nil.
func (buo *BlacklistUpdateOne) SetNillableTorrentHash(s *string) *BlacklistUpdateOne {
if s != nil {
buo.SetTorrentHash(*s)
// SetNillableValue sets the "value" field if the given value is not nil.
func (buo *BlacklistUpdateOne) SetNillableValue(sv *schema.BlacklistValue) *BlacklistUpdateOne {
if sv != nil {
buo.SetValue(*sv)
}
return buo
}
// ClearTorrentHash clears the value of the "torrent_hash" field.
func (buo *BlacklistUpdateOne) ClearTorrentHash() *BlacklistUpdateOne {
buo.mutation.ClearTorrentHash()
return buo
}
// SetTorrentName sets the "torrent_name" field.
func (buo *BlacklistUpdateOne) SetTorrentName(s string) *BlacklistUpdateOne {
buo.mutation.SetTorrentName(s)
return buo
}
// SetNillableTorrentName sets the "torrent_name" field if the given value is not nil.
func (buo *BlacklistUpdateOne) SetNillableTorrentName(s *string) *BlacklistUpdateOne {
if s != nil {
buo.SetTorrentName(*s)
}
return buo
}
// ClearTorrentName clears the value of the "torrent_name" field.
func (buo *BlacklistUpdateOne) ClearTorrentName() *BlacklistUpdateOne {
buo.mutation.ClearTorrentName()
return buo
}
// SetMediaID sets the "media_id" field.
func (buo *BlacklistUpdateOne) SetMediaID(i int) *BlacklistUpdateOne {
buo.mutation.ResetMediaID()
buo.mutation.SetMediaID(i)
return buo
}
// SetNillableMediaID sets the "media_id" field if the given value is not nil.
func (buo *BlacklistUpdateOne) SetNillableMediaID(i *int) *BlacklistUpdateOne {
if i != nil {
buo.SetMediaID(*i)
}
return buo
}
// AddMediaID adds i to the "media_id" field.
func (buo *BlacklistUpdateOne) AddMediaID(i int) *BlacklistUpdateOne {
buo.mutation.AddMediaID(i)
return buo
}
// ClearMediaID clears the value of the "media_id" field.
func (buo *BlacklistUpdateOne) ClearMediaID() *BlacklistUpdateOne {
buo.mutation.ClearMediaID()
return buo
}
// SetNotes sets the "notes" field.
func (buo *BlacklistUpdateOne) SetNotes(s string) *BlacklistUpdateOne {
buo.mutation.SetNotes(s)
@@ -423,29 +297,8 @@ func (buo *BlacklistUpdateOne) sqlSave(ctx context.Context) (_node *Blacklist, e
if value, ok := buo.mutation.GetType(); ok {
_spec.SetField(blacklist.FieldType, field.TypeEnum, value)
}
if value, ok := buo.mutation.TorrentHash(); ok {
_spec.SetField(blacklist.FieldTorrentHash, field.TypeString, value)
}
if buo.mutation.TorrentHashCleared() {
_spec.ClearField(blacklist.FieldTorrentHash, field.TypeString)
}
if value, ok := buo.mutation.TorrentName(); ok {
_spec.SetField(blacklist.FieldTorrentName, field.TypeString, value)
}
if buo.mutation.TorrentNameCleared() {
_spec.ClearField(blacklist.FieldTorrentName, field.TypeString)
}
if value, ok := buo.mutation.MediaID(); ok {
_spec.SetField(blacklist.FieldMediaID, field.TypeInt, value)
}
if value, ok := buo.mutation.AddedMediaID(); ok {
_spec.AddField(blacklist.FieldMediaID, field.TypeInt, value)
}
if buo.mutation.MediaIDCleared() {
_spec.ClearField(blacklist.FieldMediaID, field.TypeInt)
}
if buo.mutation.CreateTimeCleared() {
_spec.ClearField(blacklist.FieldCreateTime, field.TypeTime)
if value, ok := buo.mutation.Value(); ok {
_spec.SetField(blacklist.FieldValue, field.TypeJSON, value)
}
if value, ok := buo.mutation.Notes(); ok {
_spec.SetField(blacklist.FieldNotes, field.TypeString, value)

View File

@@ -6,7 +6,6 @@ import (
"fmt"
"polaris/ent/downloadclients"
"strings"
"time"
"entgo.io/ent"
"entgo.io/ent/dialect/sql"
@@ -33,16 +32,12 @@ type DownloadClients struct {
Settings string `json:"settings,omitempty"`
// Priority1 holds the value of the "priority1" field.
Priority1 int `json:"priority1,omitempty"`
// use stun server to do nat traversal, enable download client to do uploading successfully
UseNatTraversal bool `json:"use_nat_traversal,omitempty"`
// RemoveCompletedDownloads holds the value of the "remove_completed_downloads" field.
RemoveCompletedDownloads bool `json:"remove_completed_downloads,omitempty"`
// RemoveFailedDownloads holds the value of the "remove_failed_downloads" field.
RemoveFailedDownloads bool `json:"remove_failed_downloads,omitempty"`
// Tags holds the value of the "tags" field.
Tags string `json:"tags,omitempty"`
// CreateTime holds the value of the "create_time" field.
CreateTime time.Time `json:"create_time,omitempty"`
Tags string `json:"tags,omitempty"`
selectValues sql.SelectValues
}
@@ -51,14 +46,12 @@ func (*DownloadClients) scanValues(columns []string) ([]any, error) {
values := make([]any, len(columns))
for i := range columns {
switch columns[i] {
case downloadclients.FieldEnable, downloadclients.FieldUseNatTraversal, downloadclients.FieldRemoveCompletedDownloads, downloadclients.FieldRemoveFailedDownloads:
case downloadclients.FieldEnable, downloadclients.FieldRemoveCompletedDownloads, downloadclients.FieldRemoveFailedDownloads:
values[i] = new(sql.NullBool)
case downloadclients.FieldID, downloadclients.FieldPriority1:
values[i] = new(sql.NullInt64)
case downloadclients.FieldName, downloadclients.FieldImplementation, downloadclients.FieldURL, downloadclients.FieldUser, downloadclients.FieldPassword, downloadclients.FieldSettings, downloadclients.FieldTags:
values[i] = new(sql.NullString)
case downloadclients.FieldCreateTime:
values[i] = new(sql.NullTime)
default:
values[i] = new(sql.UnknownType)
}
@@ -128,12 +121,6 @@ func (dc *DownloadClients) assignValues(columns []string, values []any) error {
} else if value.Valid {
dc.Priority1 = int(value.Int64)
}
case downloadclients.FieldUseNatTraversal:
if value, ok := values[i].(*sql.NullBool); !ok {
return fmt.Errorf("unexpected type %T for field use_nat_traversal", values[i])
} else if value.Valid {
dc.UseNatTraversal = value.Bool
}
case downloadclients.FieldRemoveCompletedDownloads:
if value, ok := values[i].(*sql.NullBool); !ok {
return fmt.Errorf("unexpected type %T for field remove_completed_downloads", values[i])
@@ -152,12 +139,6 @@ func (dc *DownloadClients) assignValues(columns []string, values []any) error {
} else if value.Valid {
dc.Tags = value.String
}
case downloadclients.FieldCreateTime:
if value, ok := values[i].(*sql.NullTime); !ok {
return fmt.Errorf("unexpected type %T for field create_time", values[i])
} else if value.Valid {
dc.CreateTime = value.Time
}
default:
dc.selectValues.Set(columns[i], values[i])
}
@@ -218,9 +199,6 @@ func (dc *DownloadClients) String() string {
builder.WriteString("priority1=")
builder.WriteString(fmt.Sprintf("%v", dc.Priority1))
builder.WriteString(", ")
builder.WriteString("use_nat_traversal=")
builder.WriteString(fmt.Sprintf("%v", dc.UseNatTraversal))
builder.WriteString(", ")
builder.WriteString("remove_completed_downloads=")
builder.WriteString(fmt.Sprintf("%v", dc.RemoveCompletedDownloads))
builder.WriteString(", ")
@@ -229,9 +207,6 @@ func (dc *DownloadClients) String() string {
builder.WriteString(", ")
builder.WriteString("tags=")
builder.WriteString(dc.Tags)
builder.WriteString(", ")
builder.WriteString("create_time=")
builder.WriteString(dc.CreateTime.Format(time.ANSIC))
builder.WriteByte(')')
return builder.String()
}

View File

@@ -4,7 +4,6 @@ package downloadclients
import (
"fmt"
"time"
"entgo.io/ent/dialect/sql"
)
@@ -30,16 +29,12 @@ const (
FieldSettings = "settings"
// FieldPriority1 holds the string denoting the priority1 field in the database.
FieldPriority1 = "priority1"
// FieldUseNatTraversal holds the string denoting the use_nat_traversal field in the database.
FieldUseNatTraversal = "use_nat_traversal"
// FieldRemoveCompletedDownloads holds the string denoting the remove_completed_downloads field in the database.
FieldRemoveCompletedDownloads = "remove_completed_downloads"
// FieldRemoveFailedDownloads holds the string denoting the remove_failed_downloads field in the database.
FieldRemoveFailedDownloads = "remove_failed_downloads"
// FieldTags holds the string denoting the tags field in the database.
FieldTags = "tags"
// FieldCreateTime holds the string denoting the create_time field in the database.
FieldCreateTime = "create_time"
// Table holds the table name of the downloadclients in the database.
Table = "download_clients"
)
@@ -55,11 +50,9 @@ var Columns = []string{
FieldPassword,
FieldSettings,
FieldPriority1,
FieldUseNatTraversal,
FieldRemoveCompletedDownloads,
FieldRemoveFailedDownloads,
FieldTags,
FieldCreateTime,
}
// ValidColumn reports if the column name is valid (part of the table columns).
@@ -83,16 +76,12 @@ var (
DefaultPriority1 int
// Priority1Validator is a validator for the "priority1" field. It is called by the builders before save.
Priority1Validator func(int) error
// DefaultUseNatTraversal holds the default value on creation for the "use_nat_traversal" field.
DefaultUseNatTraversal bool
// DefaultRemoveCompletedDownloads holds the default value on creation for the "remove_completed_downloads" field.
DefaultRemoveCompletedDownloads bool
// DefaultRemoveFailedDownloads holds the default value on creation for the "remove_failed_downloads" field.
DefaultRemoveFailedDownloads bool
// DefaultTags holds the default value on creation for the "tags" field.
DefaultTags string
// DefaultCreateTime holds the default value on creation for the "create_time" field.
DefaultCreateTime func() time.Time
)
// Implementation defines the type for the "implementation" enum field.
@@ -102,7 +91,6 @@ type Implementation string
const (
ImplementationTransmission Implementation = "transmission"
ImplementationQbittorrent Implementation = "qbittorrent"
ImplementationBuildin Implementation = "buildin"
)
func (i Implementation) String() string {
@@ -112,7 +100,7 @@ func (i Implementation) String() string {
// ImplementationValidator is a validator for the "implementation" field enum values. It is called by the builders before save.
func ImplementationValidator(i Implementation) error {
switch i {
case ImplementationTransmission, ImplementationQbittorrent, ImplementationBuildin:
case ImplementationTransmission, ImplementationQbittorrent:
return nil
default:
return fmt.Errorf("downloadclients: invalid enum value for implementation field: %q", i)
@@ -167,11 +155,6 @@ func ByPriority1(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldPriority1, opts...).ToFunc()
}
// ByUseNatTraversal orders the results by the use_nat_traversal field.
func ByUseNatTraversal(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldUseNatTraversal, opts...).ToFunc()
}
// ByRemoveCompletedDownloads orders the results by the remove_completed_downloads field.
func ByRemoveCompletedDownloads(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldRemoveCompletedDownloads, opts...).ToFunc()
@@ -186,8 +169,3 @@ func ByRemoveFailedDownloads(opts ...sql.OrderTermOption) OrderOption {
func ByTags(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldTags, opts...).ToFunc()
}
// ByCreateTime orders the results by the create_time field.
func ByCreateTime(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldCreateTime, opts...).ToFunc()
}

View File

@@ -4,7 +4,6 @@ package downloadclients
import (
"polaris/ent/predicate"
"time"
"entgo.io/ent/dialect/sql"
)
@@ -89,11 +88,6 @@ func Priority1(v int) predicate.DownloadClients {
return predicate.DownloadClients(sql.FieldEQ(FieldPriority1, v))
}
// UseNatTraversal applies equality check predicate on the "use_nat_traversal" field. It's identical to UseNatTraversalEQ.
func UseNatTraversal(v bool) predicate.DownloadClients {
return predicate.DownloadClients(sql.FieldEQ(FieldUseNatTraversal, v))
}
// RemoveCompletedDownloads applies equality check predicate on the "remove_completed_downloads" field. It's identical to RemoveCompletedDownloadsEQ.
func RemoveCompletedDownloads(v bool) predicate.DownloadClients {
return predicate.DownloadClients(sql.FieldEQ(FieldRemoveCompletedDownloads, v))
@@ -109,11 +103,6 @@ func Tags(v string) predicate.DownloadClients {
return predicate.DownloadClients(sql.FieldEQ(FieldTags, v))
}
// CreateTime applies equality check predicate on the "create_time" field. It's identical to CreateTimeEQ.
func CreateTime(v time.Time) predicate.DownloadClients {
return predicate.DownloadClients(sql.FieldEQ(FieldCreateTime, v))
}
// EnableEQ applies the EQ predicate on the "enable" field.
func EnableEQ(v bool) predicate.DownloadClients {
return predicate.DownloadClients(sql.FieldEQ(FieldEnable, v))
@@ -509,26 +498,6 @@ func Priority1LTE(v int) predicate.DownloadClients {
return predicate.DownloadClients(sql.FieldLTE(FieldPriority1, v))
}
// UseNatTraversalEQ applies the EQ predicate on the "use_nat_traversal" field.
func UseNatTraversalEQ(v bool) predicate.DownloadClients {
return predicate.DownloadClients(sql.FieldEQ(FieldUseNatTraversal, v))
}
// UseNatTraversalNEQ applies the NEQ predicate on the "use_nat_traversal" field.
func UseNatTraversalNEQ(v bool) predicate.DownloadClients {
return predicate.DownloadClients(sql.FieldNEQ(FieldUseNatTraversal, v))
}
// UseNatTraversalIsNil applies the IsNil predicate on the "use_nat_traversal" field.
func UseNatTraversalIsNil() predicate.DownloadClients {
return predicate.DownloadClients(sql.FieldIsNull(FieldUseNatTraversal))
}
// UseNatTraversalNotNil applies the NotNil predicate on the "use_nat_traversal" field.
func UseNatTraversalNotNil() predicate.DownloadClients {
return predicate.DownloadClients(sql.FieldNotNull(FieldUseNatTraversal))
}
// RemoveCompletedDownloadsEQ applies the EQ predicate on the "remove_completed_downloads" field.
func RemoveCompletedDownloadsEQ(v bool) predicate.DownloadClients {
return predicate.DownloadClients(sql.FieldEQ(FieldRemoveCompletedDownloads, v))
@@ -614,56 +583,6 @@ func TagsContainsFold(v string) predicate.DownloadClients {
return predicate.DownloadClients(sql.FieldContainsFold(FieldTags, v))
}
// CreateTimeEQ applies the EQ predicate on the "create_time" field.
func CreateTimeEQ(v time.Time) predicate.DownloadClients {
return predicate.DownloadClients(sql.FieldEQ(FieldCreateTime, v))
}
// CreateTimeNEQ applies the NEQ predicate on the "create_time" field.
func CreateTimeNEQ(v time.Time) predicate.DownloadClients {
return predicate.DownloadClients(sql.FieldNEQ(FieldCreateTime, v))
}
// CreateTimeIn applies the In predicate on the "create_time" field.
func CreateTimeIn(vs ...time.Time) predicate.DownloadClients {
return predicate.DownloadClients(sql.FieldIn(FieldCreateTime, vs...))
}
// CreateTimeNotIn applies the NotIn predicate on the "create_time" field.
func CreateTimeNotIn(vs ...time.Time) predicate.DownloadClients {
return predicate.DownloadClients(sql.FieldNotIn(FieldCreateTime, vs...))
}
// CreateTimeGT applies the GT predicate on the "create_time" field.
func CreateTimeGT(v time.Time) predicate.DownloadClients {
return predicate.DownloadClients(sql.FieldGT(FieldCreateTime, v))
}
// CreateTimeGTE applies the GTE predicate on the "create_time" field.
func CreateTimeGTE(v time.Time) predicate.DownloadClients {
return predicate.DownloadClients(sql.FieldGTE(FieldCreateTime, v))
}
// CreateTimeLT applies the LT predicate on the "create_time" field.
func CreateTimeLT(v time.Time) predicate.DownloadClients {
return predicate.DownloadClients(sql.FieldLT(FieldCreateTime, v))
}
// CreateTimeLTE applies the LTE predicate on the "create_time" field.
func CreateTimeLTE(v time.Time) predicate.DownloadClients {
return predicate.DownloadClients(sql.FieldLTE(FieldCreateTime, v))
}
// CreateTimeIsNil applies the IsNil predicate on the "create_time" field.
func CreateTimeIsNil() predicate.DownloadClients {
return predicate.DownloadClients(sql.FieldIsNull(FieldCreateTime))
}
// CreateTimeNotNil applies the NotNil predicate on the "create_time" field.
func CreateTimeNotNil() predicate.DownloadClients {
return predicate.DownloadClients(sql.FieldNotNull(FieldCreateTime))
}
// And groups predicates with the AND operator between them.
func And(predicates ...predicate.DownloadClients) predicate.DownloadClients {
return predicate.DownloadClients(sql.AndPredicates(predicates...))

View File

@@ -7,7 +7,6 @@ import (
"errors"
"fmt"
"polaris/ent/downloadclients"
"time"
"entgo.io/ent/dialect/sql/sqlgraph"
"entgo.io/ent/schema/field"
@@ -100,20 +99,6 @@ func (dcc *DownloadClientsCreate) SetNillablePriority1(i *int) *DownloadClientsC
return dcc
}
// SetUseNatTraversal sets the "use_nat_traversal" field.
func (dcc *DownloadClientsCreate) SetUseNatTraversal(b bool) *DownloadClientsCreate {
dcc.mutation.SetUseNatTraversal(b)
return dcc
}
// SetNillableUseNatTraversal sets the "use_nat_traversal" field if the given value is not nil.
func (dcc *DownloadClientsCreate) SetNillableUseNatTraversal(b *bool) *DownloadClientsCreate {
if b != nil {
dcc.SetUseNatTraversal(*b)
}
return dcc
}
// SetRemoveCompletedDownloads sets the "remove_completed_downloads" field.
func (dcc *DownloadClientsCreate) SetRemoveCompletedDownloads(b bool) *DownloadClientsCreate {
dcc.mutation.SetRemoveCompletedDownloads(b)
@@ -156,20 +141,6 @@ func (dcc *DownloadClientsCreate) SetNillableTags(s *string) *DownloadClientsCre
return dcc
}
// SetCreateTime sets the "create_time" field.
func (dcc *DownloadClientsCreate) SetCreateTime(t time.Time) *DownloadClientsCreate {
dcc.mutation.SetCreateTime(t)
return dcc
}
// SetNillableCreateTime sets the "create_time" field if the given value is not nil.
func (dcc *DownloadClientsCreate) SetNillableCreateTime(t *time.Time) *DownloadClientsCreate {
if t != nil {
dcc.SetCreateTime(*t)
}
return dcc
}
// Mutation returns the DownloadClientsMutation object of the builder.
func (dcc *DownloadClientsCreate) Mutation() *DownloadClientsMutation {
return dcc.mutation
@@ -221,10 +192,6 @@ func (dcc *DownloadClientsCreate) defaults() {
v := downloadclients.DefaultPriority1
dcc.mutation.SetPriority1(v)
}
if _, ok := dcc.mutation.UseNatTraversal(); !ok {
v := downloadclients.DefaultUseNatTraversal
dcc.mutation.SetUseNatTraversal(v)
}
if _, ok := dcc.mutation.RemoveCompletedDownloads(); !ok {
v := downloadclients.DefaultRemoveCompletedDownloads
dcc.mutation.SetRemoveCompletedDownloads(v)
@@ -237,10 +204,6 @@ func (dcc *DownloadClientsCreate) defaults() {
v := downloadclients.DefaultTags
dcc.mutation.SetTags(v)
}
if _, ok := dcc.mutation.CreateTime(); !ok {
v := downloadclients.DefaultCreateTime()
dcc.mutation.SetCreateTime(v)
}
}
// check runs all checks and user-defined validators on the builder.
@@ -346,10 +309,6 @@ func (dcc *DownloadClientsCreate) createSpec() (*DownloadClients, *sqlgraph.Crea
_spec.SetField(downloadclients.FieldPriority1, field.TypeInt, value)
_node.Priority1 = value
}
if value, ok := dcc.mutation.UseNatTraversal(); ok {
_spec.SetField(downloadclients.FieldUseNatTraversal, field.TypeBool, value)
_node.UseNatTraversal = value
}
if value, ok := dcc.mutation.RemoveCompletedDownloads(); ok {
_spec.SetField(downloadclients.FieldRemoveCompletedDownloads, field.TypeBool, value)
_node.RemoveCompletedDownloads = value
@@ -362,10 +321,6 @@ func (dcc *DownloadClientsCreate) createSpec() (*DownloadClients, *sqlgraph.Crea
_spec.SetField(downloadclients.FieldTags, field.TypeString, value)
_node.Tags = value
}
if value, ok := dcc.mutation.CreateTime(); ok {
_spec.SetField(downloadclients.FieldCreateTime, field.TypeTime, value)
_node.CreateTime = value
}
return _node, _spec
}

View File

@@ -146,26 +146,6 @@ func (dcu *DownloadClientsUpdate) AddPriority1(i int) *DownloadClientsUpdate {
return dcu
}
// SetUseNatTraversal sets the "use_nat_traversal" field.
func (dcu *DownloadClientsUpdate) SetUseNatTraversal(b bool) *DownloadClientsUpdate {
dcu.mutation.SetUseNatTraversal(b)
return dcu
}
// SetNillableUseNatTraversal sets the "use_nat_traversal" field if the given value is not nil.
func (dcu *DownloadClientsUpdate) SetNillableUseNatTraversal(b *bool) *DownloadClientsUpdate {
if b != nil {
dcu.SetUseNatTraversal(*b)
}
return dcu
}
// ClearUseNatTraversal clears the value of the "use_nat_traversal" field.
func (dcu *DownloadClientsUpdate) ClearUseNatTraversal() *DownloadClientsUpdate {
dcu.mutation.ClearUseNatTraversal()
return dcu
}
// SetRemoveCompletedDownloads sets the "remove_completed_downloads" field.
func (dcu *DownloadClientsUpdate) SetRemoveCompletedDownloads(b bool) *DownloadClientsUpdate {
dcu.mutation.SetRemoveCompletedDownloads(b)
@@ -294,12 +274,6 @@ func (dcu *DownloadClientsUpdate) sqlSave(ctx context.Context) (n int, err error
if value, ok := dcu.mutation.AddedPriority1(); ok {
_spec.AddField(downloadclients.FieldPriority1, field.TypeInt, value)
}
if value, ok := dcu.mutation.UseNatTraversal(); ok {
_spec.SetField(downloadclients.FieldUseNatTraversal, field.TypeBool, value)
}
if dcu.mutation.UseNatTraversalCleared() {
_spec.ClearField(downloadclients.FieldUseNatTraversal, field.TypeBool)
}
if value, ok := dcu.mutation.RemoveCompletedDownloads(); ok {
_spec.SetField(downloadclients.FieldRemoveCompletedDownloads, field.TypeBool, value)
}
@@ -309,9 +283,6 @@ func (dcu *DownloadClientsUpdate) sqlSave(ctx context.Context) (n int, err error
if value, ok := dcu.mutation.Tags(); ok {
_spec.SetField(downloadclients.FieldTags, field.TypeString, value)
}
if dcu.mutation.CreateTimeCleared() {
_spec.ClearField(downloadclients.FieldCreateTime, field.TypeTime)
}
if n, err = sqlgraph.UpdateNodes(ctx, dcu.driver, _spec); err != nil {
if _, ok := err.(*sqlgraph.NotFoundError); ok {
err = &NotFoundError{downloadclients.Label}
@@ -451,26 +422,6 @@ func (dcuo *DownloadClientsUpdateOne) AddPriority1(i int) *DownloadClientsUpdate
return dcuo
}
// SetUseNatTraversal sets the "use_nat_traversal" field.
func (dcuo *DownloadClientsUpdateOne) SetUseNatTraversal(b bool) *DownloadClientsUpdateOne {
dcuo.mutation.SetUseNatTraversal(b)
return dcuo
}
// SetNillableUseNatTraversal sets the "use_nat_traversal" field if the given value is not nil.
func (dcuo *DownloadClientsUpdateOne) SetNillableUseNatTraversal(b *bool) *DownloadClientsUpdateOne {
if b != nil {
dcuo.SetUseNatTraversal(*b)
}
return dcuo
}
// ClearUseNatTraversal clears the value of the "use_nat_traversal" field.
func (dcuo *DownloadClientsUpdateOne) ClearUseNatTraversal() *DownloadClientsUpdateOne {
dcuo.mutation.ClearUseNatTraversal()
return dcuo
}
// SetRemoveCompletedDownloads sets the "remove_completed_downloads" field.
func (dcuo *DownloadClientsUpdateOne) SetRemoveCompletedDownloads(b bool) *DownloadClientsUpdateOne {
dcuo.mutation.SetRemoveCompletedDownloads(b)
@@ -629,12 +580,6 @@ func (dcuo *DownloadClientsUpdateOne) sqlSave(ctx context.Context) (_node *Downl
if value, ok := dcuo.mutation.AddedPriority1(); ok {
_spec.AddField(downloadclients.FieldPriority1, field.TypeInt, value)
}
if value, ok := dcuo.mutation.UseNatTraversal(); ok {
_spec.SetField(downloadclients.FieldUseNatTraversal, field.TypeBool, value)
}
if dcuo.mutation.UseNatTraversalCleared() {
_spec.ClearField(downloadclients.FieldUseNatTraversal, field.TypeBool)
}
if value, ok := dcuo.mutation.RemoveCompletedDownloads(); ok {
_spec.SetField(downloadclients.FieldRemoveCompletedDownloads, field.TypeBool, value)
}
@@ -644,9 +589,6 @@ func (dcuo *DownloadClientsUpdateOne) sqlSave(ctx context.Context) (_node *Downl
if value, ok := dcuo.mutation.Tags(); ok {
_spec.SetField(downloadclients.FieldTags, field.TypeString, value)
}
if dcuo.mutation.CreateTimeCleared() {
_spec.ClearField(downloadclients.FieldCreateTime, field.TypeTime)
}
_node = &DownloadClients{config: dcuo.config}
_spec.Assign = _node.assignValues
_spec.ScanValues = _node.scanValues

View File

@@ -7,7 +7,6 @@ import (
"polaris/ent/episode"
"polaris/ent/media"
"strings"
"time"
"entgo.io/ent"
"entgo.io/ent/dialect/sql"
@@ -36,8 +35,6 @@ type Episode struct {
Monitored bool `json:"monitored"`
// TargetFile holds the value of the "target_file" field.
TargetFile string `json:"target_file,omitempty"`
// CreateTime holds the value of the "create_time" field.
CreateTime time.Time `json:"create_time,omitempty"`
// Edges holds the relations/edges for other nodes in the graph.
// The values are being populated by the EpisodeQuery when eager-loading is set.
Edges EpisodeEdges `json:"edges"`
@@ -75,8 +72,6 @@ func (*Episode) scanValues(columns []string) ([]any, error) {
values[i] = new(sql.NullInt64)
case episode.FieldTitle, episode.FieldOverview, episode.FieldAirDate, episode.FieldStatus, episode.FieldTargetFile:
values[i] = new(sql.NullString)
case episode.FieldCreateTime:
values[i] = new(sql.NullTime)
default:
values[i] = new(sql.UnknownType)
}
@@ -152,12 +147,6 @@ func (e *Episode) assignValues(columns []string, values []any) error {
} else if value.Valid {
e.TargetFile = value.String
}
case episode.FieldCreateTime:
if value, ok := values[i].(*sql.NullTime); !ok {
return fmt.Errorf("unexpected type %T for field create_time", values[i])
} else if value.Valid {
e.CreateTime = value.Time
}
default:
e.selectValues.Set(columns[i], values[i])
}
@@ -225,9 +214,6 @@ func (e *Episode) String() string {
builder.WriteString(", ")
builder.WriteString("target_file=")
builder.WriteString(e.TargetFile)
builder.WriteString(", ")
builder.WriteString("create_time=")
builder.WriteString(e.CreateTime.Format(time.ANSIC))
builder.WriteByte(')')
return builder.String()
}

View File

@@ -4,7 +4,6 @@ package episode
import (
"fmt"
"time"
"entgo.io/ent/dialect/sql"
"entgo.io/ent/dialect/sql/sqlgraph"
@@ -33,8 +32,6 @@ const (
FieldMonitored = "monitored"
// FieldTargetFile holds the string denoting the target_file field in the database.
FieldTargetFile = "target_file"
// FieldCreateTime holds the string denoting the create_time field in the database.
FieldCreateTime = "create_time"
// EdgeMedia holds the string denoting the media edge name in mutations.
EdgeMedia = "media"
// Table holds the table name of the episode in the database.
@@ -60,7 +57,6 @@ var Columns = []string{
FieldStatus,
FieldMonitored,
FieldTargetFile,
FieldCreateTime,
}
// ValidColumn reports if the column name is valid (part of the table columns).
@@ -76,8 +72,6 @@ func ValidColumn(column string) bool {
var (
// DefaultMonitored holds the default value on creation for the "monitored" field.
DefaultMonitored bool
// DefaultCreateTime holds the default value on creation for the "create_time" field.
DefaultCreateTime func() time.Time
)
// Status defines the type for the "status" enum field.
@@ -160,11 +154,6 @@ func ByTargetFile(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldTargetFile, opts...).ToFunc()
}
// ByCreateTime orders the results by the create_time field.
func ByCreateTime(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldCreateTime, opts...).ToFunc()
}
// ByMediaField orders the results by media field.
func ByMediaField(field string, opts ...sql.OrderTermOption) OrderOption {
return func(s *sql.Selector) {

View File

@@ -4,7 +4,6 @@ package episode
import (
"polaris/ent/predicate"
"time"
"entgo.io/ent/dialect/sql"
"entgo.io/ent/dialect/sql/sqlgraph"
@@ -95,11 +94,6 @@ func TargetFile(v string) predicate.Episode {
return predicate.Episode(sql.FieldEQ(FieldTargetFile, v))
}
// CreateTime applies equality check predicate on the "create_time" field. It's identical to CreateTimeEQ.
func CreateTime(v time.Time) predicate.Episode {
return predicate.Episode(sql.FieldEQ(FieldCreateTime, v))
}
// MediaIDEQ applies the EQ predicate on the "media_id" field.
func MediaIDEQ(v int) predicate.Episode {
return predicate.Episode(sql.FieldEQ(FieldMediaID, v))
@@ -510,56 +504,6 @@ func TargetFileContainsFold(v string) predicate.Episode {
return predicate.Episode(sql.FieldContainsFold(FieldTargetFile, v))
}
// CreateTimeEQ applies the EQ predicate on the "create_time" field.
func CreateTimeEQ(v time.Time) predicate.Episode {
return predicate.Episode(sql.FieldEQ(FieldCreateTime, v))
}
// CreateTimeNEQ applies the NEQ predicate on the "create_time" field.
func CreateTimeNEQ(v time.Time) predicate.Episode {
return predicate.Episode(sql.FieldNEQ(FieldCreateTime, v))
}
// CreateTimeIn applies the In predicate on the "create_time" field.
func CreateTimeIn(vs ...time.Time) predicate.Episode {
return predicate.Episode(sql.FieldIn(FieldCreateTime, vs...))
}
// CreateTimeNotIn applies the NotIn predicate on the "create_time" field.
func CreateTimeNotIn(vs ...time.Time) predicate.Episode {
return predicate.Episode(sql.FieldNotIn(FieldCreateTime, vs...))
}
// CreateTimeGT applies the GT predicate on the "create_time" field.
func CreateTimeGT(v time.Time) predicate.Episode {
return predicate.Episode(sql.FieldGT(FieldCreateTime, v))
}
// CreateTimeGTE applies the GTE predicate on the "create_time" field.
func CreateTimeGTE(v time.Time) predicate.Episode {
return predicate.Episode(sql.FieldGTE(FieldCreateTime, v))
}
// CreateTimeLT applies the LT predicate on the "create_time" field.
func CreateTimeLT(v time.Time) predicate.Episode {
return predicate.Episode(sql.FieldLT(FieldCreateTime, v))
}
// CreateTimeLTE applies the LTE predicate on the "create_time" field.
func CreateTimeLTE(v time.Time) predicate.Episode {
return predicate.Episode(sql.FieldLTE(FieldCreateTime, v))
}
// CreateTimeIsNil applies the IsNil predicate on the "create_time" field.
func CreateTimeIsNil() predicate.Episode {
return predicate.Episode(sql.FieldIsNull(FieldCreateTime))
}
// CreateTimeNotNil applies the NotNil predicate on the "create_time" field.
func CreateTimeNotNil() predicate.Episode {
return predicate.Episode(sql.FieldNotNull(FieldCreateTime))
}
// HasMedia applies the HasEdge predicate on the "media" edge.
func HasMedia() predicate.Episode {
return predicate.Episode(func(s *sql.Selector) {

View File

@@ -8,7 +8,6 @@ import (
"fmt"
"polaris/ent/episode"
"polaris/ent/media"
"time"
"entgo.io/ent/dialect/sql/sqlgraph"
"entgo.io/ent/schema/field"
@@ -107,20 +106,6 @@ func (ec *EpisodeCreate) SetNillableTargetFile(s *string) *EpisodeCreate {
return ec
}
// SetCreateTime sets the "create_time" field.
func (ec *EpisodeCreate) SetCreateTime(t time.Time) *EpisodeCreate {
ec.mutation.SetCreateTime(t)
return ec
}
// SetNillableCreateTime sets the "create_time" field if the given value is not nil.
func (ec *EpisodeCreate) SetNillableCreateTime(t *time.Time) *EpisodeCreate {
if t != nil {
ec.SetCreateTime(*t)
}
return ec
}
// SetMedia sets the "media" edge to the Media entity.
func (ec *EpisodeCreate) SetMedia(m *Media) *EpisodeCreate {
return ec.SetMediaID(m.ID)
@@ -169,10 +154,6 @@ func (ec *EpisodeCreate) defaults() {
v := episode.DefaultMonitored
ec.mutation.SetMonitored(v)
}
if _, ok := ec.mutation.CreateTime(); !ok {
v := episode.DefaultCreateTime()
ec.mutation.SetCreateTime(v)
}
}
// check runs all checks and user-defined validators on the builder.
@@ -261,10 +242,6 @@ func (ec *EpisodeCreate) createSpec() (*Episode, *sqlgraph.CreateSpec) {
_spec.SetField(episode.FieldTargetFile, field.TypeString, value)
_node.TargetFile = value
}
if value, ok := ec.mutation.CreateTime(); ok {
_spec.SetField(episode.FieldCreateTime, field.TypeTime, value)
_node.CreateTime = value
}
if nodes := ec.mutation.MediaIDs(); len(nodes) > 0 {
edge := &sqlgraph.EdgeSpec{
Rel: sqlgraph.M2O,

View File

@@ -278,9 +278,6 @@ func (eu *EpisodeUpdate) sqlSave(ctx context.Context) (n int, err error) {
if eu.mutation.TargetFileCleared() {
_spec.ClearField(episode.FieldTargetFile, field.TypeString)
}
if eu.mutation.CreateTimeCleared() {
_spec.ClearField(episode.FieldCreateTime, field.TypeTime)
}
if eu.mutation.MediaCleared() {
edge := &sqlgraph.EdgeSpec{
Rel: sqlgraph.M2O,
@@ -610,9 +607,6 @@ func (euo *EpisodeUpdateOne) sqlSave(ctx context.Context) (_node *Episode, err e
if euo.mutation.TargetFileCleared() {
_spec.ClearField(episode.FieldTargetFile, field.TypeString)
}
if euo.mutation.CreateTimeCleared() {
_spec.ClearField(episode.FieldCreateTime, field.TypeTime)
}
if euo.mutation.MediaCleared() {
edge := &sqlgraph.EdgeSpec{
Rel: sqlgraph.M2O,

View File

@@ -20,6 +20,8 @@ type History struct {
ID int `json:"id,omitempty"`
// MediaID holds the value of the "media_id" field.
MediaID int `json:"media_id,omitempty"`
// deprecated
EpisodeID int `json:"episode_id,omitempty"`
// EpisodeNums holds the value of the "episode_nums" field.
EpisodeNums []int `json:"episode_nums,omitempty"`
// SeasonNum holds the value of the "season_num" field.
@@ -36,14 +38,12 @@ type History struct {
DownloadClientID int `json:"download_client_id,omitempty"`
// IndexerID holds the value of the "indexer_id" field.
IndexerID int `json:"indexer_id,omitempty"`
// torrent link
// Link holds the value of the "link" field.
Link string `json:"link,omitempty"`
// torrent hash
Hash string `json:"hash,omitempty"`
// Status holds the value of the "status" field.
Status history.Status `json:"status,omitempty"`
// CreateTime holds the value of the "create_time" field.
CreateTime time.Time `json:"create_time,omitempty"`
// deprecated
Saved string `json:"saved,omitempty"`
selectValues sql.SelectValues
}
@@ -54,11 +54,11 @@ func (*History) scanValues(columns []string) ([]any, error) {
switch columns[i] {
case history.FieldEpisodeNums:
values[i] = new([]byte)
case history.FieldID, history.FieldMediaID, history.FieldSeasonNum, history.FieldSize, history.FieldDownloadClientID, history.FieldIndexerID:
case history.FieldID, history.FieldMediaID, history.FieldEpisodeID, history.FieldSeasonNum, history.FieldSize, history.FieldDownloadClientID, history.FieldIndexerID:
values[i] = new(sql.NullInt64)
case history.FieldSourceTitle, history.FieldTargetDir, history.FieldLink, history.FieldHash, history.FieldStatus:
case history.FieldSourceTitle, history.FieldTargetDir, history.FieldLink, history.FieldStatus, history.FieldSaved:
values[i] = new(sql.NullString)
case history.FieldDate, history.FieldCreateTime:
case history.FieldDate:
values[i] = new(sql.NullTime)
default:
values[i] = new(sql.UnknownType)
@@ -87,6 +87,12 @@ func (h *History) assignValues(columns []string, values []any) error {
} else if value.Valid {
h.MediaID = int(value.Int64)
}
case history.FieldEpisodeID:
if value, ok := values[i].(*sql.NullInt64); !ok {
return fmt.Errorf("unexpected type %T for field episode_id", values[i])
} else if value.Valid {
h.EpisodeID = int(value.Int64)
}
case history.FieldEpisodeNums:
if value, ok := values[i].(*[]byte); !ok {
return fmt.Errorf("unexpected type %T for field episode_nums", values[i])
@@ -143,23 +149,17 @@ func (h *History) assignValues(columns []string, values []any) error {
} else if value.Valid {
h.Link = value.String
}
case history.FieldHash:
if value, ok := values[i].(*sql.NullString); !ok {
return fmt.Errorf("unexpected type %T for field hash", values[i])
} else if value.Valid {
h.Hash = value.String
}
case history.FieldStatus:
if value, ok := values[i].(*sql.NullString); !ok {
return fmt.Errorf("unexpected type %T for field status", values[i])
} else if value.Valid {
h.Status = history.Status(value.String)
}
case history.FieldCreateTime:
if value, ok := values[i].(*sql.NullTime); !ok {
return fmt.Errorf("unexpected type %T for field create_time", values[i])
case history.FieldSaved:
if value, ok := values[i].(*sql.NullString); !ok {
return fmt.Errorf("unexpected type %T for field saved", values[i])
} else if value.Valid {
h.CreateTime = value.Time
h.Saved = value.String
}
default:
h.selectValues.Set(columns[i], values[i])
@@ -200,6 +200,9 @@ func (h *History) String() string {
builder.WriteString("media_id=")
builder.WriteString(fmt.Sprintf("%v", h.MediaID))
builder.WriteString(", ")
builder.WriteString("episode_id=")
builder.WriteString(fmt.Sprintf("%v", h.EpisodeID))
builder.WriteString(", ")
builder.WriteString("episode_nums=")
builder.WriteString(fmt.Sprintf("%v", h.EpisodeNums))
builder.WriteString(", ")
@@ -227,14 +230,11 @@ func (h *History) String() string {
builder.WriteString("link=")
builder.WriteString(h.Link)
builder.WriteString(", ")
builder.WriteString("hash=")
builder.WriteString(h.Hash)
builder.WriteString(", ")
builder.WriteString("status=")
builder.WriteString(fmt.Sprintf("%v", h.Status))
builder.WriteString(", ")
builder.WriteString("create_time=")
builder.WriteString(h.CreateTime.Format(time.ANSIC))
builder.WriteString("saved=")
builder.WriteString(h.Saved)
builder.WriteByte(')')
return builder.String()
}

View File

@@ -4,7 +4,6 @@ package history
import (
"fmt"
"time"
"entgo.io/ent/dialect/sql"
)
@@ -16,6 +15,8 @@ const (
FieldID = "id"
// FieldMediaID holds the string denoting the media_id field in the database.
FieldMediaID = "media_id"
// FieldEpisodeID holds the string denoting the episode_id field in the database.
FieldEpisodeID = "episode_id"
// FieldEpisodeNums holds the string denoting the episode_nums field in the database.
FieldEpisodeNums = "episode_nums"
// FieldSeasonNum holds the string denoting the season_num field in the database.
@@ -34,12 +35,10 @@ const (
FieldIndexerID = "indexer_id"
// FieldLink holds the string denoting the link field in the database.
FieldLink = "link"
// FieldHash holds the string denoting the hash field in the database.
FieldHash = "hash"
// FieldStatus holds the string denoting the status field in the database.
FieldStatus = "status"
// FieldCreateTime holds the string denoting the create_time field in the database.
FieldCreateTime = "create_time"
// FieldSaved holds the string denoting the saved field in the database.
FieldSaved = "saved"
// Table holds the table name of the history in the database.
Table = "histories"
)
@@ -48,6 +47,7 @@ const (
var Columns = []string{
FieldID,
FieldMediaID,
FieldEpisodeID,
FieldEpisodeNums,
FieldSeasonNum,
FieldSourceTitle,
@@ -57,9 +57,8 @@ var Columns = []string{
FieldDownloadClientID,
FieldIndexerID,
FieldLink,
FieldHash,
FieldStatus,
FieldCreateTime,
FieldSaved,
}
// ValidColumn reports if the column name is valid (part of the table columns).
@@ -75,8 +74,6 @@ func ValidColumn(column string) bool {
var (
// DefaultSize holds the default value on creation for the "size" field.
DefaultSize int
// DefaultCreateTime holds the default value on creation for the "create_time" field.
DefaultCreateTime func() time.Time
)
// Status defines the type for the "status" enum field.
@@ -89,7 +86,6 @@ const (
StatusFail Status = "fail"
StatusUploading Status = "uploading"
StatusSeeding Status = "seeding"
StatusRemoved Status = "removed"
)
func (s Status) String() string {
@@ -99,7 +95,7 @@ func (s Status) String() string {
// StatusValidator is a validator for the "status" field enum values. It is called by the builders before save.
func StatusValidator(s Status) error {
switch s {
case StatusRunning, StatusSuccess, StatusFail, StatusUploading, StatusSeeding, StatusRemoved:
case StatusRunning, StatusSuccess, StatusFail, StatusUploading, StatusSeeding:
return nil
default:
return fmt.Errorf("history: invalid enum value for status field: %q", s)
@@ -119,6 +115,11 @@ func ByMediaID(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldMediaID, opts...).ToFunc()
}
// ByEpisodeID orders the results by the episode_id field.
func ByEpisodeID(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldEpisodeID, opts...).ToFunc()
}
// BySeasonNum orders the results by the season_num field.
func BySeasonNum(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldSeasonNum, opts...).ToFunc()
@@ -159,17 +160,12 @@ func ByLink(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldLink, opts...).ToFunc()
}
// ByHash orders the results by the hash field.
func ByHash(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldHash, opts...).ToFunc()
}
// ByStatus orders the results by the status field.
func ByStatus(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldStatus, opts...).ToFunc()
}
// ByCreateTime orders the results by the create_time field.
func ByCreateTime(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldCreateTime, opts...).ToFunc()
// BySaved orders the results by the saved field.
func BySaved(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldSaved, opts...).ToFunc()
}

View File

@@ -59,6 +59,11 @@ func MediaID(v int) predicate.History {
return predicate.History(sql.FieldEQ(FieldMediaID, v))
}
// EpisodeID applies equality check predicate on the "episode_id" field. It's identical to EpisodeIDEQ.
func EpisodeID(v int) predicate.History {
return predicate.History(sql.FieldEQ(FieldEpisodeID, v))
}
// SeasonNum applies equality check predicate on the "season_num" field. It's identical to SeasonNumEQ.
func SeasonNum(v int) predicate.History {
return predicate.History(sql.FieldEQ(FieldSeasonNum, v))
@@ -99,14 +104,9 @@ func Link(v string) predicate.History {
return predicate.History(sql.FieldEQ(FieldLink, v))
}
// Hash applies equality check predicate on the "hash" field. It's identical to HashEQ.
func Hash(v string) predicate.History {
return predicate.History(sql.FieldEQ(FieldHash, v))
}
// CreateTime applies equality check predicate on the "create_time" field. It's identical to CreateTimeEQ.
func CreateTime(v time.Time) predicate.History {
return predicate.History(sql.FieldEQ(FieldCreateTime, v))
// Saved applies equality check predicate on the "saved" field. It's identical to SavedEQ.
func Saved(v string) predicate.History {
return predicate.History(sql.FieldEQ(FieldSaved, v))
}
// MediaIDEQ applies the EQ predicate on the "media_id" field.
@@ -149,6 +149,56 @@ func MediaIDLTE(v int) predicate.History {
return predicate.History(sql.FieldLTE(FieldMediaID, v))
}
// EpisodeIDEQ applies the EQ predicate on the "episode_id" field.
func EpisodeIDEQ(v int) predicate.History {
return predicate.History(sql.FieldEQ(FieldEpisodeID, v))
}
// EpisodeIDNEQ applies the NEQ predicate on the "episode_id" field.
func EpisodeIDNEQ(v int) predicate.History {
return predicate.History(sql.FieldNEQ(FieldEpisodeID, v))
}
// EpisodeIDIn applies the In predicate on the "episode_id" field.
func EpisodeIDIn(vs ...int) predicate.History {
return predicate.History(sql.FieldIn(FieldEpisodeID, vs...))
}
// EpisodeIDNotIn applies the NotIn predicate on the "episode_id" field.
func EpisodeIDNotIn(vs ...int) predicate.History {
return predicate.History(sql.FieldNotIn(FieldEpisodeID, vs...))
}
// EpisodeIDGT applies the GT predicate on the "episode_id" field.
func EpisodeIDGT(v int) predicate.History {
return predicate.History(sql.FieldGT(FieldEpisodeID, v))
}
// EpisodeIDGTE applies the GTE predicate on the "episode_id" field.
func EpisodeIDGTE(v int) predicate.History {
return predicate.History(sql.FieldGTE(FieldEpisodeID, v))
}
// EpisodeIDLT applies the LT predicate on the "episode_id" field.
func EpisodeIDLT(v int) predicate.History {
return predicate.History(sql.FieldLT(FieldEpisodeID, v))
}
// EpisodeIDLTE applies the LTE predicate on the "episode_id" field.
func EpisodeIDLTE(v int) predicate.History {
return predicate.History(sql.FieldLTE(FieldEpisodeID, v))
}
// EpisodeIDIsNil applies the IsNil predicate on the "episode_id" field.
func EpisodeIDIsNil() predicate.History {
return predicate.History(sql.FieldIsNull(FieldEpisodeID))
}
// EpisodeIDNotNil applies the NotNil predicate on the "episode_id" field.
func EpisodeIDNotNil() predicate.History {
return predicate.History(sql.FieldNotNull(FieldEpisodeID))
}
// EpisodeNumsIsNil applies the IsNil predicate on the "episode_nums" field.
func EpisodeNumsIsNil() predicate.History {
return predicate.History(sql.FieldIsNull(FieldEpisodeNums))
@@ -594,81 +644,6 @@ func LinkContainsFold(v string) predicate.History {
return predicate.History(sql.FieldContainsFold(FieldLink, v))
}
// HashEQ applies the EQ predicate on the "hash" field.
func HashEQ(v string) predicate.History {
return predicate.History(sql.FieldEQ(FieldHash, v))
}
// HashNEQ applies the NEQ predicate on the "hash" field.
func HashNEQ(v string) predicate.History {
return predicate.History(sql.FieldNEQ(FieldHash, v))
}
// HashIn applies the In predicate on the "hash" field.
func HashIn(vs ...string) predicate.History {
return predicate.History(sql.FieldIn(FieldHash, vs...))
}
// HashNotIn applies the NotIn predicate on the "hash" field.
func HashNotIn(vs ...string) predicate.History {
return predicate.History(sql.FieldNotIn(FieldHash, vs...))
}
// HashGT applies the GT predicate on the "hash" field.
func HashGT(v string) predicate.History {
return predicate.History(sql.FieldGT(FieldHash, v))
}
// HashGTE applies the GTE predicate on the "hash" field.
func HashGTE(v string) predicate.History {
return predicate.History(sql.FieldGTE(FieldHash, v))
}
// HashLT applies the LT predicate on the "hash" field.
func HashLT(v string) predicate.History {
return predicate.History(sql.FieldLT(FieldHash, v))
}
// HashLTE applies the LTE predicate on the "hash" field.
func HashLTE(v string) predicate.History {
return predicate.History(sql.FieldLTE(FieldHash, v))
}
// HashContains applies the Contains predicate on the "hash" field.
func HashContains(v string) predicate.History {
return predicate.History(sql.FieldContains(FieldHash, v))
}
// HashHasPrefix applies the HasPrefix predicate on the "hash" field.
func HashHasPrefix(v string) predicate.History {
return predicate.History(sql.FieldHasPrefix(FieldHash, v))
}
// HashHasSuffix applies the HasSuffix predicate on the "hash" field.
func HashHasSuffix(v string) predicate.History {
return predicate.History(sql.FieldHasSuffix(FieldHash, v))
}
// HashIsNil applies the IsNil predicate on the "hash" field.
func HashIsNil() predicate.History {
return predicate.History(sql.FieldIsNull(FieldHash))
}
// HashNotNil applies the NotNil predicate on the "hash" field.
func HashNotNil() predicate.History {
return predicate.History(sql.FieldNotNull(FieldHash))
}
// HashEqualFold applies the EqualFold predicate on the "hash" field.
func HashEqualFold(v string) predicate.History {
return predicate.History(sql.FieldEqualFold(FieldHash, v))
}
// HashContainsFold applies the ContainsFold predicate on the "hash" field.
func HashContainsFold(v string) predicate.History {
return predicate.History(sql.FieldContainsFold(FieldHash, v))
}
// StatusEQ applies the EQ predicate on the "status" field.
func StatusEQ(v Status) predicate.History {
return predicate.History(sql.FieldEQ(FieldStatus, v))
@@ -689,54 +664,79 @@ func StatusNotIn(vs ...Status) predicate.History {
return predicate.History(sql.FieldNotIn(FieldStatus, vs...))
}
// CreateTimeEQ applies the EQ predicate on the "create_time" field.
func CreateTimeEQ(v time.Time) predicate.History {
return predicate.History(sql.FieldEQ(FieldCreateTime, v))
// SavedEQ applies the EQ predicate on the "saved" field.
func SavedEQ(v string) predicate.History {
return predicate.History(sql.FieldEQ(FieldSaved, v))
}
// CreateTimeNEQ applies the NEQ predicate on the "create_time" field.
func CreateTimeNEQ(v time.Time) predicate.History {
return predicate.History(sql.FieldNEQ(FieldCreateTime, v))
// SavedNEQ applies the NEQ predicate on the "saved" field.
func SavedNEQ(v string) predicate.History {
return predicate.History(sql.FieldNEQ(FieldSaved, v))
}
// CreateTimeIn applies the In predicate on the "create_time" field.
func CreateTimeIn(vs ...time.Time) predicate.History {
return predicate.History(sql.FieldIn(FieldCreateTime, vs...))
// SavedIn applies the In predicate on the "saved" field.
func SavedIn(vs ...string) predicate.History {
return predicate.History(sql.FieldIn(FieldSaved, vs...))
}
// CreateTimeNotIn applies the NotIn predicate on the "create_time" field.
func CreateTimeNotIn(vs ...time.Time) predicate.History {
return predicate.History(sql.FieldNotIn(FieldCreateTime, vs...))
// SavedNotIn applies the NotIn predicate on the "saved" field.
func SavedNotIn(vs ...string) predicate.History {
return predicate.History(sql.FieldNotIn(FieldSaved, vs...))
}
// CreateTimeGT applies the GT predicate on the "create_time" field.
func CreateTimeGT(v time.Time) predicate.History {
return predicate.History(sql.FieldGT(FieldCreateTime, v))
// SavedGT applies the GT predicate on the "saved" field.
func SavedGT(v string) predicate.History {
return predicate.History(sql.FieldGT(FieldSaved, v))
}
// CreateTimeGTE applies the GTE predicate on the "create_time" field.
func CreateTimeGTE(v time.Time) predicate.History {
return predicate.History(sql.FieldGTE(FieldCreateTime, v))
// SavedGTE applies the GTE predicate on the "saved" field.
func SavedGTE(v string) predicate.History {
return predicate.History(sql.FieldGTE(FieldSaved, v))
}
// CreateTimeLT applies the LT predicate on the "create_time" field.
func CreateTimeLT(v time.Time) predicate.History {
return predicate.History(sql.FieldLT(FieldCreateTime, v))
// SavedLT applies the LT predicate on the "saved" field.
func SavedLT(v string) predicate.History {
return predicate.History(sql.FieldLT(FieldSaved, v))
}
// CreateTimeLTE applies the LTE predicate on the "create_time" field.
func CreateTimeLTE(v time.Time) predicate.History {
return predicate.History(sql.FieldLTE(FieldCreateTime, v))
// SavedLTE applies the LTE predicate on the "saved" field.
func SavedLTE(v string) predicate.History {
return predicate.History(sql.FieldLTE(FieldSaved, v))
}
// CreateTimeIsNil applies the IsNil predicate on the "create_time" field.
func CreateTimeIsNil() predicate.History {
return predicate.History(sql.FieldIsNull(FieldCreateTime))
// SavedContains applies the Contains predicate on the "saved" field.
func SavedContains(v string) predicate.History {
return predicate.History(sql.FieldContains(FieldSaved, v))
}
// CreateTimeNotNil applies the NotNil predicate on the "create_time" field.
func CreateTimeNotNil() predicate.History {
return predicate.History(sql.FieldNotNull(FieldCreateTime))
// SavedHasPrefix applies the HasPrefix predicate on the "saved" field.
func SavedHasPrefix(v string) predicate.History {
return predicate.History(sql.FieldHasPrefix(FieldSaved, v))
}
// SavedHasSuffix applies the HasSuffix predicate on the "saved" field.
func SavedHasSuffix(v string) predicate.History {
return predicate.History(sql.FieldHasSuffix(FieldSaved, v))
}
// SavedIsNil applies the IsNil predicate on the "saved" field.
func SavedIsNil() predicate.History {
return predicate.History(sql.FieldIsNull(FieldSaved))
}
// SavedNotNil applies the NotNil predicate on the "saved" field.
func SavedNotNil() predicate.History {
return predicate.History(sql.FieldNotNull(FieldSaved))
}
// SavedEqualFold applies the EqualFold predicate on the "saved" field.
func SavedEqualFold(v string) predicate.History {
return predicate.History(sql.FieldEqualFold(FieldSaved, v))
}
// SavedContainsFold applies the ContainsFold predicate on the "saved" field.
func SavedContainsFold(v string) predicate.History {
return predicate.History(sql.FieldContainsFold(FieldSaved, v))
}
// And groups predicates with the AND operator between them.

View File

@@ -26,6 +26,20 @@ func (hc *HistoryCreate) SetMediaID(i int) *HistoryCreate {
return hc
}
// SetEpisodeID sets the "episode_id" field.
func (hc *HistoryCreate) SetEpisodeID(i int) *HistoryCreate {
hc.mutation.SetEpisodeID(i)
return hc
}
// SetNillableEpisodeID sets the "episode_id" field if the given value is not nil.
func (hc *HistoryCreate) SetNillableEpisodeID(i *int) *HistoryCreate {
if i != nil {
hc.SetEpisodeID(*i)
}
return hc
}
// SetEpisodeNums sets the "episode_nums" field.
func (hc *HistoryCreate) SetEpisodeNums(i []int) *HistoryCreate {
hc.mutation.SetEpisodeNums(i)
@@ -120,36 +134,22 @@ func (hc *HistoryCreate) SetNillableLink(s *string) *HistoryCreate {
return hc
}
// SetHash sets the "hash" field.
func (hc *HistoryCreate) SetHash(s string) *HistoryCreate {
hc.mutation.SetHash(s)
return hc
}
// SetNillableHash sets the "hash" field if the given value is not nil.
func (hc *HistoryCreate) SetNillableHash(s *string) *HistoryCreate {
if s != nil {
hc.SetHash(*s)
}
return hc
}
// SetStatus sets the "status" field.
func (hc *HistoryCreate) SetStatus(h history.Status) *HistoryCreate {
hc.mutation.SetStatus(h)
return hc
}
// SetCreateTime sets the "create_time" field.
func (hc *HistoryCreate) SetCreateTime(t time.Time) *HistoryCreate {
hc.mutation.SetCreateTime(t)
// SetSaved sets the "saved" field.
func (hc *HistoryCreate) SetSaved(s string) *HistoryCreate {
hc.mutation.SetSaved(s)
return hc
}
// SetNillableCreateTime sets the "create_time" field if the given value is not nil.
func (hc *HistoryCreate) SetNillableCreateTime(t *time.Time) *HistoryCreate {
if t != nil {
hc.SetCreateTime(*t)
// SetNillableSaved sets the "saved" field if the given value is not nil.
func (hc *HistoryCreate) SetNillableSaved(s *string) *HistoryCreate {
if s != nil {
hc.SetSaved(*s)
}
return hc
}
@@ -193,10 +193,6 @@ func (hc *HistoryCreate) defaults() {
v := history.DefaultSize
hc.mutation.SetSize(v)
}
if _, ok := hc.mutation.CreateTime(); !ok {
v := history.DefaultCreateTime()
hc.mutation.SetCreateTime(v)
}
}
// check runs all checks and user-defined validators on the builder.
@@ -254,6 +250,10 @@ func (hc *HistoryCreate) createSpec() (*History, *sqlgraph.CreateSpec) {
_spec.SetField(history.FieldMediaID, field.TypeInt, value)
_node.MediaID = value
}
if value, ok := hc.mutation.EpisodeID(); ok {
_spec.SetField(history.FieldEpisodeID, field.TypeInt, value)
_node.EpisodeID = value
}
if value, ok := hc.mutation.EpisodeNums(); ok {
_spec.SetField(history.FieldEpisodeNums, field.TypeJSON, value)
_node.EpisodeNums = value
@@ -290,17 +290,13 @@ func (hc *HistoryCreate) createSpec() (*History, *sqlgraph.CreateSpec) {
_spec.SetField(history.FieldLink, field.TypeString, value)
_node.Link = value
}
if value, ok := hc.mutation.Hash(); ok {
_spec.SetField(history.FieldHash, field.TypeString, value)
_node.Hash = value
}
if value, ok := hc.mutation.Status(); ok {
_spec.SetField(history.FieldStatus, field.TypeEnum, value)
_node.Status = value
}
if value, ok := hc.mutation.CreateTime(); ok {
_spec.SetField(history.FieldCreateTime, field.TypeTime, value)
_node.CreateTime = value
if value, ok := hc.mutation.Saved(); ok {
_spec.SetField(history.FieldSaved, field.TypeString, value)
_node.Saved = value
}
return _node, _spec
}

View File

@@ -50,6 +50,33 @@ func (hu *HistoryUpdate) AddMediaID(i int) *HistoryUpdate {
return hu
}
// SetEpisodeID sets the "episode_id" field.
func (hu *HistoryUpdate) SetEpisodeID(i int) *HistoryUpdate {
hu.mutation.ResetEpisodeID()
hu.mutation.SetEpisodeID(i)
return hu
}
// SetNillableEpisodeID sets the "episode_id" field if the given value is not nil.
func (hu *HistoryUpdate) SetNillableEpisodeID(i *int) *HistoryUpdate {
if i != nil {
hu.SetEpisodeID(*i)
}
return hu
}
// AddEpisodeID adds i to the "episode_id" field.
func (hu *HistoryUpdate) AddEpisodeID(i int) *HistoryUpdate {
hu.mutation.AddEpisodeID(i)
return hu
}
// ClearEpisodeID clears the value of the "episode_id" field.
func (hu *HistoryUpdate) ClearEpisodeID() *HistoryUpdate {
hu.mutation.ClearEpisodeID()
return hu
}
// SetEpisodeNums sets the "episode_nums" field.
func (hu *HistoryUpdate) SetEpisodeNums(i []int) *HistoryUpdate {
hu.mutation.SetEpisodeNums(i)
@@ -232,26 +259,6 @@ func (hu *HistoryUpdate) ClearLink() *HistoryUpdate {
return hu
}
// SetHash sets the "hash" field.
func (hu *HistoryUpdate) SetHash(s string) *HistoryUpdate {
hu.mutation.SetHash(s)
return hu
}
// SetNillableHash sets the "hash" field if the given value is not nil.
func (hu *HistoryUpdate) SetNillableHash(s *string) *HistoryUpdate {
if s != nil {
hu.SetHash(*s)
}
return hu
}
// ClearHash clears the value of the "hash" field.
func (hu *HistoryUpdate) ClearHash() *HistoryUpdate {
hu.mutation.ClearHash()
return hu
}
// SetStatus sets the "status" field.
func (hu *HistoryUpdate) SetStatus(h history.Status) *HistoryUpdate {
hu.mutation.SetStatus(h)
@@ -266,6 +273,26 @@ func (hu *HistoryUpdate) SetNillableStatus(h *history.Status) *HistoryUpdate {
return hu
}
// SetSaved sets the "saved" field.
func (hu *HistoryUpdate) SetSaved(s string) *HistoryUpdate {
hu.mutation.SetSaved(s)
return hu
}
// SetNillableSaved sets the "saved" field if the given value is not nil.
func (hu *HistoryUpdate) SetNillableSaved(s *string) *HistoryUpdate {
if s != nil {
hu.SetSaved(*s)
}
return hu
}
// ClearSaved clears the value of the "saved" field.
func (hu *HistoryUpdate) ClearSaved() *HistoryUpdate {
hu.mutation.ClearSaved()
return hu
}
// Mutation returns the HistoryMutation object of the builder.
func (hu *HistoryUpdate) Mutation() *HistoryMutation {
return hu.mutation
@@ -326,6 +353,15 @@ func (hu *HistoryUpdate) sqlSave(ctx context.Context) (n int, err error) {
if value, ok := hu.mutation.AddedMediaID(); ok {
_spec.AddField(history.FieldMediaID, field.TypeInt, value)
}
if value, ok := hu.mutation.EpisodeID(); ok {
_spec.SetField(history.FieldEpisodeID, field.TypeInt, value)
}
if value, ok := hu.mutation.AddedEpisodeID(); ok {
_spec.AddField(history.FieldEpisodeID, field.TypeInt, value)
}
if hu.mutation.EpisodeIDCleared() {
_spec.ClearField(history.FieldEpisodeID, field.TypeInt)
}
if value, ok := hu.mutation.EpisodeNums(); ok {
_spec.SetField(history.FieldEpisodeNums, field.TypeJSON, value)
}
@@ -385,17 +421,14 @@ func (hu *HistoryUpdate) sqlSave(ctx context.Context) (n int, err error) {
if hu.mutation.LinkCleared() {
_spec.ClearField(history.FieldLink, field.TypeString)
}
if value, ok := hu.mutation.Hash(); ok {
_spec.SetField(history.FieldHash, field.TypeString, value)
}
if hu.mutation.HashCleared() {
_spec.ClearField(history.FieldHash, field.TypeString)
}
if value, ok := hu.mutation.Status(); ok {
_spec.SetField(history.FieldStatus, field.TypeEnum, value)
}
if hu.mutation.CreateTimeCleared() {
_spec.ClearField(history.FieldCreateTime, field.TypeTime)
if value, ok := hu.mutation.Saved(); ok {
_spec.SetField(history.FieldSaved, field.TypeString, value)
}
if hu.mutation.SavedCleared() {
_spec.ClearField(history.FieldSaved, field.TypeString)
}
if n, err = sqlgraph.UpdateNodes(ctx, hu.driver, _spec); err != nil {
if _, ok := err.(*sqlgraph.NotFoundError); ok {
@@ -438,6 +471,33 @@ func (huo *HistoryUpdateOne) AddMediaID(i int) *HistoryUpdateOne {
return huo
}
// SetEpisodeID sets the "episode_id" field.
func (huo *HistoryUpdateOne) SetEpisodeID(i int) *HistoryUpdateOne {
huo.mutation.ResetEpisodeID()
huo.mutation.SetEpisodeID(i)
return huo
}
// SetNillableEpisodeID sets the "episode_id" field if the given value is not nil.
func (huo *HistoryUpdateOne) SetNillableEpisodeID(i *int) *HistoryUpdateOne {
if i != nil {
huo.SetEpisodeID(*i)
}
return huo
}
// AddEpisodeID adds i to the "episode_id" field.
func (huo *HistoryUpdateOne) AddEpisodeID(i int) *HistoryUpdateOne {
huo.mutation.AddEpisodeID(i)
return huo
}
// ClearEpisodeID clears the value of the "episode_id" field.
func (huo *HistoryUpdateOne) ClearEpisodeID() *HistoryUpdateOne {
huo.mutation.ClearEpisodeID()
return huo
}
// SetEpisodeNums sets the "episode_nums" field.
func (huo *HistoryUpdateOne) SetEpisodeNums(i []int) *HistoryUpdateOne {
huo.mutation.SetEpisodeNums(i)
@@ -620,26 +680,6 @@ func (huo *HistoryUpdateOne) ClearLink() *HistoryUpdateOne {
return huo
}
// SetHash sets the "hash" field.
func (huo *HistoryUpdateOne) SetHash(s string) *HistoryUpdateOne {
huo.mutation.SetHash(s)
return huo
}
// SetNillableHash sets the "hash" field if the given value is not nil.
func (huo *HistoryUpdateOne) SetNillableHash(s *string) *HistoryUpdateOne {
if s != nil {
huo.SetHash(*s)
}
return huo
}
// ClearHash clears the value of the "hash" field.
func (huo *HistoryUpdateOne) ClearHash() *HistoryUpdateOne {
huo.mutation.ClearHash()
return huo
}
// SetStatus sets the "status" field.
func (huo *HistoryUpdateOne) SetStatus(h history.Status) *HistoryUpdateOne {
huo.mutation.SetStatus(h)
@@ -654,6 +694,26 @@ func (huo *HistoryUpdateOne) SetNillableStatus(h *history.Status) *HistoryUpdate
return huo
}
// SetSaved sets the "saved" field.
func (huo *HistoryUpdateOne) SetSaved(s string) *HistoryUpdateOne {
huo.mutation.SetSaved(s)
return huo
}
// SetNillableSaved sets the "saved" field if the given value is not nil.
func (huo *HistoryUpdateOne) SetNillableSaved(s *string) *HistoryUpdateOne {
if s != nil {
huo.SetSaved(*s)
}
return huo
}
// ClearSaved clears the value of the "saved" field.
func (huo *HistoryUpdateOne) ClearSaved() *HistoryUpdateOne {
huo.mutation.ClearSaved()
return huo
}
// Mutation returns the HistoryMutation object of the builder.
func (huo *HistoryUpdateOne) Mutation() *HistoryMutation {
return huo.mutation
@@ -744,6 +804,15 @@ func (huo *HistoryUpdateOne) sqlSave(ctx context.Context) (_node *History, err e
if value, ok := huo.mutation.AddedMediaID(); ok {
_spec.AddField(history.FieldMediaID, field.TypeInt, value)
}
if value, ok := huo.mutation.EpisodeID(); ok {
_spec.SetField(history.FieldEpisodeID, field.TypeInt, value)
}
if value, ok := huo.mutation.AddedEpisodeID(); ok {
_spec.AddField(history.FieldEpisodeID, field.TypeInt, value)
}
if huo.mutation.EpisodeIDCleared() {
_spec.ClearField(history.FieldEpisodeID, field.TypeInt)
}
if value, ok := huo.mutation.EpisodeNums(); ok {
_spec.SetField(history.FieldEpisodeNums, field.TypeJSON, value)
}
@@ -803,17 +872,14 @@ func (huo *HistoryUpdateOne) sqlSave(ctx context.Context) (_node *History, err e
if huo.mutation.LinkCleared() {
_spec.ClearField(history.FieldLink, field.TypeString)
}
if value, ok := huo.mutation.Hash(); ok {
_spec.SetField(history.FieldHash, field.TypeString, value)
}
if huo.mutation.HashCleared() {
_spec.ClearField(history.FieldHash, field.TypeString)
}
if value, ok := huo.mutation.Status(); ok {
_spec.SetField(history.FieldStatus, field.TypeEnum, value)
}
if huo.mutation.CreateTimeCleared() {
_spec.ClearField(history.FieldCreateTime, field.TypeTime)
if value, ok := huo.mutation.Saved(); ok {
_spec.SetField(history.FieldSaved, field.TypeString, value)
}
if huo.mutation.SavedCleared() {
_spec.ClearField(history.FieldSaved, field.TypeString)
}
_node = &History{config: huo.config}
_spec.Assign = _node.assignValues

View File

@@ -6,7 +6,6 @@ import (
"fmt"
"polaris/ent/indexers"
"strings"
"time"
"entgo.io/ent"
"entgo.io/ent/dialect/sql"
@@ -21,7 +20,7 @@ type Indexers struct {
Name string `json:"name,omitempty"`
// Implementation holds the value of the "implementation" field.
Implementation string `json:"implementation,omitempty"`
// deprecated, use api_key and url
// Settings holds the value of the "settings" field.
Settings string `json:"settings,omitempty"`
// EnableRss holds the value of the "enable_rss" field.
EnableRss bool `json:"enable_rss,omitempty"`
@@ -30,19 +29,7 @@ type Indexers struct {
// minimal seed ratio requied, before removing torrent
SeedRatio float32 `json:"seed_ratio,omitempty"`
// Disabled holds the value of the "disabled" field.
Disabled bool `json:"disabled,omitempty"`
// TvSearch holds the value of the "tv_search" field.
TvSearch bool `json:"tv_search,omitempty"`
// MovieSearch holds the value of the "movie_search" field.
MovieSearch bool `json:"movie_search,omitempty"`
// APIKey holds the value of the "api_key" field.
APIKey string `json:"api_key,omitempty"`
// URL holds the value of the "url" field.
URL string `json:"url,omitempty"`
// synced from prowlarr
Synced bool `json:"synced,omitempty"`
// CreateTime holds the value of the "create_time" field.
CreateTime time.Time `json:"create_time,omitempty"`
Disabled bool `json:"disabled,omitempty"`
selectValues sql.SelectValues
}
@@ -51,16 +38,14 @@ func (*Indexers) scanValues(columns []string) ([]any, error) {
values := make([]any, len(columns))
for i := range columns {
switch columns[i] {
case indexers.FieldEnableRss, indexers.FieldDisabled, indexers.FieldTvSearch, indexers.FieldMovieSearch, indexers.FieldSynced:
case indexers.FieldEnableRss, indexers.FieldDisabled:
values[i] = new(sql.NullBool)
case indexers.FieldSeedRatio:
values[i] = new(sql.NullFloat64)
case indexers.FieldID, indexers.FieldPriority:
values[i] = new(sql.NullInt64)
case indexers.FieldName, indexers.FieldImplementation, indexers.FieldSettings, indexers.FieldAPIKey, indexers.FieldURL:
case indexers.FieldName, indexers.FieldImplementation, indexers.FieldSettings:
values[i] = new(sql.NullString)
case indexers.FieldCreateTime:
values[i] = new(sql.NullTime)
default:
values[i] = new(sql.UnknownType)
}
@@ -124,42 +109,6 @@ func (i *Indexers) assignValues(columns []string, values []any) error {
} else if value.Valid {
i.Disabled = value.Bool
}
case indexers.FieldTvSearch:
if value, ok := values[j].(*sql.NullBool); !ok {
return fmt.Errorf("unexpected type %T for field tv_search", values[j])
} else if value.Valid {
i.TvSearch = value.Bool
}
case indexers.FieldMovieSearch:
if value, ok := values[j].(*sql.NullBool); !ok {
return fmt.Errorf("unexpected type %T for field movie_search", values[j])
} else if value.Valid {
i.MovieSearch = value.Bool
}
case indexers.FieldAPIKey:
if value, ok := values[j].(*sql.NullString); !ok {
return fmt.Errorf("unexpected type %T for field api_key", values[j])
} else if value.Valid {
i.APIKey = value.String
}
case indexers.FieldURL:
if value, ok := values[j].(*sql.NullString); !ok {
return fmt.Errorf("unexpected type %T for field url", values[j])
} else if value.Valid {
i.URL = value.String
}
case indexers.FieldSynced:
if value, ok := values[j].(*sql.NullBool); !ok {
return fmt.Errorf("unexpected type %T for field synced", values[j])
} else if value.Valid {
i.Synced = value.Bool
}
case indexers.FieldCreateTime:
if value, ok := values[j].(*sql.NullTime); !ok {
return fmt.Errorf("unexpected type %T for field create_time", values[j])
} else if value.Valid {
i.CreateTime = value.Time
}
default:
i.selectValues.Set(columns[j], values[j])
}
@@ -216,24 +165,6 @@ func (i *Indexers) String() string {
builder.WriteString(", ")
builder.WriteString("disabled=")
builder.WriteString(fmt.Sprintf("%v", i.Disabled))
builder.WriteString(", ")
builder.WriteString("tv_search=")
builder.WriteString(fmt.Sprintf("%v", i.TvSearch))
builder.WriteString(", ")
builder.WriteString("movie_search=")
builder.WriteString(fmt.Sprintf("%v", i.MovieSearch))
builder.WriteString(", ")
builder.WriteString("api_key=")
builder.WriteString(i.APIKey)
builder.WriteString(", ")
builder.WriteString("url=")
builder.WriteString(i.URL)
builder.WriteString(", ")
builder.WriteString("synced=")
builder.WriteString(fmt.Sprintf("%v", i.Synced))
builder.WriteString(", ")
builder.WriteString("create_time=")
builder.WriteString(i.CreateTime.Format(time.ANSIC))
builder.WriteByte(')')
return builder.String()
}

View File

@@ -3,8 +3,6 @@
package indexers
import (
"time"
"entgo.io/ent/dialect/sql"
)
@@ -27,18 +25,6 @@ const (
FieldSeedRatio = "seed_ratio"
// FieldDisabled holds the string denoting the disabled field in the database.
FieldDisabled = "disabled"
// FieldTvSearch holds the string denoting the tv_search field in the database.
FieldTvSearch = "tv_search"
// FieldMovieSearch holds the string denoting the movie_search field in the database.
FieldMovieSearch = "movie_search"
// FieldAPIKey holds the string denoting the api_key field in the database.
FieldAPIKey = "api_key"
// FieldURL holds the string denoting the url field in the database.
FieldURL = "url"
// FieldSynced holds the string denoting the synced field in the database.
FieldSynced = "synced"
// FieldCreateTime holds the string denoting the create_time field in the database.
FieldCreateTime = "create_time"
// Table holds the table name of the indexers in the database.
Table = "indexers"
)
@@ -53,12 +39,6 @@ var Columns = []string{
FieldPriority,
FieldSeedRatio,
FieldDisabled,
FieldTvSearch,
FieldMovieSearch,
FieldAPIKey,
FieldURL,
FieldSynced,
FieldCreateTime,
}
// ValidColumn reports if the column name is valid (part of the table columns).
@@ -72,26 +52,14 @@ func ValidColumn(column string) bool {
}
var (
// DefaultSettings holds the default value on creation for the "settings" field.
DefaultSettings string
// DefaultEnableRss holds the default value on creation for the "enable_rss" field.
DefaultEnableRss bool
// DefaultPriority holds the default value on creation for the "priority" field.
DefaultPriority int
// PriorityValidator is a validator for the "priority" field. It is called by the builders before save.
PriorityValidator func(int) error
// DefaultSeedRatio holds the default value on creation for the "seed_ratio" field.
DefaultSeedRatio float32
// DefaultDisabled holds the default value on creation for the "disabled" field.
DefaultDisabled bool
// DefaultTvSearch holds the default value on creation for the "tv_search" field.
DefaultTvSearch bool
// DefaultMovieSearch holds the default value on creation for the "movie_search" field.
DefaultMovieSearch bool
// DefaultSynced holds the default value on creation for the "synced" field.
DefaultSynced bool
// DefaultCreateTime holds the default value on creation for the "create_time" field.
DefaultCreateTime func() time.Time
)
// OrderOption defines the ordering options for the Indexers queries.
@@ -136,33 +104,3 @@ func BySeedRatio(opts ...sql.OrderTermOption) OrderOption {
func ByDisabled(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldDisabled, opts...).ToFunc()
}
// ByTvSearch orders the results by the tv_search field.
func ByTvSearch(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldTvSearch, opts...).ToFunc()
}
// ByMovieSearch orders the results by the movie_search field.
func ByMovieSearch(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldMovieSearch, opts...).ToFunc()
}
// ByAPIKey orders the results by the api_key field.
func ByAPIKey(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldAPIKey, opts...).ToFunc()
}
// ByURL orders the results by the url field.
func ByURL(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldURL, opts...).ToFunc()
}
// BySynced orders the results by the synced field.
func BySynced(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldSynced, opts...).ToFunc()
}
// ByCreateTime orders the results by the create_time field.
func ByCreateTime(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldCreateTime, opts...).ToFunc()
}

View File

@@ -4,7 +4,6 @@ package indexers
import (
"polaris/ent/predicate"
"time"
"entgo.io/ent/dialect/sql"
)
@@ -89,36 +88,6 @@ func Disabled(v bool) predicate.Indexers {
return predicate.Indexers(sql.FieldEQ(FieldDisabled, v))
}
// TvSearch applies equality check predicate on the "tv_search" field. It's identical to TvSearchEQ.
func TvSearch(v bool) predicate.Indexers {
return predicate.Indexers(sql.FieldEQ(FieldTvSearch, v))
}
// MovieSearch applies equality check predicate on the "movie_search" field. It's identical to MovieSearchEQ.
func MovieSearch(v bool) predicate.Indexers {
return predicate.Indexers(sql.FieldEQ(FieldMovieSearch, v))
}
// APIKey applies equality check predicate on the "api_key" field. It's identical to APIKeyEQ.
func APIKey(v string) predicate.Indexers {
return predicate.Indexers(sql.FieldEQ(FieldAPIKey, v))
}
// URL applies equality check predicate on the "url" field. It's identical to URLEQ.
func URL(v string) predicate.Indexers {
return predicate.Indexers(sql.FieldEQ(FieldURL, v))
}
// Synced applies equality check predicate on the "synced" field. It's identical to SyncedEQ.
func Synced(v bool) predicate.Indexers {
return predicate.Indexers(sql.FieldEQ(FieldSynced, v))
}
// CreateTime applies equality check predicate on the "create_time" field. It's identical to CreateTimeEQ.
func CreateTime(v time.Time) predicate.Indexers {
return predicate.Indexers(sql.FieldEQ(FieldCreateTime, v))
}
// NameEQ applies the EQ predicate on the "name" field.
func NameEQ(v string) predicate.Indexers {
return predicate.Indexers(sql.FieldEQ(FieldName, v))
@@ -304,16 +273,6 @@ func SettingsHasSuffix(v string) predicate.Indexers {
return predicate.Indexers(sql.FieldHasSuffix(FieldSettings, v))
}
// SettingsIsNil applies the IsNil predicate on the "settings" field.
func SettingsIsNil() predicate.Indexers {
return predicate.Indexers(sql.FieldIsNull(FieldSettings))
}
// SettingsNotNil applies the NotNil predicate on the "settings" field.
func SettingsNotNil() predicate.Indexers {
return predicate.Indexers(sql.FieldNotNull(FieldSettings))
}
// SettingsEqualFold applies the EqualFold predicate on the "settings" field.
func SettingsEqualFold(v string) predicate.Indexers {
return predicate.Indexers(sql.FieldEqualFold(FieldSettings, v))
@@ -444,266 +403,6 @@ func DisabledNotNil() predicate.Indexers {
return predicate.Indexers(sql.FieldNotNull(FieldDisabled))
}
// TvSearchEQ applies the EQ predicate on the "tv_search" field.
func TvSearchEQ(v bool) predicate.Indexers {
return predicate.Indexers(sql.FieldEQ(FieldTvSearch, v))
}
// TvSearchNEQ applies the NEQ predicate on the "tv_search" field.
func TvSearchNEQ(v bool) predicate.Indexers {
return predicate.Indexers(sql.FieldNEQ(FieldTvSearch, v))
}
// TvSearchIsNil applies the IsNil predicate on the "tv_search" field.
func TvSearchIsNil() predicate.Indexers {
return predicate.Indexers(sql.FieldIsNull(FieldTvSearch))
}
// TvSearchNotNil applies the NotNil predicate on the "tv_search" field.
func TvSearchNotNil() predicate.Indexers {
return predicate.Indexers(sql.FieldNotNull(FieldTvSearch))
}
// MovieSearchEQ applies the EQ predicate on the "movie_search" field.
func MovieSearchEQ(v bool) predicate.Indexers {
return predicate.Indexers(sql.FieldEQ(FieldMovieSearch, v))
}
// MovieSearchNEQ applies the NEQ predicate on the "movie_search" field.
func MovieSearchNEQ(v bool) predicate.Indexers {
return predicate.Indexers(sql.FieldNEQ(FieldMovieSearch, v))
}
// MovieSearchIsNil applies the IsNil predicate on the "movie_search" field.
func MovieSearchIsNil() predicate.Indexers {
return predicate.Indexers(sql.FieldIsNull(FieldMovieSearch))
}
// MovieSearchNotNil applies the NotNil predicate on the "movie_search" field.
func MovieSearchNotNil() predicate.Indexers {
return predicate.Indexers(sql.FieldNotNull(FieldMovieSearch))
}
// APIKeyEQ applies the EQ predicate on the "api_key" field.
func APIKeyEQ(v string) predicate.Indexers {
return predicate.Indexers(sql.FieldEQ(FieldAPIKey, v))
}
// APIKeyNEQ applies the NEQ predicate on the "api_key" field.
func APIKeyNEQ(v string) predicate.Indexers {
return predicate.Indexers(sql.FieldNEQ(FieldAPIKey, v))
}
// APIKeyIn applies the In predicate on the "api_key" field.
func APIKeyIn(vs ...string) predicate.Indexers {
return predicate.Indexers(sql.FieldIn(FieldAPIKey, vs...))
}
// APIKeyNotIn applies the NotIn predicate on the "api_key" field.
func APIKeyNotIn(vs ...string) predicate.Indexers {
return predicate.Indexers(sql.FieldNotIn(FieldAPIKey, vs...))
}
// APIKeyGT applies the GT predicate on the "api_key" field.
func APIKeyGT(v string) predicate.Indexers {
return predicate.Indexers(sql.FieldGT(FieldAPIKey, v))
}
// APIKeyGTE applies the GTE predicate on the "api_key" field.
func APIKeyGTE(v string) predicate.Indexers {
return predicate.Indexers(sql.FieldGTE(FieldAPIKey, v))
}
// APIKeyLT applies the LT predicate on the "api_key" field.
func APIKeyLT(v string) predicate.Indexers {
return predicate.Indexers(sql.FieldLT(FieldAPIKey, v))
}
// APIKeyLTE applies the LTE predicate on the "api_key" field.
func APIKeyLTE(v string) predicate.Indexers {
return predicate.Indexers(sql.FieldLTE(FieldAPIKey, v))
}
// APIKeyContains applies the Contains predicate on the "api_key" field.
func APIKeyContains(v string) predicate.Indexers {
return predicate.Indexers(sql.FieldContains(FieldAPIKey, v))
}
// APIKeyHasPrefix applies the HasPrefix predicate on the "api_key" field.
func APIKeyHasPrefix(v string) predicate.Indexers {
return predicate.Indexers(sql.FieldHasPrefix(FieldAPIKey, v))
}
// APIKeyHasSuffix applies the HasSuffix predicate on the "api_key" field.
func APIKeyHasSuffix(v string) predicate.Indexers {
return predicate.Indexers(sql.FieldHasSuffix(FieldAPIKey, v))
}
// APIKeyIsNil applies the IsNil predicate on the "api_key" field.
func APIKeyIsNil() predicate.Indexers {
return predicate.Indexers(sql.FieldIsNull(FieldAPIKey))
}
// APIKeyNotNil applies the NotNil predicate on the "api_key" field.
func APIKeyNotNil() predicate.Indexers {
return predicate.Indexers(sql.FieldNotNull(FieldAPIKey))
}
// APIKeyEqualFold applies the EqualFold predicate on the "api_key" field.
func APIKeyEqualFold(v string) predicate.Indexers {
return predicate.Indexers(sql.FieldEqualFold(FieldAPIKey, v))
}
// APIKeyContainsFold applies the ContainsFold predicate on the "api_key" field.
func APIKeyContainsFold(v string) predicate.Indexers {
return predicate.Indexers(sql.FieldContainsFold(FieldAPIKey, v))
}
// URLEQ applies the EQ predicate on the "url" field.
func URLEQ(v string) predicate.Indexers {
return predicate.Indexers(sql.FieldEQ(FieldURL, v))
}
// URLNEQ applies the NEQ predicate on the "url" field.
func URLNEQ(v string) predicate.Indexers {
return predicate.Indexers(sql.FieldNEQ(FieldURL, v))
}
// URLIn applies the In predicate on the "url" field.
func URLIn(vs ...string) predicate.Indexers {
return predicate.Indexers(sql.FieldIn(FieldURL, vs...))
}
// URLNotIn applies the NotIn predicate on the "url" field.
func URLNotIn(vs ...string) predicate.Indexers {
return predicate.Indexers(sql.FieldNotIn(FieldURL, vs...))
}
// URLGT applies the GT predicate on the "url" field.
func URLGT(v string) predicate.Indexers {
return predicate.Indexers(sql.FieldGT(FieldURL, v))
}
// URLGTE applies the GTE predicate on the "url" field.
func URLGTE(v string) predicate.Indexers {
return predicate.Indexers(sql.FieldGTE(FieldURL, v))
}
// URLLT applies the LT predicate on the "url" field.
func URLLT(v string) predicate.Indexers {
return predicate.Indexers(sql.FieldLT(FieldURL, v))
}
// URLLTE applies the LTE predicate on the "url" field.
func URLLTE(v string) predicate.Indexers {
return predicate.Indexers(sql.FieldLTE(FieldURL, v))
}
// URLContains applies the Contains predicate on the "url" field.
func URLContains(v string) predicate.Indexers {
return predicate.Indexers(sql.FieldContains(FieldURL, v))
}
// URLHasPrefix applies the HasPrefix predicate on the "url" field.
func URLHasPrefix(v string) predicate.Indexers {
return predicate.Indexers(sql.FieldHasPrefix(FieldURL, v))
}
// URLHasSuffix applies the HasSuffix predicate on the "url" field.
func URLHasSuffix(v string) predicate.Indexers {
return predicate.Indexers(sql.FieldHasSuffix(FieldURL, v))
}
// URLIsNil applies the IsNil predicate on the "url" field.
func URLIsNil() predicate.Indexers {
return predicate.Indexers(sql.FieldIsNull(FieldURL))
}
// URLNotNil applies the NotNil predicate on the "url" field.
func URLNotNil() predicate.Indexers {
return predicate.Indexers(sql.FieldNotNull(FieldURL))
}
// URLEqualFold applies the EqualFold predicate on the "url" field.
func URLEqualFold(v string) predicate.Indexers {
return predicate.Indexers(sql.FieldEqualFold(FieldURL, v))
}
// URLContainsFold applies the ContainsFold predicate on the "url" field.
func URLContainsFold(v string) predicate.Indexers {
return predicate.Indexers(sql.FieldContainsFold(FieldURL, v))
}
// SyncedEQ applies the EQ predicate on the "synced" field.
func SyncedEQ(v bool) predicate.Indexers {
return predicate.Indexers(sql.FieldEQ(FieldSynced, v))
}
// SyncedNEQ applies the NEQ predicate on the "synced" field.
func SyncedNEQ(v bool) predicate.Indexers {
return predicate.Indexers(sql.FieldNEQ(FieldSynced, v))
}
// SyncedIsNil applies the IsNil predicate on the "synced" field.
func SyncedIsNil() predicate.Indexers {
return predicate.Indexers(sql.FieldIsNull(FieldSynced))
}
// SyncedNotNil applies the NotNil predicate on the "synced" field.
func SyncedNotNil() predicate.Indexers {
return predicate.Indexers(sql.FieldNotNull(FieldSynced))
}
// CreateTimeEQ applies the EQ predicate on the "create_time" field.
func CreateTimeEQ(v time.Time) predicate.Indexers {
return predicate.Indexers(sql.FieldEQ(FieldCreateTime, v))
}
// CreateTimeNEQ applies the NEQ predicate on the "create_time" field.
func CreateTimeNEQ(v time.Time) predicate.Indexers {
return predicate.Indexers(sql.FieldNEQ(FieldCreateTime, v))
}
// CreateTimeIn applies the In predicate on the "create_time" field.
func CreateTimeIn(vs ...time.Time) predicate.Indexers {
return predicate.Indexers(sql.FieldIn(FieldCreateTime, vs...))
}
// CreateTimeNotIn applies the NotIn predicate on the "create_time" field.
func CreateTimeNotIn(vs ...time.Time) predicate.Indexers {
return predicate.Indexers(sql.FieldNotIn(FieldCreateTime, vs...))
}
// CreateTimeGT applies the GT predicate on the "create_time" field.
func CreateTimeGT(v time.Time) predicate.Indexers {
return predicate.Indexers(sql.FieldGT(FieldCreateTime, v))
}
// CreateTimeGTE applies the GTE predicate on the "create_time" field.
func CreateTimeGTE(v time.Time) predicate.Indexers {
return predicate.Indexers(sql.FieldGTE(FieldCreateTime, v))
}
// CreateTimeLT applies the LT predicate on the "create_time" field.
func CreateTimeLT(v time.Time) predicate.Indexers {
return predicate.Indexers(sql.FieldLT(FieldCreateTime, v))
}
// CreateTimeLTE applies the LTE predicate on the "create_time" field.
func CreateTimeLTE(v time.Time) predicate.Indexers {
return predicate.Indexers(sql.FieldLTE(FieldCreateTime, v))
}
// CreateTimeIsNil applies the IsNil predicate on the "create_time" field.
func CreateTimeIsNil() predicate.Indexers {
return predicate.Indexers(sql.FieldIsNull(FieldCreateTime))
}
// CreateTimeNotNil applies the NotNil predicate on the "create_time" field.
func CreateTimeNotNil() predicate.Indexers {
return predicate.Indexers(sql.FieldNotNull(FieldCreateTime))
}
// And groups predicates with the AND operator between them.
func And(predicates ...predicate.Indexers) predicate.Indexers {
return predicate.Indexers(sql.AndPredicates(predicates...))

View File

@@ -7,7 +7,6 @@ import (
"errors"
"fmt"
"polaris/ent/indexers"
"time"
"entgo.io/ent/dialect/sql/sqlgraph"
"entgo.io/ent/schema/field"
@@ -38,14 +37,6 @@ func (ic *IndexersCreate) SetSettings(s string) *IndexersCreate {
return ic
}
// SetNillableSettings sets the "settings" field if the given value is not nil.
func (ic *IndexersCreate) SetNillableSettings(s *string) *IndexersCreate {
if s != nil {
ic.SetSettings(*s)
}
return ic
}
// SetEnableRss sets the "enable_rss" field.
func (ic *IndexersCreate) SetEnableRss(b bool) *IndexersCreate {
ic.mutation.SetEnableRss(b)
@@ -102,90 +93,6 @@ func (ic *IndexersCreate) SetNillableDisabled(b *bool) *IndexersCreate {
return ic
}
// SetTvSearch sets the "tv_search" field.
func (ic *IndexersCreate) SetTvSearch(b bool) *IndexersCreate {
ic.mutation.SetTvSearch(b)
return ic
}
// SetNillableTvSearch sets the "tv_search" field if the given value is not nil.
func (ic *IndexersCreate) SetNillableTvSearch(b *bool) *IndexersCreate {
if b != nil {
ic.SetTvSearch(*b)
}
return ic
}
// SetMovieSearch sets the "movie_search" field.
func (ic *IndexersCreate) SetMovieSearch(b bool) *IndexersCreate {
ic.mutation.SetMovieSearch(b)
return ic
}
// SetNillableMovieSearch sets the "movie_search" field if the given value is not nil.
func (ic *IndexersCreate) SetNillableMovieSearch(b *bool) *IndexersCreate {
if b != nil {
ic.SetMovieSearch(*b)
}
return ic
}
// SetAPIKey sets the "api_key" field.
func (ic *IndexersCreate) SetAPIKey(s string) *IndexersCreate {
ic.mutation.SetAPIKey(s)
return ic
}
// SetNillableAPIKey sets the "api_key" field if the given value is not nil.
func (ic *IndexersCreate) SetNillableAPIKey(s *string) *IndexersCreate {
if s != nil {
ic.SetAPIKey(*s)
}
return ic
}
// SetURL sets the "url" field.
func (ic *IndexersCreate) SetURL(s string) *IndexersCreate {
ic.mutation.SetURL(s)
return ic
}
// SetNillableURL sets the "url" field if the given value is not nil.
func (ic *IndexersCreate) SetNillableURL(s *string) *IndexersCreate {
if s != nil {
ic.SetURL(*s)
}
return ic
}
// SetSynced sets the "synced" field.
func (ic *IndexersCreate) SetSynced(b bool) *IndexersCreate {
ic.mutation.SetSynced(b)
return ic
}
// SetNillableSynced sets the "synced" field if the given value is not nil.
func (ic *IndexersCreate) SetNillableSynced(b *bool) *IndexersCreate {
if b != nil {
ic.SetSynced(*b)
}
return ic
}
// SetCreateTime sets the "create_time" field.
func (ic *IndexersCreate) SetCreateTime(t time.Time) *IndexersCreate {
ic.mutation.SetCreateTime(t)
return ic
}
// SetNillableCreateTime sets the "create_time" field if the given value is not nil.
func (ic *IndexersCreate) SetNillableCreateTime(t *time.Time) *IndexersCreate {
if t != nil {
ic.SetCreateTime(*t)
}
return ic
}
// Mutation returns the IndexersMutation object of the builder.
func (ic *IndexersCreate) Mutation() *IndexersMutation {
return ic.mutation
@@ -221,10 +128,6 @@ func (ic *IndexersCreate) ExecX(ctx context.Context) {
// defaults sets the default values of the builder before save.
func (ic *IndexersCreate) defaults() {
if _, ok := ic.mutation.Settings(); !ok {
v := indexers.DefaultSettings
ic.mutation.SetSettings(v)
}
if _, ok := ic.mutation.EnableRss(); !ok {
v := indexers.DefaultEnableRss
ic.mutation.SetEnableRss(v)
@@ -241,22 +144,6 @@ func (ic *IndexersCreate) defaults() {
v := indexers.DefaultDisabled
ic.mutation.SetDisabled(v)
}
if _, ok := ic.mutation.TvSearch(); !ok {
v := indexers.DefaultTvSearch
ic.mutation.SetTvSearch(v)
}
if _, ok := ic.mutation.MovieSearch(); !ok {
v := indexers.DefaultMovieSearch
ic.mutation.SetMovieSearch(v)
}
if _, ok := ic.mutation.Synced(); !ok {
v := indexers.DefaultSynced
ic.mutation.SetSynced(v)
}
if _, ok := ic.mutation.CreateTime(); !ok {
v := indexers.DefaultCreateTime()
ic.mutation.SetCreateTime(v)
}
}
// check runs all checks and user-defined validators on the builder.
@@ -267,17 +154,15 @@ func (ic *IndexersCreate) check() error {
if _, ok := ic.mutation.Implementation(); !ok {
return &ValidationError{Name: "implementation", err: errors.New(`ent: missing required field "Indexers.implementation"`)}
}
if _, ok := ic.mutation.Settings(); !ok {
return &ValidationError{Name: "settings", err: errors.New(`ent: missing required field "Indexers.settings"`)}
}
if _, ok := ic.mutation.EnableRss(); !ok {
return &ValidationError{Name: "enable_rss", err: errors.New(`ent: missing required field "Indexers.enable_rss"`)}
}
if _, ok := ic.mutation.Priority(); !ok {
return &ValidationError{Name: "priority", err: errors.New(`ent: missing required field "Indexers.priority"`)}
}
if v, ok := ic.mutation.Priority(); ok {
if err := indexers.PriorityValidator(v); err != nil {
return &ValidationError{Name: "priority", err: fmt.Errorf(`ent: validator failed for field "Indexers.priority": %w`, err)}
}
}
return nil
}
@@ -332,30 +217,6 @@ func (ic *IndexersCreate) createSpec() (*Indexers, *sqlgraph.CreateSpec) {
_spec.SetField(indexers.FieldDisabled, field.TypeBool, value)
_node.Disabled = value
}
if value, ok := ic.mutation.TvSearch(); ok {
_spec.SetField(indexers.FieldTvSearch, field.TypeBool, value)
_node.TvSearch = value
}
if value, ok := ic.mutation.MovieSearch(); ok {
_spec.SetField(indexers.FieldMovieSearch, field.TypeBool, value)
_node.MovieSearch = value
}
if value, ok := ic.mutation.APIKey(); ok {
_spec.SetField(indexers.FieldAPIKey, field.TypeString, value)
_node.APIKey = value
}
if value, ok := ic.mutation.URL(); ok {
_spec.SetField(indexers.FieldURL, field.TypeString, value)
_node.URL = value
}
if value, ok := ic.mutation.Synced(); ok {
_spec.SetField(indexers.FieldSynced, field.TypeBool, value)
_node.Synced = value
}
if value, ok := ic.mutation.CreateTime(); ok {
_spec.SetField(indexers.FieldCreateTime, field.TypeTime, value)
_node.CreateTime = value
}
return _node, _spec
}

View File

@@ -69,12 +69,6 @@ func (iu *IndexersUpdate) SetNillableSettings(s *string) *IndexersUpdate {
return iu
}
// ClearSettings clears the value of the "settings" field.
func (iu *IndexersUpdate) ClearSettings() *IndexersUpdate {
iu.mutation.ClearSettings()
return iu
}
// SetEnableRss sets the "enable_rss" field.
func (iu *IndexersUpdate) SetEnableRss(b bool) *IndexersUpdate {
iu.mutation.SetEnableRss(b)
@@ -157,106 +151,6 @@ func (iu *IndexersUpdate) ClearDisabled() *IndexersUpdate {
return iu
}
// SetTvSearch sets the "tv_search" field.
func (iu *IndexersUpdate) SetTvSearch(b bool) *IndexersUpdate {
iu.mutation.SetTvSearch(b)
return iu
}
// SetNillableTvSearch sets the "tv_search" field if the given value is not nil.
func (iu *IndexersUpdate) SetNillableTvSearch(b *bool) *IndexersUpdate {
if b != nil {
iu.SetTvSearch(*b)
}
return iu
}
// ClearTvSearch clears the value of the "tv_search" field.
func (iu *IndexersUpdate) ClearTvSearch() *IndexersUpdate {
iu.mutation.ClearTvSearch()
return iu
}
// SetMovieSearch sets the "movie_search" field.
func (iu *IndexersUpdate) SetMovieSearch(b bool) *IndexersUpdate {
iu.mutation.SetMovieSearch(b)
return iu
}
// SetNillableMovieSearch sets the "movie_search" field if the given value is not nil.
func (iu *IndexersUpdate) SetNillableMovieSearch(b *bool) *IndexersUpdate {
if b != nil {
iu.SetMovieSearch(*b)
}
return iu
}
// ClearMovieSearch clears the value of the "movie_search" field.
func (iu *IndexersUpdate) ClearMovieSearch() *IndexersUpdate {
iu.mutation.ClearMovieSearch()
return iu
}
// SetAPIKey sets the "api_key" field.
func (iu *IndexersUpdate) SetAPIKey(s string) *IndexersUpdate {
iu.mutation.SetAPIKey(s)
return iu
}
// SetNillableAPIKey sets the "api_key" field if the given value is not nil.
func (iu *IndexersUpdate) SetNillableAPIKey(s *string) *IndexersUpdate {
if s != nil {
iu.SetAPIKey(*s)
}
return iu
}
// ClearAPIKey clears the value of the "api_key" field.
func (iu *IndexersUpdate) ClearAPIKey() *IndexersUpdate {
iu.mutation.ClearAPIKey()
return iu
}
// SetURL sets the "url" field.
func (iu *IndexersUpdate) SetURL(s string) *IndexersUpdate {
iu.mutation.SetURL(s)
return iu
}
// SetNillableURL sets the "url" field if the given value is not nil.
func (iu *IndexersUpdate) SetNillableURL(s *string) *IndexersUpdate {
if s != nil {
iu.SetURL(*s)
}
return iu
}
// ClearURL clears the value of the "url" field.
func (iu *IndexersUpdate) ClearURL() *IndexersUpdate {
iu.mutation.ClearURL()
return iu
}
// SetSynced sets the "synced" field.
func (iu *IndexersUpdate) SetSynced(b bool) *IndexersUpdate {
iu.mutation.SetSynced(b)
return iu
}
// SetNillableSynced sets the "synced" field if the given value is not nil.
func (iu *IndexersUpdate) SetNillableSynced(b *bool) *IndexersUpdate {
if b != nil {
iu.SetSynced(*b)
}
return iu
}
// ClearSynced clears the value of the "synced" field.
func (iu *IndexersUpdate) ClearSynced() *IndexersUpdate {
iu.mutation.ClearSynced()
return iu
}
// Mutation returns the IndexersMutation object of the builder.
func (iu *IndexersUpdate) Mutation() *IndexersMutation {
return iu.mutation
@@ -289,20 +183,7 @@ func (iu *IndexersUpdate) ExecX(ctx context.Context) {
}
}
// check runs all checks and user-defined validators on the builder.
func (iu *IndexersUpdate) check() error {
if v, ok := iu.mutation.Priority(); ok {
if err := indexers.PriorityValidator(v); err != nil {
return &ValidationError{Name: "priority", err: fmt.Errorf(`ent: validator failed for field "Indexers.priority": %w`, err)}
}
}
return nil
}
func (iu *IndexersUpdate) sqlSave(ctx context.Context) (n int, err error) {
if err := iu.check(); err != nil {
return n, err
}
_spec := sqlgraph.NewUpdateSpec(indexers.Table, indexers.Columns, sqlgraph.NewFieldSpec(indexers.FieldID, field.TypeInt))
if ps := iu.mutation.predicates; len(ps) > 0 {
_spec.Predicate = func(selector *sql.Selector) {
@@ -320,9 +201,6 @@ func (iu *IndexersUpdate) sqlSave(ctx context.Context) (n int, err error) {
if value, ok := iu.mutation.Settings(); ok {
_spec.SetField(indexers.FieldSettings, field.TypeString, value)
}
if iu.mutation.SettingsCleared() {
_spec.ClearField(indexers.FieldSettings, field.TypeString)
}
if value, ok := iu.mutation.EnableRss(); ok {
_spec.SetField(indexers.FieldEnableRss, field.TypeBool, value)
}
@@ -347,39 +225,6 @@ func (iu *IndexersUpdate) sqlSave(ctx context.Context) (n int, err error) {
if iu.mutation.DisabledCleared() {
_spec.ClearField(indexers.FieldDisabled, field.TypeBool)
}
if value, ok := iu.mutation.TvSearch(); ok {
_spec.SetField(indexers.FieldTvSearch, field.TypeBool, value)
}
if iu.mutation.TvSearchCleared() {
_spec.ClearField(indexers.FieldTvSearch, field.TypeBool)
}
if value, ok := iu.mutation.MovieSearch(); ok {
_spec.SetField(indexers.FieldMovieSearch, field.TypeBool, value)
}
if iu.mutation.MovieSearchCleared() {
_spec.ClearField(indexers.FieldMovieSearch, field.TypeBool)
}
if value, ok := iu.mutation.APIKey(); ok {
_spec.SetField(indexers.FieldAPIKey, field.TypeString, value)
}
if iu.mutation.APIKeyCleared() {
_spec.ClearField(indexers.FieldAPIKey, field.TypeString)
}
if value, ok := iu.mutation.URL(); ok {
_spec.SetField(indexers.FieldURL, field.TypeString, value)
}
if iu.mutation.URLCleared() {
_spec.ClearField(indexers.FieldURL, field.TypeString)
}
if value, ok := iu.mutation.Synced(); ok {
_spec.SetField(indexers.FieldSynced, field.TypeBool, value)
}
if iu.mutation.SyncedCleared() {
_spec.ClearField(indexers.FieldSynced, field.TypeBool)
}
if iu.mutation.CreateTimeCleared() {
_spec.ClearField(indexers.FieldCreateTime, field.TypeTime)
}
if n, err = sqlgraph.UpdateNodes(ctx, iu.driver, _spec); err != nil {
if _, ok := err.(*sqlgraph.NotFoundError); ok {
err = &NotFoundError{indexers.Label}
@@ -442,12 +287,6 @@ func (iuo *IndexersUpdateOne) SetNillableSettings(s *string) *IndexersUpdateOne
return iuo
}
// ClearSettings clears the value of the "settings" field.
func (iuo *IndexersUpdateOne) ClearSettings() *IndexersUpdateOne {
iuo.mutation.ClearSettings()
return iuo
}
// SetEnableRss sets the "enable_rss" field.
func (iuo *IndexersUpdateOne) SetEnableRss(b bool) *IndexersUpdateOne {
iuo.mutation.SetEnableRss(b)
@@ -530,106 +369,6 @@ func (iuo *IndexersUpdateOne) ClearDisabled() *IndexersUpdateOne {
return iuo
}
// SetTvSearch sets the "tv_search" field.
func (iuo *IndexersUpdateOne) SetTvSearch(b bool) *IndexersUpdateOne {
iuo.mutation.SetTvSearch(b)
return iuo
}
// SetNillableTvSearch sets the "tv_search" field if the given value is not nil.
func (iuo *IndexersUpdateOne) SetNillableTvSearch(b *bool) *IndexersUpdateOne {
if b != nil {
iuo.SetTvSearch(*b)
}
return iuo
}
// ClearTvSearch clears the value of the "tv_search" field.
func (iuo *IndexersUpdateOne) ClearTvSearch() *IndexersUpdateOne {
iuo.mutation.ClearTvSearch()
return iuo
}
// SetMovieSearch sets the "movie_search" field.
func (iuo *IndexersUpdateOne) SetMovieSearch(b bool) *IndexersUpdateOne {
iuo.mutation.SetMovieSearch(b)
return iuo
}
// SetNillableMovieSearch sets the "movie_search" field if the given value is not nil.
func (iuo *IndexersUpdateOne) SetNillableMovieSearch(b *bool) *IndexersUpdateOne {
if b != nil {
iuo.SetMovieSearch(*b)
}
return iuo
}
// ClearMovieSearch clears the value of the "movie_search" field.
func (iuo *IndexersUpdateOne) ClearMovieSearch() *IndexersUpdateOne {
iuo.mutation.ClearMovieSearch()
return iuo
}
// SetAPIKey sets the "api_key" field.
func (iuo *IndexersUpdateOne) SetAPIKey(s string) *IndexersUpdateOne {
iuo.mutation.SetAPIKey(s)
return iuo
}
// SetNillableAPIKey sets the "api_key" field if the given value is not nil.
func (iuo *IndexersUpdateOne) SetNillableAPIKey(s *string) *IndexersUpdateOne {
if s != nil {
iuo.SetAPIKey(*s)
}
return iuo
}
// ClearAPIKey clears the value of the "api_key" field.
func (iuo *IndexersUpdateOne) ClearAPIKey() *IndexersUpdateOne {
iuo.mutation.ClearAPIKey()
return iuo
}
// SetURL sets the "url" field.
func (iuo *IndexersUpdateOne) SetURL(s string) *IndexersUpdateOne {
iuo.mutation.SetURL(s)
return iuo
}
// SetNillableURL sets the "url" field if the given value is not nil.
func (iuo *IndexersUpdateOne) SetNillableURL(s *string) *IndexersUpdateOne {
if s != nil {
iuo.SetURL(*s)
}
return iuo
}
// ClearURL clears the value of the "url" field.
func (iuo *IndexersUpdateOne) ClearURL() *IndexersUpdateOne {
iuo.mutation.ClearURL()
return iuo
}
// SetSynced sets the "synced" field.
func (iuo *IndexersUpdateOne) SetSynced(b bool) *IndexersUpdateOne {
iuo.mutation.SetSynced(b)
return iuo
}
// SetNillableSynced sets the "synced" field if the given value is not nil.
func (iuo *IndexersUpdateOne) SetNillableSynced(b *bool) *IndexersUpdateOne {
if b != nil {
iuo.SetSynced(*b)
}
return iuo
}
// ClearSynced clears the value of the "synced" field.
func (iuo *IndexersUpdateOne) ClearSynced() *IndexersUpdateOne {
iuo.mutation.ClearSynced()
return iuo
}
// Mutation returns the IndexersMutation object of the builder.
func (iuo *IndexersUpdateOne) Mutation() *IndexersMutation {
return iuo.mutation
@@ -675,20 +414,7 @@ func (iuo *IndexersUpdateOne) ExecX(ctx context.Context) {
}
}
// check runs all checks and user-defined validators on the builder.
func (iuo *IndexersUpdateOne) check() error {
if v, ok := iuo.mutation.Priority(); ok {
if err := indexers.PriorityValidator(v); err != nil {
return &ValidationError{Name: "priority", err: fmt.Errorf(`ent: validator failed for field "Indexers.priority": %w`, err)}
}
}
return nil
}
func (iuo *IndexersUpdateOne) sqlSave(ctx context.Context) (_node *Indexers, err error) {
if err := iuo.check(); err != nil {
return _node, err
}
_spec := sqlgraph.NewUpdateSpec(indexers.Table, indexers.Columns, sqlgraph.NewFieldSpec(indexers.FieldID, field.TypeInt))
id, ok := iuo.mutation.ID()
if !ok {
@@ -723,9 +449,6 @@ func (iuo *IndexersUpdateOne) sqlSave(ctx context.Context) (_node *Indexers, err
if value, ok := iuo.mutation.Settings(); ok {
_spec.SetField(indexers.FieldSettings, field.TypeString, value)
}
if iuo.mutation.SettingsCleared() {
_spec.ClearField(indexers.FieldSettings, field.TypeString)
}
if value, ok := iuo.mutation.EnableRss(); ok {
_spec.SetField(indexers.FieldEnableRss, field.TypeBool, value)
}
@@ -750,39 +473,6 @@ func (iuo *IndexersUpdateOne) sqlSave(ctx context.Context) (_node *Indexers, err
if iuo.mutation.DisabledCleared() {
_spec.ClearField(indexers.FieldDisabled, field.TypeBool)
}
if value, ok := iuo.mutation.TvSearch(); ok {
_spec.SetField(indexers.FieldTvSearch, field.TypeBool, value)
}
if iuo.mutation.TvSearchCleared() {
_spec.ClearField(indexers.FieldTvSearch, field.TypeBool)
}
if value, ok := iuo.mutation.MovieSearch(); ok {
_spec.SetField(indexers.FieldMovieSearch, field.TypeBool, value)
}
if iuo.mutation.MovieSearchCleared() {
_spec.ClearField(indexers.FieldMovieSearch, field.TypeBool)
}
if value, ok := iuo.mutation.APIKey(); ok {
_spec.SetField(indexers.FieldAPIKey, field.TypeString, value)
}
if iuo.mutation.APIKeyCleared() {
_spec.ClearField(indexers.FieldAPIKey, field.TypeString)
}
if value, ok := iuo.mutation.URL(); ok {
_spec.SetField(indexers.FieldURL, field.TypeString, value)
}
if iuo.mutation.URLCleared() {
_spec.ClearField(indexers.FieldURL, field.TypeString)
}
if value, ok := iuo.mutation.Synced(); ok {
_spec.SetField(indexers.FieldSynced, field.TypeBool, value)
}
if iuo.mutation.SyncedCleared() {
_spec.ClearField(indexers.FieldSynced, field.TypeBool)
}
if iuo.mutation.CreateTimeCleared() {
_spec.ClearField(indexers.FieldCreateTime, field.TypeTime)
}
_node = &Indexers{config: iuo.config}
_spec.Assign = _node.assignValues
_spec.ScanValues = _node.scanValues

View File

@@ -51,8 +51,6 @@ type Media struct {
Extras schema.MediaExtras `json:"extras,omitempty"`
// AlternativeTitles holds the value of the "alternative_titles" field.
AlternativeTitles []schema.AlternativeTilte `json:"alternative_titles,omitempty"`
// CreateTime holds the value of the "create_time" field.
CreateTime time.Time `json:"create_time,omitempty"`
// Edges holds the relations/edges for other nodes in the graph.
// The values are being populated by the MediaQuery when eager-loading is set.
Edges MediaEdges `json:"edges"`
@@ -90,7 +88,7 @@ func (*Media) scanValues(columns []string) ([]any, error) {
values[i] = new(sql.NullInt64)
case media.FieldImdbID, media.FieldMediaType, media.FieldNameCn, media.FieldNameEn, media.FieldOriginalName, media.FieldOverview, media.FieldAirDate, media.FieldResolution, media.FieldTargetDir:
values[i] = new(sql.NullString)
case media.FieldCreatedAt, media.FieldCreateTime:
case media.FieldCreatedAt:
values[i] = new(sql.NullTime)
default:
values[i] = new(sql.UnknownType)
@@ -215,12 +213,6 @@ func (m *Media) assignValues(columns []string, values []any) error {
return fmt.Errorf("unmarshal field alternative_titles: %w", err)
}
}
case media.FieldCreateTime:
if value, ok := values[i].(*sql.NullTime); !ok {
return fmt.Errorf("unexpected type %T for field create_time", values[i])
} else if value.Valid {
m.CreateTime = value.Time
}
default:
m.selectValues.Set(columns[i], values[i])
}
@@ -309,9 +301,6 @@ func (m *Media) String() string {
builder.WriteString(", ")
builder.WriteString("alternative_titles=")
builder.WriteString(fmt.Sprintf("%v", m.AlternativeTitles))
builder.WriteString(", ")
builder.WriteString("create_time=")
builder.WriteString(m.CreateTime.Format(time.ANSIC))
builder.WriteByte(')')
return builder.String()
}

View File

@@ -47,8 +47,6 @@ const (
FieldExtras = "extras"
// FieldAlternativeTitles holds the string denoting the alternative_titles field in the database.
FieldAlternativeTitles = "alternative_titles"
// FieldCreateTime holds the string denoting the create_time field in the database.
FieldCreateTime = "create_time"
// EdgeEpisodes holds the string denoting the episodes edge name in mutations.
EdgeEpisodes = "episodes"
// Table holds the table name of the media in the database.
@@ -81,7 +79,6 @@ var Columns = []string{
FieldLimiter,
FieldExtras,
FieldAlternativeTitles,
FieldCreateTime,
}
// ValidColumn reports if the column name is valid (part of the table columns).
@@ -101,8 +98,6 @@ var (
DefaultAirDate string
// DefaultDownloadHistoryEpisodes holds the default value on creation for the "download_history_episodes" field.
DefaultDownloadHistoryEpisodes bool
// DefaultCreateTime holds the default value on creation for the "create_time" field.
DefaultCreateTime func() time.Time
)
// MediaType defines the type for the "media_type" enum field.
@@ -229,11 +224,6 @@ func ByDownloadHistoryEpisodes(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldDownloadHistoryEpisodes, opts...).ToFunc()
}
// ByCreateTime orders the results by the create_time field.
func ByCreateTime(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldCreateTime, opts...).ToFunc()
}
// ByEpisodesCount orders the results by episodes count.
func ByEpisodesCount(opts ...sql.OrderTermOption) OrderOption {
return func(s *sql.Selector) {

View File

@@ -110,11 +110,6 @@ func DownloadHistoryEpisodes(v bool) predicate.Media {
return predicate.Media(sql.FieldEQ(FieldDownloadHistoryEpisodes, v))
}
// CreateTime applies equality check predicate on the "create_time" field. It's identical to CreateTimeEQ.
func CreateTime(v time.Time) predicate.Media {
return predicate.Media(sql.FieldEQ(FieldCreateTime, v))
}
// TmdbIDEQ applies the EQ predicate on the "tmdb_id" field.
func TmdbIDEQ(v int) predicate.Media {
return predicate.Media(sql.FieldEQ(FieldTmdbID, v))
@@ -810,56 +805,6 @@ func AlternativeTitlesNotNil() predicate.Media {
return predicate.Media(sql.FieldNotNull(FieldAlternativeTitles))
}
// CreateTimeEQ applies the EQ predicate on the "create_time" field.
func CreateTimeEQ(v time.Time) predicate.Media {
return predicate.Media(sql.FieldEQ(FieldCreateTime, v))
}
// CreateTimeNEQ applies the NEQ predicate on the "create_time" field.
func CreateTimeNEQ(v time.Time) predicate.Media {
return predicate.Media(sql.FieldNEQ(FieldCreateTime, v))
}
// CreateTimeIn applies the In predicate on the "create_time" field.
func CreateTimeIn(vs ...time.Time) predicate.Media {
return predicate.Media(sql.FieldIn(FieldCreateTime, vs...))
}
// CreateTimeNotIn applies the NotIn predicate on the "create_time" field.
func CreateTimeNotIn(vs ...time.Time) predicate.Media {
return predicate.Media(sql.FieldNotIn(FieldCreateTime, vs...))
}
// CreateTimeGT applies the GT predicate on the "create_time" field.
func CreateTimeGT(v time.Time) predicate.Media {
return predicate.Media(sql.FieldGT(FieldCreateTime, v))
}
// CreateTimeGTE applies the GTE predicate on the "create_time" field.
func CreateTimeGTE(v time.Time) predicate.Media {
return predicate.Media(sql.FieldGTE(FieldCreateTime, v))
}
// CreateTimeLT applies the LT predicate on the "create_time" field.
func CreateTimeLT(v time.Time) predicate.Media {
return predicate.Media(sql.FieldLT(FieldCreateTime, v))
}
// CreateTimeLTE applies the LTE predicate on the "create_time" field.
func CreateTimeLTE(v time.Time) predicate.Media {
return predicate.Media(sql.FieldLTE(FieldCreateTime, v))
}
// CreateTimeIsNil applies the IsNil predicate on the "create_time" field.
func CreateTimeIsNil() predicate.Media {
return predicate.Media(sql.FieldIsNull(FieldCreateTime))
}
// CreateTimeNotNil applies the NotNil predicate on the "create_time" field.
func CreateTimeNotNil() predicate.Media {
return predicate.Media(sql.FieldNotNull(FieldCreateTime))
}
// HasEpisodes applies the HasEdge predicate on the "episodes" edge.
func HasEpisodes() predicate.Media {
return predicate.Media(func(s *sql.Selector) {

View File

@@ -190,20 +190,6 @@ func (mc *MediaCreate) SetAlternativeTitles(st []schema.AlternativeTilte) *Media
return mc
}
// SetCreateTime sets the "create_time" field.
func (mc *MediaCreate) SetCreateTime(t time.Time) *MediaCreate {
mc.mutation.SetCreateTime(t)
return mc
}
// SetNillableCreateTime sets the "create_time" field if the given value is not nil.
func (mc *MediaCreate) SetNillableCreateTime(t *time.Time) *MediaCreate {
if t != nil {
mc.SetCreateTime(*t)
}
return mc
}
// AddEpisodeIDs adds the "episodes" edge to the Episode entity by IDs.
func (mc *MediaCreate) AddEpisodeIDs(ids ...int) *MediaCreate {
mc.mutation.AddEpisodeIDs(ids...)
@@ -270,10 +256,6 @@ func (mc *MediaCreate) defaults() {
v := media.DefaultDownloadHistoryEpisodes
mc.mutation.SetDownloadHistoryEpisodes(v)
}
if _, ok := mc.mutation.CreateTime(); !ok {
v := media.DefaultCreateTime()
mc.mutation.SetCreateTime(v)
}
}
// check runs all checks and user-defined validators on the builder.
@@ -405,10 +387,6 @@ func (mc *MediaCreate) createSpec() (*Media, *sqlgraph.CreateSpec) {
_spec.SetField(media.FieldAlternativeTitles, field.TypeJSON, value)
_node.AlternativeTitles = value
}
if value, ok := mc.mutation.CreateTime(); ok {
_spec.SetField(media.FieldCreateTime, field.TypeTime, value)
_node.CreateTime = value
}
if nodes := mc.mutation.EpisodesIDs(); len(nodes) > 0 {
edge := &sqlgraph.EdgeSpec{
Rel: sqlgraph.O2M,

View File

@@ -484,9 +484,6 @@ func (mu *MediaUpdate) sqlSave(ctx context.Context) (n int, err error) {
if mu.mutation.AlternativeTitlesCleared() {
_spec.ClearField(media.FieldAlternativeTitles, field.TypeJSON)
}
if mu.mutation.CreateTimeCleared() {
_spec.ClearField(media.FieldCreateTime, field.TypeTime)
}
if mu.mutation.EpisodesCleared() {
edge := &sqlgraph.EdgeSpec{
Rel: sqlgraph.O2M,
@@ -1035,9 +1032,6 @@ func (muo *MediaUpdateOne) sqlSave(ctx context.Context) (_node *Media, err error
if muo.mutation.AlternativeTitlesCleared() {
_spec.ClearField(media.FieldAlternativeTitles, field.TypeJSON)
}
if muo.mutation.CreateTimeCleared() {
_spec.ClearField(media.FieldCreateTime, field.TypeTime)
}
if muo.mutation.EpisodesCleared() {
edge := &sqlgraph.EdgeSpec{
Rel: sqlgraph.O2M,

View File

@@ -11,11 +11,8 @@ var (
// BlacklistsColumns holds the columns for the "blacklists" table.
BlacklistsColumns = []*schema.Column{
{Name: "id", Type: field.TypeInt, Increment: true},
{Name: "type", Type: field.TypeEnum, Enums: []string{"media", "torrent"}, Default: "torrent"},
{Name: "torrent_hash", Type: field.TypeString, Nullable: true},
{Name: "torrent_name", Type: field.TypeString, Nullable: true},
{Name: "media_id", Type: field.TypeInt, Nullable: true},
{Name: "create_time", Type: field.TypeTime, Nullable: true},
{Name: "type", Type: field.TypeEnum, Enums: []string{"media", "torrent"}},
{Name: "value", Type: field.TypeJSON},
{Name: "notes", Type: field.TypeString, Nullable: true},
}
// BlacklistsTable holds the schema information for the "blacklists" table.
@@ -29,17 +26,15 @@ var (
{Name: "id", Type: field.TypeInt, Increment: true},
{Name: "enable", Type: field.TypeBool},
{Name: "name", Type: field.TypeString},
{Name: "implementation", Type: field.TypeEnum, Enums: []string{"transmission", "qbittorrent", "buildin"}},
{Name: "implementation", Type: field.TypeEnum, Enums: []string{"transmission", "qbittorrent"}},
{Name: "url", Type: field.TypeString},
{Name: "user", Type: field.TypeString, Default: ""},
{Name: "password", Type: field.TypeString, Default: ""},
{Name: "settings", Type: field.TypeString, Default: ""},
{Name: "priority1", Type: field.TypeInt, Default: 1},
{Name: "use_nat_traversal", Type: field.TypeBool, Nullable: true, Default: false},
{Name: "remove_completed_downloads", Type: field.TypeBool, Default: true},
{Name: "remove_failed_downloads", Type: field.TypeBool, Default: true},
{Name: "tags", Type: field.TypeString, Default: ""},
{Name: "create_time", Type: field.TypeTime, Nullable: true},
}
// DownloadClientsTable holds the schema information for the "download_clients" table.
DownloadClientsTable = &schema.Table{
@@ -58,7 +53,6 @@ var (
{Name: "status", Type: field.TypeEnum, Enums: []string{"missing", "downloading", "downloaded"}, Default: "missing"},
{Name: "monitored", Type: field.TypeBool, Default: false},
{Name: "target_file", Type: field.TypeString, Nullable: true},
{Name: "create_time", Type: field.TypeTime, Nullable: true},
{Name: "media_id", Type: field.TypeInt, Nullable: true},
}
// EpisodesTable holds the schema information for the "episodes" table.
@@ -69,7 +63,7 @@ var (
ForeignKeys: []*schema.ForeignKey{
{
Symbol: "episodes_media_episodes",
Columns: []*schema.Column{EpisodesColumns[10]},
Columns: []*schema.Column{EpisodesColumns[9]},
RefColumns: []*schema.Column{MediaColumns[0]},
OnDelete: schema.SetNull,
},
@@ -79,6 +73,7 @@ var (
HistoriesColumns = []*schema.Column{
{Name: "id", Type: field.TypeInt, Increment: true},
{Name: "media_id", Type: field.TypeInt},
{Name: "episode_id", Type: field.TypeInt, Nullable: true},
{Name: "episode_nums", Type: field.TypeJSON, Nullable: true},
{Name: "season_num", Type: field.TypeInt, Nullable: true},
{Name: "source_title", Type: field.TypeString},
@@ -88,9 +83,8 @@ var (
{Name: "download_client_id", Type: field.TypeInt, Nullable: true},
{Name: "indexer_id", Type: field.TypeInt, Nullable: true},
{Name: "link", Type: field.TypeString, Nullable: true},
{Name: "hash", Type: field.TypeString, Nullable: true},
{Name: "status", Type: field.TypeEnum, Enums: []string{"running", "success", "fail", "uploading", "seeding", "removed"}},
{Name: "create_time", Type: field.TypeTime, Nullable: true},
{Name: "status", Type: field.TypeEnum, Enums: []string{"running", "success", "fail", "uploading", "seeding"}},
{Name: "saved", Type: field.TypeString, Nullable: true},
}
// HistoriesTable holds the schema information for the "histories" table.
HistoriesTable = &schema.Table{
@@ -119,17 +113,11 @@ var (
{Name: "id", Type: field.TypeInt, Increment: true},
{Name: "name", Type: field.TypeString},
{Name: "implementation", Type: field.TypeString},
{Name: "settings", Type: field.TypeString, Nullable: true, Default: ""},
{Name: "settings", Type: field.TypeString},
{Name: "enable_rss", Type: field.TypeBool, Default: true},
{Name: "priority", Type: field.TypeInt, Default: 25},
{Name: "priority", Type: field.TypeInt, Default: 50},
{Name: "seed_ratio", Type: field.TypeFloat32, Nullable: true, Default: 0},
{Name: "disabled", Type: field.TypeBool, Nullable: true, Default: false},
{Name: "tv_search", Type: field.TypeBool, Nullable: true, Default: true},
{Name: "movie_search", Type: field.TypeBool, Nullable: true, Default: true},
{Name: "api_key", Type: field.TypeString, Nullable: true},
{Name: "url", Type: field.TypeString, Nullable: true},
{Name: "synced", Type: field.TypeBool, Nullable: true, Default: false},
{Name: "create_time", Type: field.TypeTime, Nullable: true},
}
// IndexersTable holds the schema information for the "indexers" table.
IndexersTable = &schema.Table{
@@ -156,7 +144,6 @@ var (
{Name: "limiter", Type: field.TypeJSON, Nullable: true},
{Name: "extras", Type: field.TypeJSON, Nullable: true},
{Name: "alternative_titles", Type: field.TypeJSON, Nullable: true},
{Name: "create_time", Type: field.TypeTime, Nullable: true},
}
// MediaTable holds the schema information for the "media" table.
MediaTable = &schema.Table{
@@ -200,7 +187,6 @@ var (
{Name: "settings", Type: field.TypeString, Nullable: true},
{Name: "deleted", Type: field.TypeBool, Default: false},
{Name: "default", Type: field.TypeBool, Default: false},
{Name: "create_time", Type: field.TypeTime, Nullable: true},
}
// StoragesTable holds the schema information for the "storages" table.
StoragesTable = &schema.Table{

View File

File diff suppressed because it is too large Load Diff

View File

@@ -21,10 +21,10 @@ import (
func init() {
blacklistFields := schema.Blacklist{}.Fields()
_ = blacklistFields
// blacklistDescCreateTime is the schema descriptor for create_time field.
blacklistDescCreateTime := blacklistFields[4].Descriptor()
// blacklist.DefaultCreateTime holds the default value on creation for the create_time field.
blacklist.DefaultCreateTime = blacklistDescCreateTime.Default.(func() time.Time)
// blacklistDescValue is the schema descriptor for value field.
blacklistDescValue := blacklistFields[1].Descriptor()
// blacklist.DefaultValue holds the default value on creation for the value field.
blacklist.DefaultValue = blacklistDescValue.Default.(schema.BlacklistValue)
downloadclientsFields := schema.DownloadClients{}.Fields()
_ = downloadclientsFields
// downloadclientsDescUser is the schema descriptor for user field.
@@ -45,52 +45,32 @@ func init() {
downloadclients.DefaultPriority1 = downloadclientsDescPriority1.Default.(int)
// downloadclients.Priority1Validator is a validator for the "priority1" field. It is called by the builders before save.
downloadclients.Priority1Validator = downloadclientsDescPriority1.Validators[0].(func(int) error)
// downloadclientsDescUseNatTraversal is the schema descriptor for use_nat_traversal field.
downloadclientsDescUseNatTraversal := downloadclientsFields[8].Descriptor()
// downloadclients.DefaultUseNatTraversal holds the default value on creation for the use_nat_traversal field.
downloadclients.DefaultUseNatTraversal = downloadclientsDescUseNatTraversal.Default.(bool)
// downloadclientsDescRemoveCompletedDownloads is the schema descriptor for remove_completed_downloads field.
downloadclientsDescRemoveCompletedDownloads := downloadclientsFields[9].Descriptor()
downloadclientsDescRemoveCompletedDownloads := downloadclientsFields[8].Descriptor()
// downloadclients.DefaultRemoveCompletedDownloads holds the default value on creation for the remove_completed_downloads field.
downloadclients.DefaultRemoveCompletedDownloads = downloadclientsDescRemoveCompletedDownloads.Default.(bool)
// downloadclientsDescRemoveFailedDownloads is the schema descriptor for remove_failed_downloads field.
downloadclientsDescRemoveFailedDownloads := downloadclientsFields[10].Descriptor()
downloadclientsDescRemoveFailedDownloads := downloadclientsFields[9].Descriptor()
// downloadclients.DefaultRemoveFailedDownloads holds the default value on creation for the remove_failed_downloads field.
downloadclients.DefaultRemoveFailedDownloads = downloadclientsDescRemoveFailedDownloads.Default.(bool)
// downloadclientsDescTags is the schema descriptor for tags field.
downloadclientsDescTags := downloadclientsFields[11].Descriptor()
downloadclientsDescTags := downloadclientsFields[10].Descriptor()
// downloadclients.DefaultTags holds the default value on creation for the tags field.
downloadclients.DefaultTags = downloadclientsDescTags.Default.(string)
// downloadclientsDescCreateTime is the schema descriptor for create_time field.
downloadclientsDescCreateTime := downloadclientsFields[12].Descriptor()
// downloadclients.DefaultCreateTime holds the default value on creation for the create_time field.
downloadclients.DefaultCreateTime = downloadclientsDescCreateTime.Default.(func() time.Time)
episodeFields := schema.Episode{}.Fields()
_ = episodeFields
// episodeDescMonitored is the schema descriptor for monitored field.
episodeDescMonitored := episodeFields[7].Descriptor()
// episode.DefaultMonitored holds the default value on creation for the monitored field.
episode.DefaultMonitored = episodeDescMonitored.Default.(bool)
// episodeDescCreateTime is the schema descriptor for create_time field.
episodeDescCreateTime := episodeFields[9].Descriptor()
// episode.DefaultCreateTime holds the default value on creation for the create_time field.
episode.DefaultCreateTime = episodeDescCreateTime.Default.(func() time.Time)
historyFields := schema.History{}.Fields()
_ = historyFields
// historyDescSize is the schema descriptor for size field.
historyDescSize := historyFields[6].Descriptor()
historyDescSize := historyFields[7].Descriptor()
// history.DefaultSize holds the default value on creation for the size field.
history.DefaultSize = historyDescSize.Default.(int)
// historyDescCreateTime is the schema descriptor for create_time field.
historyDescCreateTime := historyFields[12].Descriptor()
// history.DefaultCreateTime holds the default value on creation for the create_time field.
history.DefaultCreateTime = historyDescCreateTime.Default.(func() time.Time)
indexersFields := schema.Indexers{}.Fields()
_ = indexersFields
// indexersDescSettings is the schema descriptor for settings field.
indexersDescSettings := indexersFields[2].Descriptor()
// indexers.DefaultSettings holds the default value on creation for the settings field.
indexers.DefaultSettings = indexersDescSettings.Default.(string)
// indexersDescEnableRss is the schema descriptor for enable_rss field.
indexersDescEnableRss := indexersFields[3].Descriptor()
// indexers.DefaultEnableRss holds the default value on creation for the enable_rss field.
@@ -99,8 +79,6 @@ func init() {
indexersDescPriority := indexersFields[4].Descriptor()
// indexers.DefaultPriority holds the default value on creation for the priority field.
indexers.DefaultPriority = indexersDescPriority.Default.(int)
// indexers.PriorityValidator is a validator for the "priority" field. It is called by the builders before save.
indexers.PriorityValidator = indexersDescPriority.Validators[0].(func(int) error)
// indexersDescSeedRatio is the schema descriptor for seed_ratio field.
indexersDescSeedRatio := indexersFields[5].Descriptor()
// indexers.DefaultSeedRatio holds the default value on creation for the seed_ratio field.
@@ -109,22 +87,6 @@ func init() {
indexersDescDisabled := indexersFields[6].Descriptor()
// indexers.DefaultDisabled holds the default value on creation for the disabled field.
indexers.DefaultDisabled = indexersDescDisabled.Default.(bool)
// indexersDescTvSearch is the schema descriptor for tv_search field.
indexersDescTvSearch := indexersFields[7].Descriptor()
// indexers.DefaultTvSearch holds the default value on creation for the tv_search field.
indexers.DefaultTvSearch = indexersDescTvSearch.Default.(bool)
// indexersDescMovieSearch is the schema descriptor for movie_search field.
indexersDescMovieSearch := indexersFields[8].Descriptor()
// indexers.DefaultMovieSearch holds the default value on creation for the movie_search field.
indexers.DefaultMovieSearch = indexersDescMovieSearch.Default.(bool)
// indexersDescSynced is the schema descriptor for synced field.
indexersDescSynced := indexersFields[11].Descriptor()
// indexers.DefaultSynced holds the default value on creation for the synced field.
indexers.DefaultSynced = indexersDescSynced.Default.(bool)
// indexersDescCreateTime is the schema descriptor for create_time field.
indexersDescCreateTime := indexersFields[12].Descriptor()
// indexers.DefaultCreateTime holds the default value on creation for the create_time field.
indexers.DefaultCreateTime = indexersDescCreateTime.Default.(func() time.Time)
mediaFields := schema.Media{}.Fields()
_ = mediaFields
// mediaDescCreatedAt is the schema descriptor for created_at field.
@@ -139,10 +101,6 @@ func init() {
mediaDescDownloadHistoryEpisodes := mediaFields[12].Descriptor()
// media.DefaultDownloadHistoryEpisodes holds the default value on creation for the download_history_episodes field.
media.DefaultDownloadHistoryEpisodes = mediaDescDownloadHistoryEpisodes.Default.(bool)
// mediaDescCreateTime is the schema descriptor for create_time field.
mediaDescCreateTime := mediaFields[16].Descriptor()
// media.DefaultCreateTime holds the default value on creation for the create_time field.
media.DefaultCreateTime = mediaDescCreateTime.Default.(func() time.Time)
notificationclientFields := schema.NotificationClient{}.Fields()
_ = notificationclientFields
// notificationclientDescEnabled is the schema descriptor for enabled field.
@@ -159,8 +117,4 @@ func init() {
storageDescDefault := storageFields[6].Descriptor()
// storage.DefaultDefault holds the default value on creation for the default field.
storage.DefaultDefault = storageDescDefault.Default.(bool)
// storageDescCreateTime is the schema descriptor for create_time field.
storageDescCreateTime := storageFields[7].Descriptor()
// storage.DefaultCreateTime holds the default value on creation for the create_time field.
storage.DefaultCreateTime = storageDescCreateTime.Default.(func() time.Time)
}

View File

@@ -1,8 +1,6 @@
package schema
import (
"time"
"entgo.io/ent"
"entgo.io/ent/schema/field"
)
@@ -15,11 +13,8 @@ type Blacklist struct {
// Fields of the Blacklist.
func (Blacklist) Fields() []ent.Field {
return []ent.Field{
field.Enum("type").Values("media", "torrent").Default("torrent"),
field.String("torrent_hash").Optional(),
field.String("torrent_name").Optional(),
field.Int("media_id").Optional(),
field.Time("create_time").Optional().Default(time.Now).Immutable(),
field.Enum("type").Values("media", "torrent"),
field.JSON("value", BlacklistValue{}).Default(BlacklistValue{}),
field.String("notes").Optional(),
}
}
@@ -28,3 +23,8 @@ func (Blacklist) Fields() []ent.Field {
func (Blacklist) Edges() []ent.Edge {
return nil
}
type BlacklistValue struct {
TmdbID int `json:"tmdb_id"`
TorrentHash string `json:"torrent_hash"`
}

View File

@@ -2,7 +2,6 @@ package schema
import (
"errors"
"time"
"entgo.io/ent"
"entgo.io/ent/schema/field"
@@ -18,7 +17,7 @@ func (DownloadClients) Fields() []ent.Field {
return []ent.Field{
field.Bool("enable"),
field.String("name"),
field.Enum("implementation").Values("transmission", "qbittorrent", "buildin"),
field.Enum("implementation").Values("transmission", "qbittorrent"),
field.String("url"),
field.String("user").Default(""),
field.String("password").Default(""),
@@ -32,11 +31,9 @@ func (DownloadClients) Fields() []ent.Field {
}
return nil
}),
field.Bool("use_nat_traversal").Optional().Default(false).Comment("use stun server to do nat traversal, enable download client to do uploading successfully"),
field.Bool("remove_completed_downloads").Default(true),
field.Bool("remove_failed_downloads").Default(true),
field.String("tags").Default(""),
field.Time("create_time").Optional().Default(time.Now).Immutable(),
}
}

View File

@@ -1,8 +1,6 @@
package schema
import (
"time"
"entgo.io/ent"
"entgo.io/ent/schema/edge"
"entgo.io/ent/schema/field"
@@ -25,7 +23,6 @@ func (Episode) Fields() []ent.Field {
field.Enum("status").Values("missing", "downloading", "downloaded").Default("missing"),
field.Bool("monitored").Default(false).StructTag("json:\"monitored\""), //whether this episode is monitored
field.String("target_file").Optional(),
field.Time("create_time").Optional().Default(time.Now).Immutable(),
}
}

View File

@@ -1,8 +1,6 @@
package schema
import (
"time"
"entgo.io/ent"
"entgo.io/ent/schema/field"
)
@@ -16,7 +14,7 @@ type History struct {
func (History) Fields() []ent.Field {
return []ent.Field{
field.Int("media_id"),
//field.Int("episode_id").Optional().Comment("deprecated"),
field.Int("episode_id").Optional().Comment("deprecated"),
field.Ints("episode_nums").Optional(),
field.Int("season_num").Optional(),
field.String("source_title"),
@@ -25,11 +23,9 @@ func (History) Fields() []ent.Field {
field.Int("size").Default(0),
field.Int("download_client_id").Optional(),
field.Int("indexer_id").Optional(),
field.String("link").Optional().Comment("torrent link"), //should be magnet link
field.String("hash").Optional().Comment("torrent hash"),
field.Enum("status").Values("running", "success", "fail", "uploading", "seeding", "removed"),
field.Time("create_time").Optional().Default(time.Now).Immutable(),
//field.String("saved").Optional().Comment("deprecated"), //deprecated
field.String("link").Optional(), //should be magnet link
field.Enum("status").Values("running", "success", "fail", "uploading", "seeding"),
field.String("saved").Optional().Comment("deprecated"), //deprecated
}
}

View File

@@ -1,9 +1,6 @@
package schema
import (
"errors"
"time"
"entgo.io/ent"
"entgo.io/ent/schema/field"
)
@@ -18,25 +15,11 @@ func (Indexers) Fields() []ent.Field {
return []ent.Field{
field.String("name"),
field.String("implementation"),
field.String("settings").Optional().Default("").Comment("deprecated, use api_key and url"),
field.String("settings"),
field.Bool("enable_rss").Default(true),
field.Int("priority").Default(25).Validate(func(i int) error {
if i > 50 {
return errors.ErrUnsupported
}
if i <= 0 {
return errors.ErrUnsupported
}
return nil
}),
field.Int("priority").Default(50),
field.Float32("seed_ratio").Optional().Default(0).Comment("minimal seed ratio requied, before removing torrent"),
field.Bool("disabled").Optional().Default(false),
field.Bool("tv_search").Optional().Default(true),
field.Bool("movie_search").Optional().Default(true),
field.String("api_key").Optional(),
field.String("url").Optional(),
field.Bool("synced").Optional().Default(false).Comment("synced from prowlarr"),
field.Time("create_time").Optional().Default(time.Now).Immutable(),
}
}

View File

@@ -32,7 +32,6 @@ func (Media) Fields() []ent.Field {
field.JSON("limiter", MediaLimiter{}).Optional(),
field.JSON("extras", MediaExtras{}).Optional(),
field.JSON("alternative_titles", []AlternativeTilte{}).Optional(),
field.Time("create_time").Optional().Default(time.Now).Immutable(),
}
}
@@ -60,12 +59,10 @@ type MediaExtras struct {
JavId string `json:"javid"`
//OriginCountry []string `json:"origin_country"`
OriginalLanguage string `json:"original_language"`
Genres []Genre `json:"genres"`
}
type Genre struct {
ID int64 `json:"id"`
Name string `json:"name"`
Genres []struct {
ID int64 `json:"id"`
Name string `json:"name"`
} `json:"genres"`
}
func (m *MediaExtras) IsJav() bool {

View File

@@ -1,8 +1,6 @@
package schema
import (
"time"
"entgo.io/ent"
"entgo.io/ent/schema/field"
)
@@ -22,7 +20,6 @@ func (Storage) Fields() []ent.Field {
field.String("settings").Optional(),
field.Bool("deleted").Default(false),
field.Bool("default").Default(false),
field.Time("create_time").Optional().Default(time.Now).Immutable(),
}
}

View File

@@ -6,7 +6,6 @@ import (
"fmt"
"polaris/ent/storage"
"strings"
"time"
"entgo.io/ent"
"entgo.io/ent/dialect/sql"
@@ -30,9 +29,7 @@ type Storage struct {
// Deleted holds the value of the "deleted" field.
Deleted bool `json:"deleted,omitempty"`
// Default holds the value of the "default" field.
Default bool `json:"default,omitempty"`
// CreateTime holds the value of the "create_time" field.
CreateTime time.Time `json:"create_time,omitempty"`
Default bool `json:"default,omitempty"`
selectValues sql.SelectValues
}
@@ -47,8 +44,6 @@ func (*Storage) scanValues(columns []string) ([]any, error) {
values[i] = new(sql.NullInt64)
case storage.FieldName, storage.FieldImplementation, storage.FieldTvPath, storage.FieldMoviePath, storage.FieldSettings:
values[i] = new(sql.NullString)
case storage.FieldCreateTime:
values[i] = new(sql.NullTime)
default:
values[i] = new(sql.UnknownType)
}
@@ -112,12 +107,6 @@ func (s *Storage) assignValues(columns []string, values []any) error {
} else if value.Valid {
s.Default = value.Bool
}
case storage.FieldCreateTime:
if value, ok := values[i].(*sql.NullTime); !ok {
return fmt.Errorf("unexpected type %T for field create_time", values[i])
} else if value.Valid {
s.CreateTime = value.Time
}
default:
s.selectValues.Set(columns[i], values[i])
}
@@ -174,9 +163,6 @@ func (s *Storage) String() string {
builder.WriteString(", ")
builder.WriteString("default=")
builder.WriteString(fmt.Sprintf("%v", s.Default))
builder.WriteString(", ")
builder.WriteString("create_time=")
builder.WriteString(s.CreateTime.Format(time.ANSIC))
builder.WriteByte(')')
return builder.String()
}

View File

@@ -4,7 +4,6 @@ package storage
import (
"fmt"
"time"
"entgo.io/ent/dialect/sql"
)
@@ -28,8 +27,6 @@ const (
FieldDeleted = "deleted"
// FieldDefault holds the string denoting the default field in the database.
FieldDefault = "default"
// FieldCreateTime holds the string denoting the create_time field in the database.
FieldCreateTime = "create_time"
// Table holds the table name of the storage in the database.
Table = "storages"
)
@@ -44,7 +41,6 @@ var Columns = []string{
FieldSettings,
FieldDeleted,
FieldDefault,
FieldCreateTime,
}
// ValidColumn reports if the column name is valid (part of the table columns).
@@ -62,8 +58,6 @@ var (
DefaultDeleted bool
// DefaultDefault holds the default value on creation for the "default" field.
DefaultDefault bool
// DefaultCreateTime holds the default value on creation for the "create_time" field.
DefaultCreateTime func() time.Time
)
// Implementation defines the type for the "implementation" enum field.
@@ -132,8 +126,3 @@ func ByDeleted(opts ...sql.OrderTermOption) OrderOption {
func ByDefault(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldDefault, opts...).ToFunc()
}
// ByCreateTime orders the results by the create_time field.
func ByCreateTime(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldCreateTime, opts...).ToFunc()
}

View File

@@ -4,7 +4,6 @@ package storage
import (
"polaris/ent/predicate"
"time"
"entgo.io/ent/dialect/sql"
)
@@ -84,11 +83,6 @@ func Default(v bool) predicate.Storage {
return predicate.Storage(sql.FieldEQ(FieldDefault, v))
}
// CreateTime applies equality check predicate on the "create_time" field. It's identical to CreateTimeEQ.
func CreateTime(v time.Time) predicate.Storage {
return predicate.Storage(sql.FieldEQ(FieldCreateTime, v))
}
// NameEQ applies the EQ predicate on the "name" field.
func NameEQ(v string) predicate.Storage {
return predicate.Storage(sql.FieldEQ(FieldName, v))
@@ -419,56 +413,6 @@ func DefaultNEQ(v bool) predicate.Storage {
return predicate.Storage(sql.FieldNEQ(FieldDefault, v))
}
// CreateTimeEQ applies the EQ predicate on the "create_time" field.
func CreateTimeEQ(v time.Time) predicate.Storage {
return predicate.Storage(sql.FieldEQ(FieldCreateTime, v))
}
// CreateTimeNEQ applies the NEQ predicate on the "create_time" field.
func CreateTimeNEQ(v time.Time) predicate.Storage {
return predicate.Storage(sql.FieldNEQ(FieldCreateTime, v))
}
// CreateTimeIn applies the In predicate on the "create_time" field.
func CreateTimeIn(vs ...time.Time) predicate.Storage {
return predicate.Storage(sql.FieldIn(FieldCreateTime, vs...))
}
// CreateTimeNotIn applies the NotIn predicate on the "create_time" field.
func CreateTimeNotIn(vs ...time.Time) predicate.Storage {
return predicate.Storage(sql.FieldNotIn(FieldCreateTime, vs...))
}
// CreateTimeGT applies the GT predicate on the "create_time" field.
func CreateTimeGT(v time.Time) predicate.Storage {
return predicate.Storage(sql.FieldGT(FieldCreateTime, v))
}
// CreateTimeGTE applies the GTE predicate on the "create_time" field.
func CreateTimeGTE(v time.Time) predicate.Storage {
return predicate.Storage(sql.FieldGTE(FieldCreateTime, v))
}
// CreateTimeLT applies the LT predicate on the "create_time" field.
func CreateTimeLT(v time.Time) predicate.Storage {
return predicate.Storage(sql.FieldLT(FieldCreateTime, v))
}
// CreateTimeLTE applies the LTE predicate on the "create_time" field.
func CreateTimeLTE(v time.Time) predicate.Storage {
return predicate.Storage(sql.FieldLTE(FieldCreateTime, v))
}
// CreateTimeIsNil applies the IsNil predicate on the "create_time" field.
func CreateTimeIsNil() predicate.Storage {
return predicate.Storage(sql.FieldIsNull(FieldCreateTime))
}
// CreateTimeNotNil applies the NotNil predicate on the "create_time" field.
func CreateTimeNotNil() predicate.Storage {
return predicate.Storage(sql.FieldNotNull(FieldCreateTime))
}
// And groups predicates with the AND operator between them.
func And(predicates ...predicate.Storage) predicate.Storage {
return predicate.Storage(sql.AndPredicates(predicates...))

View File

@@ -7,7 +7,6 @@ import (
"errors"
"fmt"
"polaris/ent/storage"
"time"
"entgo.io/ent/dialect/sql/sqlgraph"
"entgo.io/ent/schema/field"
@@ -102,20 +101,6 @@ func (sc *StorageCreate) SetNillableDefault(b *bool) *StorageCreate {
return sc
}
// SetCreateTime sets the "create_time" field.
func (sc *StorageCreate) SetCreateTime(t time.Time) *StorageCreate {
sc.mutation.SetCreateTime(t)
return sc
}
// SetNillableCreateTime sets the "create_time" field if the given value is not nil.
func (sc *StorageCreate) SetNillableCreateTime(t *time.Time) *StorageCreate {
if t != nil {
sc.SetCreateTime(*t)
}
return sc
}
// Mutation returns the StorageMutation object of the builder.
func (sc *StorageCreate) Mutation() *StorageMutation {
return sc.mutation
@@ -159,10 +144,6 @@ func (sc *StorageCreate) defaults() {
v := storage.DefaultDefault
sc.mutation.SetDefault(v)
}
if _, ok := sc.mutation.CreateTime(); !ok {
v := storage.DefaultCreateTime()
sc.mutation.SetCreateTime(v)
}
}
// check runs all checks and user-defined validators on the builder.
@@ -238,10 +219,6 @@ func (sc *StorageCreate) createSpec() (*Storage, *sqlgraph.CreateSpec) {
_spec.SetField(storage.FieldDefault, field.TypeBool, value)
_node.Default = value
}
if value, ok := sc.mutation.CreateTime(); ok {
_spec.SetField(storage.FieldCreateTime, field.TypeTime, value)
_node.CreateTime = value
}
return _node, _spec
}

View File

@@ -227,9 +227,6 @@ func (su *StorageUpdate) sqlSave(ctx context.Context) (n int, err error) {
if value, ok := su.mutation.Default(); ok {
_spec.SetField(storage.FieldDefault, field.TypeBool, value)
}
if su.mutation.CreateTimeCleared() {
_spec.ClearField(storage.FieldCreateTime, field.TypeTime)
}
if n, err = sqlgraph.UpdateNodes(ctx, su.driver, _spec); err != nil {
if _, ok := err.(*sqlgraph.NotFoundError); ok {
err = &NotFoundError{storage.Label}
@@ -480,9 +477,6 @@ func (suo *StorageUpdateOne) sqlSave(ctx context.Context) (_node *Storage, err e
if value, ok := suo.mutation.Default(); ok {
_spec.SetField(storage.FieldDefault, field.TypeBool, value)
}
if suo.mutation.CreateTimeCleared() {
_spec.ClearField(storage.FieldCreateTime, field.TypeTime)
}
_node = &Storage{config: suo.config}
_spec.Assign = _node.assignValues
_spec.ScanValues = _node.scanValues

171
go.mod
View File

@@ -1,193 +1,146 @@
module polaris
go 1.24
go 1.23
toolchain go1.24.1
toolchain go1.23.1
require (
entgo.io/ent v0.14.4
github.com/golang-jwt/jwt/v5 v5.2.2
entgo.io/ent v0.13.1
github.com/golang-jwt/jwt/v5 v5.2.1
github.com/mattn/go-sqlite3 v1.14.22 // indirect
github.com/robfig/cron v1.2.0
go.uber.org/zap v1.27.0
golang.org/x/net v0.42.0
golang.org/x/net v0.33.0
)
require (
github.com/PuerkitoBio/goquery v1.10.3
github.com/anacrolix/torrent v1.58.1
github.com/PuerkitoBio/goquery v1.9.2
github.com/anacrolix/torrent v1.57.1
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc
github.com/gin-contrib/zap v1.1.3
github.com/gocolly/colly v1.2.0
github.com/ncruces/go-sqlite3 v0.28.0
github.com/nikoksr/notify v1.3.0
github.com/openai/openai-go v1.12.0
github.com/pion/stun/v3 v3.0.0
github.com/stretchr/testify v1.10.0
golift.io/starr v1.1.0
github.com/ncruces/go-sqlite3 v0.18.4
github.com/nikoksr/notify v1.0.0
github.com/stretchr/testify v1.9.0
golift.io/starr v1.0.0
)
require (
cloud.google.com/go v0.115.0 // indirect
cloud.google.com/go/ai v0.8.0 // indirect
cloud.google.com/go/auth v0.7.1 // indirect
cloud.google.com/go/auth/oauth2adapt v0.2.3 // indirect
cloud.google.com/go/compute/metadata v0.5.0 // indirect
cloud.google.com/go/longrunning v0.5.10 // indirect
github.com/BurntSushi/toml v1.4.0 // indirect
github.com/DATA-DOG/go-sqlmock v1.5.2 // indirect
github.com/RoaringBitmap/roaring v1.2.3 // indirect
github.com/ajwerner/btree v0.0.0-20211221152037-f427b3e689c0 // indirect
github.com/alecthomas/atomic v0.1.0-alpha2 // indirect
github.com/anacrolix/chansync v0.4.1-0.20240627045151-1aa1ac392fe8 // indirect
github.com/anacrolix/dht/v2 v2.19.2-0.20221121215055-066ad8494444 // indirect
github.com/anacrolix/envpprof v1.3.0 // indirect
github.com/anacrolix/generics v0.0.3-0.20240902042256-7fb2702ef0ca // indirect
github.com/anacrolix/go-libutp v1.3.2 // indirect
github.com/anacrolix/log v0.15.3-0.20240627045001-cd912c641d83 // indirect
github.com/anacrolix/missinggo v1.3.0 // indirect
github.com/anacrolix/missinggo/perf v1.0.0 // indirect
github.com/anacrolix/missinggo/v2 v2.7.4 // indirect
github.com/anacrolix/mmsg v1.0.1 // indirect
github.com/anacrolix/multiless v0.4.0 // indirect
github.com/anacrolix/stm v0.4.0 // indirect
github.com/anacrolix/sync v0.5.1 // indirect
github.com/anacrolix/upnp v0.1.4 // indirect
github.com/anacrolix/utp v0.1.0 // indirect
github.com/andybalholm/cascadia v1.3.3 // indirect
github.com/antchfx/htmlquery v1.3.4 // indirect
github.com/antchfx/xmlquery v1.4.4 // indirect
github.com/antchfx/xpath v1.3.3 // indirect
github.com/apparentlymart/go-textseg/v15 v15.0.0 // indirect
github.com/bahlo/generic-list-go v0.2.0 // indirect
github.com/benbjohnson/immutable v0.3.0 // indirect
github.com/bits-and-blooms/bitset v1.2.2 // indirect
github.com/andybalholm/cascadia v1.3.2 // indirect
github.com/blinkbean/dingtalk v1.1.3 // indirect
github.com/bmatcuk/doublestar v1.3.4 // indirect
github.com/bradfitz/iter v0.0.0-20191230175014-e8f45d346db8 // indirect
github.com/cespare/xxhash v1.1.0 // indirect
github.com/dustin/go-humanize v1.0.0 // indirect
github.com/edsrzf/mmap-go v1.1.0 // indirect
github.com/go-llsqlite/adapter v0.0.0-20230927005056-7f5ce7f0c916 // indirect
github.com/go-llsqlite/crawshaw v0.5.2-0.20240425034140-f30eb7704568 // indirect
github.com/felixge/httpsnoop v1.0.4 // indirect
github.com/go-logr/logr v1.4.2 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/go-telegram-bot-api/telegram-bot-api v4.6.4+incompatible // indirect
github.com/go-test/deep v1.0.4 // indirect
github.com/go-viper/mapstructure/v2 v2.4.0 // indirect
github.com/gobwas/glob v0.2.3 // indirect
github.com/golang/groupcache v0.0.0-20241129210726-2c02b8208cf8 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.4 // indirect
github.com/google/btree v1.1.2 // indirect
github.com/gorilla/websocket v1.5.3 // indirect
github.com/google/generative-ai-go v0.19.0 // indirect
github.com/google/s2a-go v0.1.7 // indirect
github.com/googleapis/enterprise-certificate-proxy v0.3.2 // indirect
github.com/googleapis/gax-go/v2 v2.12.5 // indirect
github.com/gregdel/pushover v1.3.1 // indirect
github.com/huandu/xstrings v1.3.2 // indirect
github.com/kennygrant/sanitize v1.2.4 // indirect
github.com/minio/sha256-simd v1.0.0 // indirect
github.com/mr-tron/base58 v1.2.0 // indirect
github.com/mschoch/smat v0.2.0 // indirect
github.com/multiformats/go-multihash v0.2.3 // indirect
github.com/multiformats/go-varint v0.0.6 // indirect
github.com/ncruces/julianday v1.0.0 // indirect
github.com/pion/datachannel v1.5.9 // indirect
github.com/pion/dtls/v3 v3.0.3 // indirect
github.com/pion/ice/v4 v4.0.2 // indirect
github.com/pion/interceptor v0.1.39 // indirect
github.com/pion/logging v0.2.3 // indirect
github.com/pion/mdns/v2 v2.0.7 // indirect
github.com/pion/randutil v0.1.0 // indirect
github.com/pion/rtcp v1.2.15 // indirect
github.com/pion/rtp v1.8.18 // indirect
github.com/pion/sctp v1.8.33 // indirect
github.com/pion/sdp/v3 v3.0.9 // indirect
github.com/pion/srtp/v3 v3.0.4 // indirect
github.com/pion/transport/v3 v3.0.7 // indirect
github.com/pion/turn/v4 v4.0.0 // indirect
github.com/pion/webrtc/v4 v4.0.0 // indirect
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
github.com/protolambda/ctxlock v0.1.0 // indirect
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect
github.com/rs/dnscache v0.0.0-20211102005908-e0241e321417 // indirect
github.com/saintfish/chardet v0.0.0-20230101081208-5e3ef4b5456d // indirect
github.com/spaolacci/murmur3 v1.1.0 // indirect
github.com/stretchr/objx v0.5.2 // indirect
github.com/technoweenie/multipartstreamer v1.0.1 // indirect
github.com/temoto/robotstxt v1.1.2 // indirect
github.com/tetratelabs/wazero v1.9.0 // indirect
github.com/tidwall/btree v1.6.0 // indirect
github.com/tidwall/gjson v1.18.0 // indirect
github.com/tidwall/match v1.1.1 // indirect
github.com/tidwall/pretty v1.2.1 // indirect
github.com/tidwall/sjson v1.2.5 // indirect
github.com/wlynxg/anet v0.0.5 // indirect
github.com/zclconf/go-cty-yaml v1.1.0 // indirect
go.etcd.io/bbolt v1.3.6 // indirect
go.opentelemetry.io/otel v1.32.0 // indirect
go.opentelemetry.io/otel/metric v1.32.0 // indirect
go.opentelemetry.io/otel/trace v1.32.0 // indirect
golang.org/x/sync v0.16.0 // indirect
golang.org/x/time v0.8.0 // indirect
google.golang.org/appengine v1.6.8 // indirect
github.com/tetratelabs/wazero v1.8.0 // indirect
go.opencensus.io v0.24.0 // indirect
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.53.0 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.53.0 // indirect
go.opentelemetry.io/otel v1.28.0 // indirect
go.opentelemetry.io/otel/metric v1.28.0 // indirect
go.opentelemetry.io/otel/trace v1.28.0 // indirect
golang.org/x/oauth2 v0.21.0 // indirect
golang.org/x/sync v0.10.0 // indirect
golang.org/x/time v0.5.0 // indirect
google.golang.org/api v0.188.0 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20240711142825-46eb208f015d // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240711142825-46eb208f015d // indirect
google.golang.org/grpc v1.65.0 // indirect
gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
lukechampine.com/blake3 v1.1.6 // indirect
modernc.org/libc v1.22.3 // indirect
modernc.org/mathutil v1.5.0 // indirect
modernc.org/memory v1.5.0 // indirect
modernc.org/sqlite v1.21.1 // indirect
zombiezen.com/go/sqlite v0.13.1 // indirect
)
require (
ariga.io/atlas v0.31.1-0.20250212144724-069be8033e83 // indirect
ariga.io/atlas v0.19.1-0.20240203083654-5948b60a8e43 // indirect
github.com/agext/levenshtein v1.2.1 // indirect
github.com/apparentlymart/go-textseg/v13 v13.0.0 // indirect
github.com/bytedance/sonic v1.11.6 // indirect
github.com/bytedance/sonic/loader v0.1.1 // indirect
github.com/cloudwego/base64x v0.1.4 // indirect
github.com/cloudwego/iasm v0.2.0 // indirect
github.com/fsnotify/fsnotify v1.8.0 // indirect
github.com/gabriel-vasile/mimetype v1.4.10
github.com/fsnotify/fsnotify v1.7.0 // indirect
github.com/gabriel-vasile/mimetype v1.4.4
github.com/gin-contrib/sse v0.1.0 // indirect
github.com/gin-contrib/static v1.1.2
github.com/go-openapi/inflect v0.19.0 // indirect
github.com/go-playground/locales v0.14.1 // indirect
github.com/go-playground/universal-translator v0.18.1 // indirect
github.com/go-playground/validator/v10 v10.20.0 // indirect
github.com/goccy/go-json v0.10.5
github.com/goccy/go-json v0.10.2 // indirect
github.com/google/go-cmp v0.6.0 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/hashicorp/hcl/v2 v2.13.0 // indirect
github.com/hekmon/cunits/v2 v2.1.0 // indirect
// indirect
github.com/klauspost/cpuid/v2 v2.2.7 // indirect
github.com/leodido/go-urn v1.4.0 // indirect
github.com/magiconair/properties v1.8.7 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/mitchellh/go-wordwrap v0.0.0-20150314170334-ad45545899c7 // indirect
github.com/pelletier/go-toml/v2 v2.2.3 // indirect
github.com/sagikazarmark/locafero v0.7.0 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/pelletier/go-toml/v2 v2.2.2 // indirect
github.com/sagikazarmark/locafero v0.4.0 // indirect
github.com/sagikazarmark/slog-shim v0.1.0 // indirect
github.com/sourcegraph/conc v0.3.0 // indirect
github.com/spf13/afero v1.12.0 // indirect
github.com/spf13/cast v1.7.1 // indirect
github.com/spf13/pflag v1.0.6 // indirect
github.com/spf13/afero v1.11.0 // indirect
github.com/spf13/cast v1.6.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/subosito/gotenv v1.6.0 // indirect
github.com/twitchyliquid64/golang-asm v0.15.1 // indirect
github.com/ugorji/go/codec v1.2.12 // indirect
github.com/zclconf/go-cty v1.14.4 // indirect
github.com/zclconf/go-cty v1.8.0 // indirect
golang.org/x/arch v0.8.0 // indirect
golang.org/x/crypto v0.41.0
golang.org/x/exp v0.0.0-20241215155358-4a5509556b9e
golang.org/x/mod v0.26.0 // indirect
golang.org/x/sys v0.35.0
golang.org/x/text v0.28.0 // indirect
google.golang.org/protobuf v1.36.5 // indirect
golang.org/x/crypto v0.31.0
golang.org/x/exp v0.0.0-20240823005443-9b4947da3948
golang.org/x/mod v0.20.0 // indirect
golang.org/x/sys v0.28.0
golang.org/x/text v0.21.0 // indirect
google.golang.org/protobuf v1.34.2 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
require (
github.com/cyruzin/golang-tmdb v1.8.1
github.com/gin-gonic/gin v1.10.1
github.com/cyruzin/golang-tmdb v1.6.3
github.com/gin-gonic/gin v1.10.0
github.com/hekmon/transmissionrpc/v3 v3.0.0
github.com/json-iterator/go v1.1.12 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/natefinch/lumberjack v2.0.0+incompatible
github.com/pkg/errors v0.9.1
github.com/spf13/viper v1.20.1
github.com/spf13/viper v1.19.0
go.uber.org/multierr v1.11.0 // indirect
)

453
go.sum
View File

@@ -1,125 +1,78 @@
ariga.io/atlas v0.31.1-0.20250212144724-069be8033e83 h1:nX4HXncwIdvQ8/8sIUIf1nyCkK8qdBaHQ7EtzPpuiGE=
ariga.io/atlas v0.31.1-0.20250212144724-069be8033e83/go.mod h1:Oe1xWPuu5q9LzyrWfbZmEZxFYeu4BHTyzfjeW2aZp/w=
ariga.io/atlas v0.19.1-0.20240203083654-5948b60a8e43 h1:GwdJbXydHCYPedeeLt4x/lrlIISQ4JTH1mRWuE5ZZ14=
ariga.io/atlas v0.19.1-0.20240203083654-5948b60a8e43/go.mod h1:uj3pm+hUTVN/X5yfdBexHlZv+1Xu5u5ZbZx7+CDavNU=
cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
cloud.google.com/go v0.115.0 h1:CnFSK6Xo3lDYRoBKEcAtia6VSC837/ZkJuRduSFnr14=
cloud.google.com/go v0.115.0/go.mod h1:8jIM5vVgoAEoiVxQ/O4BFTfHqulPZgs/ufEzMcFMdWU=
cloud.google.com/go/ai v0.8.0 h1:rXUEz8Wp2OlrM8r1bfmpF2+VKqc1VJpafE3HgzRnD/w=
cloud.google.com/go/ai v0.8.0/go.mod h1:t3Dfk4cM61sytiggo2UyGsDVW3RF1qGZaUKDrZFyqkE=
cloud.google.com/go/auth v0.7.1 h1:Iv1bbpzJ2OIg16m94XI9/tlzZZl3cdeR3nGVGj78N7s=
cloud.google.com/go/auth v0.7.1/go.mod h1:VEc4p5NNxycWQTMQEDQF0bd6aTMb6VgYDXEwiJJQAbs=
cloud.google.com/go/auth/oauth2adapt v0.2.3 h1:MlxF+Pd3OmSudg/b1yZ5lJwoXCEaeedAguodky1PcKI=
cloud.google.com/go/auth/oauth2adapt v0.2.3/go.mod h1:tMQXOfZzFuNuUxOypHlQEXgdfX5cuhwU+ffUuXRJE8I=
cloud.google.com/go/compute v1.24.0 h1:phWcR2eWzRJaL/kOiJwfFsPs4BaKq1j6vnpZrc1YlVg=
cloud.google.com/go/compute/metadata v0.5.0 h1:Zr0eK8JbFv6+Wi4ilXAR8FJ3wyNdpxHKJNPos6LTZOY=
cloud.google.com/go/compute/metadata v0.5.0/go.mod h1:aHnloV2TPI38yx4s9+wAZhHykWvVCfu7hQbF+9CWoiY=
cloud.google.com/go/longrunning v0.5.10 h1:eB/BniENNRKhjz/xgiillrdcH3G74TGSl3BXinGlI7E=
cloud.google.com/go/longrunning v0.5.10/go.mod h1:tljz5guTr5oc/qhlUjBlk7UAIFMOGuPNxkNDZXlLics=
crawshaw.io/iox v0.0.0-20181124134642-c51c3df30797/go.mod h1:sXBiorCo8c46JlQV3oXPKINnZ8mcqnye1EkVkqsectk=
crawshaw.io/sqlite v0.3.2/go.mod h1:igAO5JulrQ1DbdZdtVq48mnZUBAPOeFzer7VhDWNtW4=
entgo.io/ent v0.14.4 h1:/DhDraSLXIkBhyiVoJeSshr4ZYi7femzhj6/TckzZuI=
entgo.io/ent v0.14.4/go.mod h1:aDPE/OziPEu8+OWbzy4UlvWmD2/kbRuWfK2A40hcxJM=
filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA=
filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4=
entgo.io/ent v0.13.1 h1:uD8QwN1h6SNphdCCzmkMN3feSUzNnVvV/WIkHKMbzOE=
entgo.io/ent v0.13.1/go.mod h1:qCEmo+biw3ccBn9OyL4ZK5dfpwg++l1Gxwac5B1206A=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/BurntSushi/toml v1.4.0 h1:kuoIxZQy2WRRk1pttg9asf+WVv6tWQuBNVmK8+nqPr0=
github.com/BurntSushi/toml v1.4.0/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho=
github.com/DATA-DOG/go-sqlmock v1.5.2 h1:OcvFkGmslmlZibjAjaHm3L//6LiuBgolP7OputlJIzU=
github.com/DATA-DOG/go-sqlmock v1.5.2/go.mod h1:88MAG/4G7SMwSE3CeA0ZKzrT5CiOU3OJ+JlNzwDqpNU=
github.com/OneOfOne/xxhash v1.2.2 h1:KMrpdQIwFcEqXDklaen+P1axHaj9BSKzvpUUfnHldSE=
github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU=
github.com/PuerkitoBio/goquery v1.10.3 h1:pFYcNSqHxBD06Fpj/KsbStFRsgRATgnf3LeXiUkhzPo=
github.com/PuerkitoBio/goquery v1.10.3/go.mod h1:tMUX0zDMHXYlAQk6p35XxQMqMweEKB7iK7iLNd4RH4Y=
github.com/PuerkitoBio/goquery v1.9.2 h1:4/wZksC3KgkQw7SQgkKotmKljk0M6V8TUvA8Wb4yPeE=
github.com/PuerkitoBio/goquery v1.9.2/go.mod h1:GHPCaP0ODyyxqcNoFGYlAprUFH81NuRPd0GX3Zu2Mvk=
github.com/RoaringBitmap/roaring v0.4.7/go.mod h1:8khRDP4HmeXns4xIj9oGrKSz7XTQiJx2zgh7AcNke4w=
github.com/RoaringBitmap/roaring v0.4.17/go.mod h1:D3qVegWTmfCaX4Bl5CrBE9hfrSrrXIr8KVNvRsDi1NI=
github.com/RoaringBitmap/roaring v0.4.23/go.mod h1:D0gp8kJQgE1A4LQ5wFLggQEyvDi06Mq5mKs52e1TwOo=
github.com/RoaringBitmap/roaring v1.2.3 h1:yqreLINqIrX22ErkKI0vY47/ivtJr6n+kMhVOVmhWBY=
github.com/RoaringBitmap/roaring v1.2.3/go.mod h1:plvDsJQpxOC5bw8LRteu/MLWHsHez/3y6cubLI4/1yE=
github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo=
github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI=
github.com/agext/levenshtein v1.2.1 h1:QmvMAjj2aEICytGiWzmxoE0x2KZvE0fvmqMOfy2tjT8=
github.com/agext/levenshtein v1.2.1/go.mod h1:JEDfjyjHDjOF/1e4FlBE/PkbqA9OfWu2ki2W0IB5558=
github.com/ajwerner/btree v0.0.0-20211221152037-f427b3e689c0 h1:byYvvbfSo3+9efR4IeReh77gVs4PnNDR3AMOE9NJ7a0=
github.com/ajwerner/btree v0.0.0-20211221152037-f427b3e689c0/go.mod h1:q37NoqncT41qKc048STsifIt69LfUJ8SrWWcz/yam5k=
github.com/alecthomas/assert/v2 v2.0.0-alpha3 h1:pcHeMvQ3OMstAWgaeaXIAL8uzB9xMm2zlxt+/4ml8lk=
github.com/alecthomas/assert/v2 v2.0.0-alpha3/go.mod h1:+zD0lmDXTeQj7TgDgCt0ePWxb0hMC1G+PGTsTCv1B9o=
github.com/alecthomas/atomic v0.1.0-alpha2 h1:dqwXmax66gXvHhsOS4pGPZKqYOlTkapELkLb3MNdlH8=
github.com/alecthomas/atomic v0.1.0-alpha2/go.mod h1:zD6QGEyw49HIq19caJDc2NMXAy8rNi9ROrxtMXATfyI=
github.com/alecthomas/repr v0.0.0-20210801044451-80ca428c5142 h1:8Uy0oSf5co/NZXje7U1z8Mpep++QJOldL2hs/sBQf48=
github.com/alecthomas/repr v0.0.0-20210801044451-80ca428c5142/go.mod h1:2kn6fqh/zIyPLmm3ugklbEi5hg5wS435eygvNfaDQL8=
github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
github.com/anacrolix/chansync v0.4.1-0.20240627045151-1aa1ac392fe8 h1:eyb0bBaQKMOh5Se/Qg54shijc8K4zpQiOjEhKFADkQM=
github.com/anacrolix/chansync v0.4.1-0.20240627045151-1aa1ac392fe8/go.mod h1:DZsatdsdXxD0WiwcGl0nJVwyjCKMDv+knl1q2iBjA2k=
github.com/anacrolix/dht/v2 v2.19.2-0.20221121215055-066ad8494444 h1:8V0K09lrGoeT2KRJNOtspA7q+OMxGwQqK/Ug0IiaaRE=
github.com/anacrolix/dht/v2 v2.19.2-0.20221121215055-066ad8494444/go.mod h1:MctKM1HS5YYDb3F30NGJxLE+QPuqWoT5ReW/4jt8xew=
github.com/anacrolix/envpprof v0.0.0-20180404065416-323002cec2fa/go.mod h1:KgHhUaQMc8cC0+cEflSgCFNFbKwi5h54gqtVn8yhP7c=
github.com/anacrolix/envpprof v1.0.0/go.mod h1:KgHhUaQMc8cC0+cEflSgCFNFbKwi5h54gqtVn8yhP7c=
github.com/anacrolix/envpprof v1.1.0/go.mod h1:My7T5oSqVfEn4MD4Meczkw/f5lSIndGAKu/0SM/rkf4=
github.com/anacrolix/envpprof v1.3.0 h1:WJt9bpuT7A/CDCxPOv/eeZqHWlle/Y0keJUvc6tcJDk=
github.com/anacrolix/envpprof v1.3.0/go.mod h1:7QIG4CaX1uexQ3tqd5+BRa/9e2D02Wcertl6Yh0jCB0=
github.com/anacrolix/generics v0.0.0-20230113004304-d6428d516633/go.mod h1:ff2rHB/joTV03aMSSn/AZNnaIpUw0h3njetGsaXcMy8=
github.com/anacrolix/generics v0.0.3-0.20240902042256-7fb2702ef0ca h1:aiiGqSQWjtVNdi8zUMfA//IrM8fPkv2bWwZVPbDe0wg=
github.com/anacrolix/generics v0.0.3-0.20240902042256-7fb2702ef0ca/go.mod h1:MN3ve08Z3zSV/rTuX/ouI4lNdlfTxgdafQJiLzyNRB8=
github.com/anacrolix/go-libutp v1.3.2 h1:WswiaxTIogchbkzNgGHuHRfbrYLpv4o290mlvcx+++M=
github.com/anacrolix/go-libutp v1.3.2/go.mod h1:fCUiEnXJSe3jsPG554A200Qv+45ZzIIyGEvE56SHmyA=
github.com/anacrolix/log v0.3.0/go.mod h1:lWvLTqzAnCWPJA08T2HCstZi0L1y2Wyvm3FJgwU9jwU=
github.com/anacrolix/log v0.6.0/go.mod h1:lWvLTqzAnCWPJA08T2HCstZi0L1y2Wyvm3FJgwU9jwU=
github.com/anacrolix/log v0.13.1/go.mod h1:D4+CvN8SnruK6zIFS/xPoRJmtvtnxs+CSfDQ+BFxZ68=
github.com/anacrolix/log v0.14.2/go.mod h1:1OmJESOtxQGNMlUO5rcv96Vpp9mfMqXXbe2RdinFLdY=
github.com/anacrolix/log v0.15.3-0.20240627045001-cd912c641d83 h1:9o/yVzzLzYaBDFx8B27yhkvBLhNnRAuSTK7Y+yZKVtU=
github.com/anacrolix/log v0.15.3-0.20240627045001-cd912c641d83/go.mod h1:xvHjsYWWP7yO8PZwtuIp/k0DBlu07pSJqH4SEC78Vwc=
github.com/anacrolix/lsan v0.0.0-20211126052245-807000409a62 h1:P04VG6Td13FHMgS5ZBcJX23NPC/fiC4cp9bXwYujdYM=
github.com/anacrolix/lsan v0.0.0-20211126052245-807000409a62/go.mod h1:66cFKPCO7Sl4vbFnAaSq7e4OXtdMhRSBagJGWgmpJbM=
github.com/anacrolix/missinggo v0.0.0-20180725070939-60ef2fbf63df/go.mod h1:kwGiTUTZ0+p4vAz3VbAI5a30t2YbvemcmspjKwrAz5s=
github.com/anacrolix/missinggo v1.1.0/go.mod h1:MBJu3Sk/k3ZfGYcS7z18gwfu72Ey/xopPFJJbTi5yIo=
github.com/anacrolix/missinggo v1.1.2-0.20190815015349-b888af804467/go.mod h1:MBJu3Sk/k3ZfGYcS7z18gwfu72Ey/xopPFJJbTi5yIo=
github.com/anacrolix/missinggo v1.2.1/go.mod h1:J5cMhif8jPmFoC3+Uvob3OXXNIhOUikzMt+uUjeM21Y=
github.com/anacrolix/missinggo v1.3.0 h1:06HlMsudotL7BAELRZs0yDZ4yVXsHXGi323QBjAVASw=
github.com/anacrolix/missinggo v1.3.0/go.mod h1:bqHm8cE8xr+15uVfMG3BFui/TxyB6//H5fwlq/TeqMc=
github.com/anacrolix/missinggo/perf v1.0.0 h1:7ZOGYziGEBytW49+KmYGTaNfnwUqP1HBsy6BqESAJVw=
github.com/anacrolix/missinggo/perf v1.0.0/go.mod h1:ljAFWkBuzkO12MQclXzZrosP5urunoLS0Cbvb4V0uMQ=
github.com/anacrolix/missinggo/v2 v2.2.0/go.mod h1:o0jgJoYOyaoYQ4E2ZMISVa9c88BbUBVQQW4QeRkNCGY=
github.com/anacrolix/missinggo/v2 v2.5.1/go.mod h1:WEjqh2rmKECd0t1VhQkLGTdIWXO6f6NLjp5GlMZ+6FA=
github.com/anacrolix/missinggo/v2 v2.7.4 h1:47h5OXoPV8JbA/ACA+FLwKdYbAinuDO8osc2Cu9xkxg=
github.com/anacrolix/missinggo/v2 v2.7.4/go.mod h1:vVO5FEziQm+NFmJesc7StpkquZk+WJFCaL0Wp//2sa0=
github.com/anacrolix/mmsg v1.0.1 h1:TxfpV7kX70m3f/O7ielL/2I3OFkMPjrRCPo7+4X5AWw=
github.com/anacrolix/mmsg v1.0.1/go.mod h1:x8kRaJY/dCrY9Al0PEcj1mb/uFHwP6GCJ9fLl4thEPc=
github.com/anacrolix/multiless v0.4.0 h1:lqSszHkliMsZd2hsyrDvHOw4AbYWa+ijQ66LzbjqWjM=
github.com/anacrolix/multiless v0.4.0/go.mod h1:zJv1JF9AqdZiHwxqPgjuOZDGWER6nyE48WBCi/OOrMM=
github.com/anacrolix/stm v0.2.0/go.mod h1:zoVQRvSiGjGoTmbM0vSLIiaKjWtNPeTvXUSdJQA4hsg=
github.com/anacrolix/stm v0.4.0 h1:tOGvuFwaBjeu1u9X1eIh9TX8OEedEiEQ1se1FjhFnXY=
github.com/anacrolix/stm v0.4.0/go.mod h1:GCkwqWoAsP7RfLW+jw+Z0ovrt2OO7wRzcTtFYMYY5t8=
github.com/anacrolix/sync v0.0.0-20180808010631-44578de4e778/go.mod h1:s735Etp3joe/voe2sdaXLcqDdJSay1O0OPnM0ystjqk=
github.com/anacrolix/sync v0.3.0/go.mod h1:BbecHL6jDSExojhNtgTFSBcdGerzNc64tz3DCOj/I0g=
github.com/anacrolix/sync v0.5.1 h1:FbGju6GqSjzVoTgcXTUKkF041lnZkG5P0C3T5RL3SGc=
github.com/anacrolix/sync v0.5.1/go.mod h1:BbecHL6jDSExojhNtgTFSBcdGerzNc64tz3DCOj/I0g=
github.com/anacrolix/tagflag v0.0.0-20180109131632-2146c8d41bf0/go.mod h1:1m2U/K6ZT+JZG0+bdMK6qauP49QT4wE5pmhJXOKKCHw=
github.com/anacrolix/tagflag v1.0.0/go.mod h1:1m2U/K6ZT+JZG0+bdMK6qauP49QT4wE5pmhJXOKKCHw=
github.com/anacrolix/tagflag v1.1.0/go.mod h1:Scxs9CV10NQatSmbyjqmqmeQNwGzlNe0CMUMIxqHIG8=
github.com/anacrolix/torrent v1.58.1 h1:6FP+KH57b1gyT2CpVL9fEqf9MGJEgh3xw1VA8rI0pW8=
github.com/anacrolix/torrent v1.58.1/go.mod h1:/7ZdLuHNKgtCE1gjYJCfbtG9JodBcDaF5ip5EUWRtk8=
github.com/anacrolix/upnp v0.1.4 h1:+2t2KA6QOhm/49zeNyeVwDu1ZYS9dB9wfxyVvh/wk7U=
github.com/anacrolix/upnp v0.1.4/go.mod h1:Qyhbqo69gwNWvEk1xNTXsS5j7hMHef9hdr984+9fIic=
github.com/anacrolix/utp v0.1.0 h1:FOpQOmIwYsnENnz7tAGohA+r6iXpRjrq8ssKSre2Cp4=
github.com/anacrolix/utp v0.1.0/go.mod h1:MDwc+vsGEq7RMw6lr2GKOEqjWny5hO5OZXRVNaBJ2Dk=
github.com/andybalholm/cascadia v1.3.3 h1:AG2YHrzJIm4BZ19iwJ/DAua6Btl3IwJX+VI4kktS1LM=
github.com/andybalholm/cascadia v1.3.3/go.mod h1:xNd9bqTn98Ln4DwST8/nG+H0yuB8Hmgu1YHNnWw0GeA=
github.com/antchfx/htmlquery v1.3.4 h1:Isd0srPkni2iNTWCwVj/72t7uCphFeor5Q8nCzj1jdQ=
github.com/antchfx/htmlquery v1.3.4/go.mod h1:K9os0BwIEmLAvTqaNSua8tXLWRWZpocZIH73OzWQbwM=
github.com/antchfx/xmlquery v1.4.4 h1:mxMEkdYP3pjKSftxss4nUHfjBhnMk4imGoR96FRY2dg=
github.com/antchfx/xmlquery v1.4.4/go.mod h1:AEPEEPYE9GnA2mj5Ur2L5Q5/2PycJ0N9Fusrx9b12fc=
github.com/antchfx/xpath v1.3.3 h1:tmuPQa1Uye0Ym1Zn65vxPgfltWb/Lxu2jeqIGteJSRs=
github.com/antchfx/xpath v1.3.3/go.mod h1:i54GszH55fYfBmoZXapTHN8T8tkcHfRgLyVwwqzXNcs=
github.com/anacrolix/torrent v1.57.1 h1:CS8rYfC2Oe15NPBhwCNs/3WBY6HiBCPDFpY+s9aFHbA=
github.com/anacrolix/torrent v1.57.1/go.mod h1:NNBg4lP2/us9Hp5+cLNcZRILM69cNoKIkqMGqr9AuR0=
github.com/andybalholm/cascadia v1.3.2 h1:3Xi6Dw5lHF15JtdcmAHD3i1+T8plmv7BQ/nsViSLyss=
github.com/andybalholm/cascadia v1.3.2/go.mod h1:7gtRlve5FxPPgIgX36uWBX58OdBsSS6lUvCFb+h7KvU=
github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ=
github.com/apparentlymart/go-textseg/v13 v13.0.0 h1:Y+KvPE1NYz0xl601PVImeQfFyEy6iT90AvPUL1NNfNw=
github.com/apparentlymart/go-textseg/v13 v13.0.0/go.mod h1:ZK2fH7c4NqDTLtiYLvIkEghdlcqw7yxLeM89kiTRPUo=
github.com/apparentlymart/go-textseg/v15 v15.0.0 h1:uYvfpb3DyLSCGWnctWKGj857c6ew1u1fNQOlOtuGxQY=
github.com/apparentlymart/go-textseg/v15 v15.0.0/go.mod h1:K8XmNZdhEBkdlyDdvbmmsvpAG721bKi0joRfFdHIWJ4=
github.com/bahlo/generic-list-go v0.2.0 h1:5sz/EEAK+ls5wF+NeqDpk5+iNdMDXrh3z3nPnH1Wvgk=
github.com/bahlo/generic-list-go v0.2.0/go.mod h1:2KvAjgMlE5NNynlg/5iLrrCCZ2+5xWbdbCW3pNTGyYg=
github.com/benbjohnson/immutable v0.2.0/go.mod h1:uc6OHo6PN2++n98KHLxW8ef4W42ylHiQSENghE1ezxI=
github.com/benbjohnson/immutable v0.3.0 h1:TVRhuZx2wG9SZ0LRdqlbs9S5BZ6Y24hJEHTCgWHZEIw=
github.com/benbjohnson/immutable v0.3.0/go.mod h1:uc6OHo6PN2++n98KHLxW8ef4W42ylHiQSENghE1ezxI=
github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q=
github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8=
github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
github.com/bits-and-blooms/bitset v1.2.0/go.mod h1:gIdJ4wp64HaoK2YrL1Q5/N7Y16edYb8uY+O0FJTyyDA=
github.com/bits-and-blooms/bitset v1.2.2 h1:J5gbX05GpMdBjCvQ9MteIg2KKDExr7DrgK+Yc15FvIk=
github.com/bits-and-blooms/bitset v1.2.2/go.mod h1:gIdJ4wp64HaoK2YrL1Q5/N7Y16edYb8uY+O0FJTyyDA=
github.com/blinkbean/dingtalk v1.1.3 h1:MbidFZYom7DTFHD/YIs+eaI7kRy52kmWE/sy0xjo6E4=
github.com/blinkbean/dingtalk v1.1.3/go.mod h1:9BaLuGSBqY3vT5hstValh48DbsKO7vaHaJnG9pXwbto=
github.com/bmatcuk/doublestar v1.3.4 h1:gPypJ5xD31uhX6Tf54sDPUOBXTqKH4c9aPY66CyQrS0=
github.com/bmatcuk/doublestar v1.3.4/go.mod h1:wiQtGV+rzVYxB7WIlirSN++5HPtPlXEo9MEoZQC/PmE=
github.com/bradfitz/iter v0.0.0-20140124041915-454541ec3da2/go.mod h1:PyRFw1Lt2wKX4ZVSQ2mk+PeDa1rxyObEDlApuIsUKuo=
github.com/bradfitz/iter v0.0.0-20190303215204-33e6a9893b0c/go.mod h1:PyRFw1Lt2wKX4ZVSQ2mk+PeDa1rxyObEDlApuIsUKuo=
github.com/bradfitz/iter v0.0.0-20191230175014-e8f45d346db8 h1:GKTyiRCL6zVf5wWaqKnf+7Qs6GbEPfd4iMOitWzXJx8=
@@ -128,47 +81,47 @@ github.com/bytedance/sonic v1.11.6 h1:oUp34TzMlL+OY1OUWxHqsdkgC/Zfc85zGqw9siXjrc
github.com/bytedance/sonic v1.11.6/go.mod h1:LysEHSvpvDySVdC2f87zGWf6CIKJcAvqab1ZaiQtds4=
github.com/bytedance/sonic/loader v0.1.1 h1:c+e5Pt1k/cy5wMveRDyk2X4B9hF4g7an8N3zCYjJFNM=
github.com/bytedance/sonic/loader v0.1.1/go.mod h1:ncP89zfokxS5LZrJxl5z0UJcsk4M4yY2JpfqGeCtNLU=
github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko=
github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc=
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
github.com/cloudwego/base64x v0.1.4 h1:jwCgWpFanWmN8xoIUHa2rtzmkd5J2plF/dnLS6Xd/0Y=
github.com/cloudwego/base64x v0.1.4/go.mod h1:0zlkT4Wn5C6NdauXdJRhSKRlJvmclQ1hhJgA0rcu/8w=
github.com/cloudwego/iasm v0.2.0 h1:1KNIy1I1H9hNNFEEH3DVnI4UujN+1zjpuk6gwHLTssg=
github.com/cloudwego/iasm v0.2.0/go.mod h1:8rXZaNYT2n95jn+zTI1sDr+IgcD2GVs0nlbbQPiEFhY=
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
github.com/cyruzin/golang-tmdb v1.8.1 h1:5s0FjKM5NsTfezvIkZKUgAEw0eBHs1t2JmuJ6Gy81sg=
github.com/cyruzin/golang-tmdb v1.8.1/go.mod h1:Yx4f4KyLgWAnvwgZ729nJPOTKkD4epYoK+cGDZ3AFzs=
github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc=
github.com/cyruzin/golang-tmdb v1.6.3 h1:TKK9h+uuwiDOaFlsVispG1KxqhsSM5Y4ZELnUF3GlqU=
github.com/cyruzin/golang-tmdb v1.6.3/go.mod h1:ZSryJLCcY+9TiKU+LbouXKns++YBrM8Tizannr05c+I=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM=
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE=
github.com/dustin/go-humanize v0.0.0-20180421182945-02af3965c54e/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk=
github.com/dustin/go-humanize v1.0.0 h1:VSnTsYCnlFHaM2/igO1h6X3HA71jcobQuxemgkq4zYo=
github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk=
github.com/eapache/go-resiliency v1.1.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs=
github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1:+020luEh2TKB4/GOp8oxxtq0Daoen/Cii55CzbTV6DU=
github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I=
github.com/edsrzf/mmap-go v1.1.0 h1:6EUwBLQ/Mcr1EYLE4Tn1VdW1A4ckqCQWZBw8Hr0kjpQ=
github.com/edsrzf/mmap-go v1.1.0/go.mod h1:19H/e8pUPLicwkyNgOykDXkJ9F0MHE+Z52B8EIth78Q=
github.com/frankban/quicktest v1.9.0/go.mod h1:ui7WezCLWMWxVWr1GETZY3smRy0G4KWq9vcPtJmFl7Y=
github.com/frankban/quicktest v1.14.4/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0=
github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98=
github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg=
github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U=
github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8=
github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0=
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
github.com/fsnotify/fsnotify v1.8.0 h1:dAwr6QBTBZIkG8roQaJjGof0pp0EeF+tNV7YBP3F/8M=
github.com/fsnotify/fsnotify v1.8.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0=
github.com/gabriel-vasile/mimetype v1.4.10 h1:zyueNbySn/z8mJZHLt6IPw0KoZsiQNszIpU+bX4+ZK0=
github.com/gabriel-vasile/mimetype v1.4.10/go.mod h1:d+9Oxyo1wTzWdyVUPMmXFvp4F9tea18J8ufA774AB3s=
github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA=
github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM=
github.com/gabriel-vasile/mimetype v1.4.4 h1:QjV6pZ7/XZ7ryI2KuyeEDE8wnh7fHP9YnQy+R0LnH8I=
github.com/gabriel-vasile/mimetype v1.4.4/go.mod h1:JwLei5XPtWdGiMFB5Pjle1oEeoSeEuJfJE+TtfvdB/s=
github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE=
github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI=
github.com/gin-contrib/static v1.1.2 h1:c3kT4bFkUJn2aoRU3s6XnMjJT8J6nNWJkR0NglqmlZ4=
github.com/gin-contrib/static v1.1.2/go.mod h1:Fw90ozjHCmZBWbgrsqrDvO28YbhKEKzKp8GixhR4yLw=
github.com/gin-contrib/zap v1.1.3 h1:9e/U9fYd4/OBfmSEBs5hHZq114uACn7bpuzvCkcJySA=
github.com/gin-contrib/zap v1.1.3/go.mod h1:+BD/6NYZKJyUpqVoJEvgeq9GLz8pINEQvak9LHNOTSE=
github.com/gin-gonic/gin v1.10.1 h1:T0ujvqyCSqRopADpgPgiTT63DUQVSfojyME59Ei63pQ=
github.com/gin-gonic/gin v1.10.1/go.mod h1:4PMNQiOhvDRa013RKVbsiNwoyezlm2rm0uX/T7kzp5Y=
github.com/gin-gonic/gin v1.10.0 h1:nTuyha1TYqgedzytsKYqna+DfLos46nTv2ygFy86HFU=
github.com/gin-gonic/gin v1.10.0/go.mod h1:4PMNQiOhvDRa013RKVbsiNwoyezlm2rm0uX/T7kzp5Y=
github.com/glycerine/go-unsnap-stream v0.0.0-20180323001048-9f0cb55181dd/go.mod h1:/20jfyN9Y5QPEAprSgKAUr+glWDY39ZiUEAYOEv5dsE=
github.com/glycerine/go-unsnap-stream v0.0.0-20181221182339-f9677308dec2/go.mod h1:/20jfyN9Y5QPEAprSgKAUr+glWDY39ZiUEAYOEv5dsE=
github.com/glycerine/go-unsnap-stream v0.0.0-20190901134440-81cf024a9e0a/go.mod h1:/20jfyN9Y5QPEAprSgKAUr+glWDY39ZiUEAYOEv5dsE=
@@ -177,10 +130,6 @@ github.com/glycerine/goconvey v0.0.0-20190315024820-982ee783a72e/go.mod h1:Ogl1T
github.com/glycerine/goconvey v0.0.0-20190410193231-58a59202ab31/go.mod h1:Ogl1Tioa0aV7gstGFO7KhffUsb9M4ydbEbbxpcEDc24=
github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=
github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=
github.com/go-llsqlite/adapter v0.0.0-20230927005056-7f5ce7f0c916 h1:OyQmpAN302wAopDgwVjgs2HkFawP9ahIEqkUYz7V7CA=
github.com/go-llsqlite/adapter v0.0.0-20230927005056-7f5ce7f0c916/go.mod h1:DADrR88ONKPPeSGjFp5iEN55Arx3fi2qXZeKCYDpbmU=
github.com/go-llsqlite/crawshaw v0.5.2-0.20240425034140-f30eb7704568 h1:3EpZo8LxIzF4q3BT+vttQQlRfA6uTtTb/cxVisWa5HM=
github.com/go-llsqlite/crawshaw v0.5.2-0.20240425034140-f30eb7704568/go.mod h1:/YJdV7uBQaYDE0fwe4z3wwJIZBJxdYzd38ICggWqtaE=
github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE=
github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk=
github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
@@ -198,86 +147,82 @@ github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJn
github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY=
github.com/go-playground/validator/v10 v10.20.0 h1:K9ISHbSaI0lyB2eWMPJo+kOS/FBExVwjEviJTixqxL8=
github.com/go-playground/validator/v10 v10.20.0/go.mod h1:dbuPbCMFw/DrkbEynArYaCwl3amGuJotoKCe95atGMM=
github.com/go-quicktest/qt v1.101.0 h1:O1K29Txy5P2OK0dGo59b7b0LR6wKfIhttaAhHUyn7eI=
github.com/go-quicktest/qt v1.101.0/go.mod h1:14Bz/f7NwaXPtdYEgzsx46kqSxVwTbzVZsDC26tQJow=
github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY=
github.com/go-telegram-bot-api/telegram-bot-api v4.6.4+incompatible h1:2cauKuaELYAEARXRkq2LrJ0yDDv1rW7+wrTEdVL3uaU=
github.com/go-telegram-bot-api/telegram-bot-api v4.6.4+incompatible/go.mod h1:qf9acutJ8cwBUhm1bqgz6Bei9/C/c93FPDljKWwsOgM=
github.com/go-test/deep v1.0.4 h1:u2CU3YKy9I2pmu9pX0eq50wCgjfGIt539SqR7FbHiho=
github.com/go-test/deep v1.0.4/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA=
github.com/go-viper/mapstructure/v2 v2.4.0 h1:EBsztssimR/CONLSZZ04E8qAkxNYq4Qp9LvH92wZUgs=
github.com/go-viper/mapstructure/v2 v2.4.0/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM=
github.com/gobwas/glob v0.2.3 h1:A4xDbljILXROh+kObIiy5kIaPYD8e96x1tgBhUI5J+Y=
github.com/gobwas/glob v0.2.3/go.mod h1:d3Ez4x06l9bZtSvzIay5+Yzi0fmZzPgnTbPcKjJAkT8=
github.com/goccy/go-json v0.10.5 h1:Fq85nIqj+gXn/S5ahsiTlK3TmC85qgirsdTP/+DeaC4=
github.com/goccy/go-json v0.10.5/go.mod h1:oq7eo15ShAhp70Anwd5lgX2pLfOS3QCiwU/PULtXL6M=
github.com/gocolly/colly v1.2.0 h1:qRz9YAn8FIH0qzgNUw+HT9UN7wm1oF9OBAilwEWpyrI=
github.com/gocolly/colly v1.2.0/go.mod h1:Hof5T3ZswNVsOHYmba1u03W65HDWgpV5HifSuueE0EA=
github.com/goccy/go-json v0.10.2 h1:CrxCmQqYDkv1z7lO7Wbh2HN93uovUHgrECaO5ZrCXAU=
github.com/goccy/go-json v0.10.2/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I=
github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
github.com/gogo/protobuf v1.2.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
github.com/golang-jwt/jwt/v5 v5.2.2 h1:Rl4B7itRWVtYIHFrSNd7vhTiz9UpLdi6gZhZ3wEeDy8=
github.com/golang-jwt/jwt/v5 v5.2.2/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk=
github.com/golang-jwt/jwt/v5 v5.2.1 h1:OuVbFODueb089Lh128TAcimifWaLhJwVflnrgM17wHk=
github.com/golang-jwt/jwt/v5 v5.2.1/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk=
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE=
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
github.com/golang/groupcache v0.0.0-20241129210726-2c02b8208cf8 h1:f+oWsMOmNPc8JmEHVZIycC7hBoQxHH9pNKQORJNozsQ=
github.com/golang/groupcache v0.0.0-20241129210726-2c02b8208cf8/go.mod h1:wcDNUvekVysuuOpQKo3191zZyTpiI6se1N1ULghS0sw=
github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw=
github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8=
github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA=
github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs=
github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w=
github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0=
github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8=
github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek=
github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps=
github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
github.com/google/btree v0.0.0-20180124185431-e89373fe6b4a/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
github.com/google/btree v1.1.2 h1:xf4v41cLI2Z6FxbKm+8Bu+m8ifhj15JuZ9sa0jZCMUU=
github.com/google/btree v1.1.2/go.mod h1:qOPhT0dTNdNzV6Z/lhRX0YXUafgPLFUh+gZMl761Gm4=
github.com/google/generative-ai-go v0.19.0 h1:R71szggh8wHMCUlEMsW2A/3T+5LdEIkiaHSYgSpUgdg=
github.com/google/generative-ai-go v0.19.0/go.mod h1:JYolL13VG7j79kM5BtHz4qwONHkeJQzOCkKXnpqtS/E=
github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
github.com/google/s2a-go v0.1.7 h1:60BLSyTrOV4/haCDW4zb1guZItoSq8foHCXrAnjBo/o=
github.com/google/s2a-go v0.1.7/go.mod h1:50CgR4k1jNlWBu4UfS4AcfhVe1r6pdZPygJ3R8F0Qdw=
github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/googleapis/enterprise-certificate-proxy v0.3.2 h1:Vie5ybvEvT75RniqhfFxPRy3Bf7vr3h0cechB90XaQs=
github.com/googleapis/enterprise-certificate-proxy v0.3.2/go.mod h1:VLSiSSBs/ksPL8kq3OBOQ6WRI2QnaFynd1DCjZ62+V0=
github.com/googleapis/gax-go/v2 v2.12.5 h1:8gw9KZK8TiVKB6q3zHY3SBzLnrGp6HQjyfYBYGmXdxA=
github.com/googleapis/gax-go/v2 v2.12.5/go.mod h1:BUDKcWo+RaKq5SC9vVYL0wLADa3VcfswbOMMRmB9H3E=
github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY=
github.com/gopherjs/gopherjs v0.0.0-20181103185306-d547d1d9531e/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY=
github.com/gopherjs/gopherjs v0.0.0-20190309154008-847fc94819f9/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY=
github.com/gopherjs/gopherjs v0.0.0-20190910122728-9d188e94fb99/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY=
github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg=
github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs=
github.com/gorilla/websocket v1.5.3 h1:saDtZ6Pbx/0u+bgYQ3q96pZgCzfhKXGPqt7kZ72aNNg=
github.com/gorilla/websocket v1.5.3/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
github.com/gregdel/pushover v1.3.1 h1:4bMLITOZ15+Zpi6qqoGqOPuVHCwSUvMCgVnN5Xhilfo=
github.com/gregdel/pushover v1.3.1/go.mod h1:EcaO66Nn1StkpEm1iKtBTV3d2A16SoMsVER1PthX7to=
github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9neXJWAZQ=
github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48=
github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4=
github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ=
github.com/hashicorp/hcl/v2 v2.13.0 h1:0Apadu1w6M11dyGFxWnmhhcMjkbAiKCv7G1r/2QgCNc=
github.com/hashicorp/hcl/v2 v2.13.0/go.mod h1:e4z5nxYlWNPdDSNYX+ph14EvWYMFm3eP0zIUqPc2jr0=
github.com/hekmon/cunits/v2 v2.1.0 h1:k6wIjc4PlacNOHwKEMBgWV2/c8jyD4eRMs5mR1BBhI0=
github.com/hekmon/cunits/v2 v2.1.0/go.mod h1:9r1TycXYXaTmEWlAIfFV8JT+Xo59U96yUJAYHxzii2M=
github.com/hekmon/transmissionrpc/v3 v3.0.0 h1:0Fb11qE0IBh4V4GlOwHNYpqpjcYDp5GouolwrpmcUDQ=
github.com/hekmon/transmissionrpc/v3 v3.0.0/go.mod h1:38SlNhFzinVUuY87wGj3acOmRxeYZAZfrj6Re7UgCDg=
github.com/hexops/gotextdiff v1.0.3 h1:gitA9+qJrrTCsiCl7+kh75nPqQt1cx4ZkudSTLoUqJM=
github.com/hexops/gotextdiff v1.0.3/go.mod h1:pSWU5MAI3yDq+fZBTazCSJysOMbxWL1BSow5/V2vxeg=
github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
github.com/huandu/xstrings v1.0.0/go.mod h1:4qWG/gcEcfX4z/mBDHJ++3ReCw9ibxbsNJbcucJdbSo=
github.com/huandu/xstrings v1.2.0/go.mod h1:DvyZB1rfVYsBIigL8HwpZgxHwXozlTgGqn63UyNX5k4=
github.com/huandu/xstrings v1.3.0/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE=
github.com/huandu/xstrings v1.3.1/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE=
github.com/huandu/xstrings v1.3.2 h1:L18LIDzqlW6xN2rEkpdV8+oL/IXWJ1APd+vsdYy4Wdw=
github.com/huandu/xstrings v1.3.2/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE=
@@ -290,8 +235,6 @@ github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHm
github.com/jtolds/gls v4.2.1+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU=
github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU=
github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w=
github.com/kennygrant/sanitize v1.2.4 h1:gN25/otpP5vAsO2djbMhF/LQX6R7+O1TB4yv8NzpJ3o=
github.com/kennygrant/sanitize v1.2.4/go.mod h1:LGsjYYtgxbetdg5owWB2mpgUL6e2nfw2eObZ0u0qvak=
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
github.com/kisielk/sqlstruct v0.0.0-20201105191214-5f3e10d3ab46/go.mod h1:yyMNCyc/Ib3bDTKd379tNMpB/7/H5TjM2Y9QJ5THLbE=
github.com/klauspost/cpuid/v2 v2.0.4/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg=
@@ -302,8 +245,6 @@ github.com/knz/go-libedit v1.10.1/go.mod h1:MZTVkCWyz0oBc7JOWP3wNAzd002ZbM/5hgSh
github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc=
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk=
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
@@ -314,6 +255,8 @@ github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0
github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw=
github.com/leodido/go-urn v1.4.0 h1:WT9HwE9SGECu3lg4d/dIA+jxlljEa1/ffXKmRjqdmIQ=
github.com/leodido/go-urn v1.4.0/go.mod h1:bvxc+MVxLKB4z00jd1z+Dvzr47oO32F/QSNjSBOlFxI=
github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY=
github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0=
github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY=
github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
github.com/mattn/go-sqlite3 v1.14.22 h1:2gZY6PC6kBnID23Tichd1K+Z0oS6nE/XwU+Vz/5o4kU=
@@ -323,6 +266,8 @@ github.com/minio/sha256-simd v1.0.0 h1:v1ta+49hkWZyvaKwrQB8elexRqm6Y0aMLjCNsrYxo
github.com/minio/sha256-simd v1.0.0/go.mod h1:OuYzVNI5vcoYIAmbIvHPl3N3jUzVedXbKy5RFepssQM=
github.com/mitchellh/go-wordwrap v0.0.0-20150314170334-ad45545899c7 h1:DpOJ2HYzCv8LZP15IdmG+YdwD2luVPHITV96TkirNBM=
github.com/mitchellh/go-wordwrap v0.0.0-20150314170334-ad45545899c7/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUbP2oI0UX1GXzOo=
github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY=
github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg=
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
@@ -333,7 +278,6 @@ github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjY
github.com/mr-tron/base58 v1.2.0 h1:T/HDJBh4ZCPbU39/+c3rRvE0uKBQlU27+QI8LJ4t64o=
github.com/mr-tron/base58 v1.2.0/go.mod h1:BinMc/sQntlIE1frQmRFPUoPA1Zkr8VRgBdjWI2mNwc=
github.com/mschoch/smat v0.0.0-20160514031455-90eadee771ae/go.mod h1:qAyveg+e4CE+eKJXWVjKXM4ck2QobLqTDytGJbLLhJg=
github.com/mschoch/smat v0.2.0 h1:8imxQsjDm8yFEAVBe7azKmKSgzSkZXDuKkSq9374khM=
github.com/mschoch/smat v0.2.0/go.mod h1:kc9mz7DoBKqDyiRL7VZN8KvXQMWeTaVnttLRXOlotKw=
github.com/multiformats/go-multihash v0.2.3 h1:7Lyc8XfX/IY2jWb/gI7JP+o7JEq9hOa7BFvVU9RSh+U=
github.com/multiformats/go-multihash v0.2.3/go.mod h1:dXgKXCXjBzdscBLk9JkjINiEsCKRVch90MdaGiKsvSM=
@@ -342,55 +286,20 @@ github.com/multiformats/go-varint v0.0.6/go.mod h1:3Ls8CIEsrijN6+B7PbrXRPxHRPuXS
github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
github.com/natefinch/lumberjack v2.0.0+incompatible h1:4QJd3OLAMgj7ph+yZTuX13Ld4UpgHp07nNdFX7mqFfM=
github.com/natefinch/lumberjack v2.0.0+incompatible/go.mod h1:Wi9p2TTF5DG5oU+6YfsmYQpsTIOm0B1VNzQg9Mw6nPk=
github.com/ncruces/go-sqlite3 v0.28.0 h1:AQVTUPgfamONl09LS+4rGFbHmLKM8/QrJJJi1UukjEQ=
github.com/ncruces/go-sqlite3 v0.28.0/go.mod h1:WqvLhYwtEiZzg1H8BIeahUv/DxbmR+3xG5jDHDiBAGk=
github.com/ncruces/go-sqlite3 v0.18.4 h1:Je8o3y33MDwPYY/Cacas8yCsuoUzpNY/AgoSlN2ekyE=
github.com/ncruces/go-sqlite3 v0.18.4/go.mod h1:4HLag13gq1k10s4dfGBhMfRVsssJRT9/5hYqVM9RUYo=
github.com/ncruces/julianday v1.0.0 h1:fH0OKwa7NWvniGQtxdJRxAgkBMolni2BjDHaWTxqt7M=
github.com/ncruces/julianday v1.0.0/go.mod h1:Dusn2KvZrrovOMJuOt0TNXL6tB7U2E8kvza5fFc9G7g=
github.com/nikoksr/notify v1.3.0 h1:UxzfxzAYGQD9a5JYLBTVx0lFMxeHCke3rPCkfWdPgLs=
github.com/nikoksr/notify v1.3.0/go.mod h1:Xor2hMmkvrCfkCKvXGbcrESez4brac2zQjhd6U2BbeM=
github.com/nikoksr/notify v1.0.0 h1:qe9/6FRsWdxBgQgWcpvQ0sv8LRGJZDpRB4TkL2uNdO8=
github.com/nikoksr/notify v1.0.0/go.mod h1:hPaaDt30d6LAA7/5nb0e48Bp/MctDfycCSs8VEgN29I=
github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=
github.com/openai/openai-go v1.12.0 h1:NBQCnXzqOTv5wsgNC36PrFEiskGfO5wccfCWDo9S1U0=
github.com/openai/openai-go v1.12.0/go.mod h1:g461MYGXEXBVdV5SaR/5tNzNbSfwTBBefwc+LlDCK0Y=
github.com/openzipkin/zipkin-go v0.1.6/go.mod h1:QgAqvLzwWbR/WpD4A3cGpPtJrZXNIiJc5AZX7/PBEpw=
github.com/pelletier/go-toml/v2 v2.2.3 h1:YmeHyLY8mFWbdkNWwpr+qIL2bEqT0o95WSdkNHvL12M=
github.com/pelletier/go-toml/v2 v2.2.3/go.mod h1:MfCQTFTvCcUyyvvwm1+G6H/jORL20Xlb6rzQu9GuUkc=
github.com/pelletier/go-toml/v2 v2.2.2 h1:aYUidT7k73Pcl9nb2gScu7NSrKCSHIDE89b3+6Wq+LM=
github.com/pelletier/go-toml/v2 v2.2.2/go.mod h1:1t835xjRzz80PqgE6HHgN2JOsmgYu/h4qDAS4n929Rs=
github.com/philhofer/fwd v1.0.0/go.mod h1:gk3iGcWd9+svBvR0sR+KPcfE+RNWozjowpeBVG3ZVNU=
github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY=
github.com/pion/datachannel v1.5.9 h1:LpIWAOYPyDrXtU+BW7X0Yt/vGtYxtXQ8ql7dFfYUVZA=
github.com/pion/datachannel v1.5.9/go.mod h1:kDUuk4CU4Uxp82NH4LQZbISULkX/HtzKa4P7ldf9izE=
github.com/pion/dtls/v3 v3.0.3 h1:j5ajZbQwff7Z8k3pE3S+rQ4STvKvXUdKsi/07ka+OWM=
github.com/pion/dtls/v3 v3.0.3/go.mod h1:weOTUyIV4z0bQaVzKe8kpaP17+us3yAuiQsEAG1STMU=
github.com/pion/ice/v4 v4.0.2 h1:1JhBRX8iQLi0+TfcavTjPjI6GO41MFn4CeTBX+Y9h5s=
github.com/pion/ice/v4 v4.0.2/go.mod h1:DCdqyzgtsDNYN6/3U8044j3U7qsJ9KFJC92VnOWHvXg=
github.com/pion/interceptor v0.1.39 h1:Y6k0bN9Y3Lg/Wb21JBWp480tohtns8ybJ037AGr9UuA=
github.com/pion/interceptor v0.1.39/go.mod h1:Z6kqH7M/FYirg3frjGJ21VLSRJGBXB/KqaTIrdqnOic=
github.com/pion/logging v0.2.3 h1:gHuf0zpoh1GW67Nr6Gj4cv5Z9ZscU7g/EaoC/Ke/igI=
github.com/pion/logging v0.2.3/go.mod h1:z8YfknkquMe1csOrxK5kc+5/ZPAzMxbKLX5aXpbpC90=
github.com/pion/mdns/v2 v2.0.7 h1:c9kM8ewCgjslaAmicYMFQIde2H9/lrZpjBkN8VwoVtM=
github.com/pion/mdns/v2 v2.0.7/go.mod h1:vAdSYNAT0Jy3Ru0zl2YiW3Rm/fJCwIeM0nToenfOJKA=
github.com/pion/randutil v0.1.0 h1:CFG1UdESneORglEsnimhUjf33Rwjubwj6xfiOXBa3mA=
github.com/pion/randutil v0.1.0/go.mod h1:XcJrSMMbbMRhASFVOlj/5hQial/Y8oH/HVo7TBZq+j8=
github.com/pion/rtcp v1.2.15 h1:LZQi2JbdipLOj4eBjK4wlVoQWfrZbh3Q6eHtWtJBZBo=
github.com/pion/rtcp v1.2.15/go.mod h1:jlGuAjHMEXwMUHK78RgX0UmEJFV4zUKOFHR7OP+D3D0=
github.com/pion/rtp v1.8.18 h1:yEAb4+4a8nkPCecWzQB6V/uEU18X1lQCGAQCjP+pyvU=
github.com/pion/rtp v1.8.18/go.mod h1:bAu2UFKScgzyFqvUKmbvzSdPr+NGbZtv6UB2hesqXBk=
github.com/pion/sctp v1.8.33 h1:dSE4wX6uTJBcNm8+YlMg7lw1wqyKHggsP5uKbdj+NZw=
github.com/pion/sctp v1.8.33/go.mod h1:beTnqSzewI53KWoG3nqB282oDMGrhNxBdb+JZnkCwRM=
github.com/pion/sdp/v3 v3.0.9 h1:pX++dCHoHUwq43kuwf3PyJfHlwIj4hXA7Vrifiq0IJY=
github.com/pion/sdp/v3 v3.0.9/go.mod h1:B5xmvENq5IXJimIO4zfp6LAe1fD9N+kFv+V/1lOdz8M=
github.com/pion/srtp/v3 v3.0.4 h1:2Z6vDVxzrX3UHEgrUyIGM4rRouoC7v+NiF1IHtp9B5M=
github.com/pion/srtp/v3 v3.0.4/go.mod h1:1Jx3FwDoxpRaTh1oRV8A/6G1BnFL+QI82eK4ms8EEJQ=
github.com/pion/stun/v3 v3.0.0 h1:4h1gwhWLWuZWOJIJR9s2ferRO+W3zA/b6ijOI6mKzUw=
github.com/pion/stun/v3 v3.0.0/go.mod h1:HvCN8txt8mwi4FBvS3EmDghW6aQJ24T+y+1TKjB5jyU=
github.com/pion/transport/v3 v3.0.7 h1:iRbMH05BzSNwhILHoBoAPxoB9xQgOaJk+591KC9P1o0=
github.com/pion/transport/v3 v3.0.7/go.mod h1:YleKiTZ4vqNxVwh77Z0zytYi7rXHl7j6uPLGhhz9rwo=
github.com/pion/turn/v4 v4.0.0 h1:qxplo3Rxa9Yg1xXDxxH8xaqcyGUtbHYw4QSCvmFWvhM=
github.com/pion/turn/v4 v4.0.0/go.mod h1:MuPDkm15nYSklKpN8vWJ9W2M0PlyQZqYt1McGuxG7mA=
github.com/pion/webrtc/v4 v4.0.0 h1:x8ec7uJQPP3D1iI8ojPAiTOylPI7Fa7QgqZrhpLyqZ8=
github.com/pion/webrtc/v4 v4.0.0/go.mod h1:SfNn8CcFxR6OUVjLXVslAQ3a3994JhyE3Hw1jAuqEto=
github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA=
github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
@@ -405,6 +314,7 @@ github.com/prometheus/client_golang v1.5.1/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3O
github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo=
github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo=
github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
github.com/prometheus/common v0.2.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4=
github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4=
@@ -414,27 +324,16 @@ github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R
github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA=
github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A=
github.com/prometheus/procfs v0.0.11/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU=
github.com/protolambda/ctxlock v0.1.0 h1:rCUY3+vRdcdZXqT07iXgyr744J2DU2LCBIXowYAjBCE=
github.com/protolambda/ctxlock v0.1.0/go.mod h1:vefhX6rIZH8rsg5ZpOJfEDYQOppZi19SfPiGOFrNnwM=
github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4=
github.com/remyoudompheng/bigfft v0.0.0-20200410134404-eec4a21b6bb0/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo=
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec h1:W09IVJc94icq4NjY3clb7Lk8O1qJ8BdBEF8z0ibU0rE=
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo=
github.com/robfig/cron v1.2.0 h1:ZjScXvvxeQ63Dbyxy76Fj3AT3Ut0aKsyd2/tl3DTMuQ=
github.com/robfig/cron v1.2.0/go.mod h1:JGuDeoQd7Z6yL4zQhZ3OPEVHB7fL6Ka6skscFHfmt2k=
github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc=
github.com/rogpeppe/go-internal v1.8.0/go.mod h1:WmiCO8CzOY8rg0OYDC4/i/2WRWAB6poM+XZ2dLUbcbE=
github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8=
github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs=
github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M=
github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA=
github.com/rs/dnscache v0.0.0-20211102005908-e0241e321417 h1:Lt9DzQALzHoDwMBGJ6v8ObDPR0dzr2a6sXTB1Fq7IHs=
github.com/rs/dnscache v0.0.0-20211102005908-e0241e321417/go.mod h1:qe5TWALJ8/a1Lqznoc5BDHpYX/8HU60Hm2AwRmqzxqA=
github.com/ryszard/goskiplist v0.0.0-20150312221310-2dfbae5fcf46 h1:GHRpF1pTW19a8tTFrMLUcfWwyC0pnifVo2ClaLq+hP8=
github.com/ryszard/goskiplist v0.0.0-20150312221310-2dfbae5fcf46/go.mod h1:uAQ5PCi+MFsC7HjREoAz1BU+Mq60+05gifQSsHSDG/8=
github.com/sagikazarmark/locafero v0.7.0 h1:5MqpDsTGNDhY8sGp0Aowyf0qKsPrhewaLSsFaodPcyo=
github.com/sagikazarmark/locafero v0.7.0/go.mod h1:2za3Cg5rMaTMoG/2Ulr9AwtFaIppKXTRYnozin4aB5k=
github.com/saintfish/chardet v0.0.0-20230101081208-5e3ef4b5456d h1:hrujxIzL1woJ7AwssoOcM/tq5JjjG2yYOc8odClEiXA=
github.com/saintfish/chardet v0.0.0-20230101081208-5e3ef4b5456d/go.mod h1:uugorj2VCxiV1x+LzaIdVa9b4S4qGAcH6cbhh4qVxOU=
github.com/sagikazarmark/locafero v0.4.0 h1:HApY1R9zGo4DBgr7dqsTH/JJxLTTsOt7u6keLGt6kNQ=
github.com/sagikazarmark/locafero v0.4.0/go.mod h1:Pe1W6UlPYUk/+wc/6KFhbORCfqzgYEpgQ3O5fPuL3H4=
github.com/sagikazarmark/slog-shim v0.1.0 h1:diDBnUNK9N/354PgrxMywXnAwEr1QZcOr6gto+ugjYE=
github.com/sagikazarmark/slog-shim v0.1.0/go.mod h1:SrcSrq8aKtyuqEI1uvTDTK1arOWRIczQRv+GVI1AkeQ=
github.com/sergi/go-diff v1.0.0 h1:Kpca3qRNrduNnOQeazBd0ysaKrUJiIuISHxogkT9RPQ=
github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo=
github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo=
@@ -445,17 +344,16 @@ github.com/smartystreets/goconvey v0.0.0-20181108003508-044398e4856c/go.mod h1:X
github.com/smartystreets/goconvey v0.0.0-20190306220146-200a235640ff/go.mod h1:KSQcGKpxUMHk3nbYzs/tIBAM2iDooCn0BmttHOJEbLs=
github.com/sourcegraph/conc v0.3.0 h1:OQTbbt6P72L20UqAkXXuLOj79LfEanQ+YQFNpLA9ySo=
github.com/sourcegraph/conc v0.3.0/go.mod h1:Sdozi7LEKbFPqYX2/J+iBAM6HpqSLTASQIKqDmF7Mt0=
github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA=
github.com/spaolacci/murmur3 v1.1.0 h1:7c1g84S4BPRrfL5Xrdp6fOJ206sU9y293DDHaoy0bLI=
github.com/spaolacci/murmur3 v1.1.0/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA=
github.com/spf13/afero v1.12.0 h1:UcOPyRBYczmFn6yvphxkn9ZEOY65cpwGKb5mL36mrqs=
github.com/spf13/afero v1.12.0/go.mod h1:ZTlWwG4/ahT8W7T0WQ5uYmjI9duaLQGy3Q2OAl4sk/4=
github.com/spf13/cast v1.7.1 h1:cuNEagBQEHWN1FnbGEjCXL2szYEXqfJPbP2HNUaca9Y=
github.com/spf13/cast v1.7.1/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cAdo=
github.com/spf13/pflag v1.0.6 h1:jFzHGLGAlb3ruxLB8MhbI6A8+AQX/2eW4qeyNZXNp2o=
github.com/spf13/pflag v1.0.6/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
github.com/spf13/viper v1.20.1 h1:ZMi+z/lvLyPSCoNtFCpqjy0S4kPbirhpTMwl8BkW9X4=
github.com/spf13/viper v1.20.1/go.mod h1:P9Mdzt1zoHIG8m2eZQinpiBjo6kCmZSKBClNNqjJvu4=
github.com/spf13/afero v1.11.0 h1:WJQKhtpdm3v2IzqG8VMqrr6Rf3UYpEF239Jy9wNepM8=
github.com/spf13/afero v1.11.0/go.mod h1:GH9Y3pIexgf1MTIWtNGyogA5MwRIDXGUr+hbWNoBjkY=
github.com/spf13/cast v1.6.0 h1:GEiTHELF+vaR5dhz3VqZfFSzZjYbgeKDpBxQVS4GYJ0=
github.com/spf13/cast v1.6.0/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cAdo=
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
github.com/spf13/viper v1.19.0 h1:RWq5SEjt8o25SROyN3z2OrDB9l7RPd3lwTWU8EcEdcI=
github.com/spf13/viper v1.19.0/go.mod h1:GQUN9bilAbhU/jgc1bKs99f/suXKeUMct8Adx5+Ntkg=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
@@ -471,29 +369,14 @@ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8=
github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU=
github.com/technoweenie/multipartstreamer v1.0.1 h1:XRztA5MXiR1TIRHxH2uNxXxaIkKQDeX7m2XsSOlQEnM=
github.com/technoweenie/multipartstreamer v1.0.1/go.mod h1:jNVxdtShOxzAsukZwTSw6MDx5eUJoiEBsSvzDU9uzog=
github.com/temoto/robotstxt v1.1.2 h1:W2pOjSJ6SWvldyEuiFXNxz3xZ8aiWX5LbfDiOFd7Fxg=
github.com/temoto/robotstxt v1.1.2/go.mod h1:+1AmkuG3IYkh1kv0d2qEB9Le88ehNO0zwOr3ujewlOo=
github.com/tetratelabs/wazero v1.9.0 h1:IcZ56OuxrtaEz8UYNRHBrUa9bYeX9oVY93KspZZBf/I=
github.com/tetratelabs/wazero v1.9.0/go.mod h1:TSbcXCfFP0L2FGkRPxHphadXPjo1T6W+CseNNY7EkjM=
github.com/tidwall/btree v1.6.0 h1:LDZfKfQIBHGHWSwckhXI0RPSXzlo+KYdjK7FWSqOzzg=
github.com/tidwall/btree v1.6.0/go.mod h1:twD9XRA5jj9VUQGELzDO4HPQTNJsoWWfYEL+EUQ2cKY=
github.com/tidwall/gjson v1.14.2/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk=
github.com/tidwall/gjson v1.18.0 h1:FIDeeyB800efLX89e5a8Y0BNH+LOngJyGrIWxG2FKQY=
github.com/tidwall/gjson v1.18.0/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk=
github.com/tidwall/match v1.1.1 h1:+Ho715JplO36QYgwN9PGYNhgZvoUSc9X2c80KVTi+GA=
github.com/tidwall/match v1.1.1/go.mod h1:eRSPERbgtNPcGhD8UCthc6PmLEQXEWd3PRB5JTxsfmM=
github.com/tidwall/pretty v1.2.0/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU=
github.com/tidwall/pretty v1.2.1 h1:qjsOFOWWQl+N3RsoF5/ssm1pHmJJwhjlSbZ51I6wMl4=
github.com/tidwall/pretty v1.2.1/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU=
github.com/tidwall/sjson v1.2.5 h1:kLy8mja+1c9jlljvWTlSazM7cKDRfJuR/bOJhcY5NcY=
github.com/tidwall/sjson v1.2.5/go.mod h1:Fvgq9kS/6ociJEDnK0Fk1cpYF4FIW6ZF7LAe+6jwd28=
github.com/tetratelabs/wazero v1.8.0 h1:iEKu0d4c2Pd+QSRieYbnQC9yiFlMS9D+Jr0LsRmcF4g=
github.com/tetratelabs/wazero v1.8.0/go.mod h1:yAI0XTsMBhREkM/YDAK/zNou3GoiAce1P6+rp/wQhjs=
github.com/tinylib/msgp v1.0.2/go.mod h1:+d+yLhGm8mzTaHzB+wgMYrodPfmZrzkirds8fDWklFE=
github.com/tinylib/msgp v1.1.0/go.mod h1:+d+yLhGm8mzTaHzB+wgMYrodPfmZrzkirds8fDWklFE=
github.com/tinylib/msgp v1.1.2/go.mod h1:+d+yLhGm8mzTaHzB+wgMYrodPfmZrzkirds8fDWklFE=
@@ -501,27 +384,28 @@ github.com/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS
github.com/twitchyliquid64/golang-asm v0.15.1/go.mod h1:a1lVb/DtPvCB8fslRZhAngC2+aY1QWCk3Cedj/Gdt08=
github.com/ugorji/go/codec v1.2.12 h1:9LC83zGrHhuUA9l16C9AHXAqEV/2wBQ4nkvumAE65EE=
github.com/ugorji/go/codec v1.2.12/go.mod h1:UNopzCgEMSXjBc6AOMqYvWC1ktqTAfzJZUZgYf6w6lg=
github.com/vmihailenco/msgpack/v4 v4.3.12/go.mod h1:gborTTJjAo/GWTqqRjrLCn9pgNN+NXzzngzBKDPIqw4=
github.com/vmihailenco/tagparser v0.1.1/go.mod h1:OeAg3pn3UbLjkWt+rN9oFYB6u/cQgqMEUPoW2WPyhdI=
github.com/willf/bitset v1.1.9/go.mod h1:RjeCKbqT1RxIR/KWY6phxZiaY1IyutSBfGjNPySAYV4=
github.com/willf/bitset v1.1.10/go.mod h1:RjeCKbqT1RxIR/KWY6phxZiaY1IyutSBfGjNPySAYV4=
github.com/wlynxg/anet v0.0.5 h1:J3VJGi1gvo0JwZ/P1/Yc/8p63SoW98B5dHkYDmpgvvU=
github.com/wlynxg/anet v0.0.5/go.mod h1:eay5PRQr7fIVAMbTbchTnO9gG65Hg/uYGdc7mguHxoA=
github.com/yuin/goldmark v1.4.1/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k=
github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
github.com/zclconf/go-cty v1.14.4 h1:uXXczd9QDGsgu0i/QFR/hzI5NYCHLf6NQw/atrbnhq8=
github.com/zclconf/go-cty v1.14.4/go.mod h1:VvMs5i0vgZdhYawQNq5kePSpLAoz8u1xvZgrPIxfnZE=
github.com/zclconf/go-cty-yaml v1.1.0 h1:nP+jp0qPHv2IhUVqmQSzjvqAWcObN0KBkUl2rWBdig0=
github.com/zclconf/go-cty-yaml v1.1.0/go.mod h1:9YLUH4g7lOhVWqUbctnVlZ5KLpg7JAprQNgxSZ1Gyxs=
go.etcd.io/bbolt v1.3.6 h1:/ecaJf0sk1l4l6V4awd65v2C3ILy7MSj+s/x1ADCIMU=
go.etcd.io/bbolt v1.3.6/go.mod h1:qXsaaIqmgQH0T+OPdb99Bf+PKfBBQVAdyD6TY9G8XM4=
github.com/zclconf/go-cty v1.8.0 h1:s4AvqaeQzJIu3ndv4gVIhplVD0krU+bgrcLSVUnaWuA=
github.com/zclconf/go-cty v1.8.0/go.mod h1:vVKLxnk3puL4qRAv72AO+W99LUD4da90g3uUAzyuvAk=
go.opencensus.io v0.20.1/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk=
go.opencensus.io v0.20.2/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk=
go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
go.opentelemetry.io/otel v1.32.0 h1:WnBN+Xjcteh0zdk01SVqV55d/m62NJLJdIyb4y/WO5U=
go.opentelemetry.io/otel v1.32.0/go.mod h1:00DCVSB0RQcnzlwyTfqtxSm+DRr9hpYrHjNGiBHVQIg=
go.opentelemetry.io/otel/metric v1.32.0 h1:xV2umtmNcThh2/a/aCP+h64Xx5wsj8qqnkYZktzNa0M=
go.opentelemetry.io/otel/metric v1.32.0/go.mod h1:jH7CIbbK6SH2V2wE16W05BHCtIDzauciCRLoc/SyMv8=
go.opentelemetry.io/otel/trace v1.32.0 h1:WIC9mYrXf8TmY/EXuULKc8hR17vE+Hjv2cssQDe03fM=
go.opentelemetry.io/otel/trace v1.32.0/go.mod h1:+i4rkvCraA+tG6AzwloGaCtkx53Fa+L+V8e9a7YvhT8=
go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0=
go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo=
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.53.0 h1:9G6E0TXzGFVfTnawRzrPl83iHOAV7L8NJiR8RSGYV1g=
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.53.0/go.mod h1:azvtTADFQJA8mX80jIH/akaE7h+dbm/sVuaHqN13w74=
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.53.0 h1:4K4tsIXefpVJtvA/8srF4V4y0akAoPHkIslgAkjixJA=
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.53.0/go.mod h1:jjdQuTGVsXV4vSs+CJ2qYDeDPf9yIJV23qlIzBm73Vg=
go.opentelemetry.io/otel v1.28.0 h1:/SqNcYk+idO0CxKEUOtKQClMK/MimZihKYMruSMViUo=
go.opentelemetry.io/otel v1.28.0/go.mod h1:q68ijF8Fc8CnMHKyzqL6akLO46ePnjkgfIMIjUIX9z4=
go.opentelemetry.io/otel/metric v1.28.0 h1:f0HGvSl1KRAU1DLgLGFjrwVyismPlnuU6JD6bOeuA5Q=
go.opentelemetry.io/otel/metric v1.28.0/go.mod h1:Fb1eVBFZmLVTMb6PPohq3TO9IIhUisDsbJoL/+uQW4s=
go.opentelemetry.io/otel/trace v1.28.0 h1:GhQ9cUuQGmNDd5BTCP2dAvv75RdMxEfTmYejp+lkx9g=
go.opentelemetry.io/otel/trace v1.28.0/go.mod h1:jPyXzNPg6da9+38HEwElrQiHlVMTnVfM3/yv2OlIHaI=
go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0=
@@ -533,32 +417,21 @@ golang.org/x/arch v0.8.0 h1:3wRIsP3pM4yUptoR96otTUOXI367OS0+c9eeRi9doIc=
golang.org/x/arch v0.8.0/go.mod h1:FEVrYAQjsQXMVJ1nsMoVVXPZg6p2JE2mx8psSWTDQys=
golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
golang.org/x/crypto v0.13.0/go.mod h1:y6Z2r+Rw4iayiXXAIxJIDAJ1zMW4yaTpebo8fPOliYc=
golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4=
golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU=
golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8=
golang.org/x/crypto v0.31.0 h1:ihbySMvVjLAeSH1IbfcRTkD/iNscyz8rGzjF/E5hV6U=
golang.org/x/crypto v0.31.0/go.mod h1:kDsLvtWBEx7MV9tJOj9bnXsPbxwJQ6csT/x4KIN4Ssk=
golang.org/x/crypto v0.41.0 h1:WKYxWedPGCTVVl5+WHSSrOBT0O8lx32+zxmHxijgXp4=
golang.org/x/crypto v0.41.0/go.mod h1:pO5AFd7FA68rFak7rOAGVuygIISepHftHnr8dr6+sUc=
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20220428152302-39d4317da171/go.mod h1:lgLbSvA5ygNOMpwM/9anMpWVlVJ7Z+cHWq/eFuinpGE=
golang.org/x/exp v0.0.0-20241215155358-4a5509556b9e h1:4qufH0hlUYs6AO6XmZC3GqfDPGSXHVXUFR6OND+iJX4=
golang.org/x/exp v0.0.0-20241215155358-4a5509556b9e/go.mod h1:qj5a5QZpwLU2NLQudwIN5koi3beDhSAlJwa67PuM98c=
golang.org/x/exp v0.0.0-20240823005443-9b4947da3948 h1:kx6Ds3MlpiUHKj7syVnbp57++8WpuKPcR5yjLBjvLEA=
golang.org/x/exp v0.0.0-20240823005443-9b4947da3948/go.mod h1:akd2r19cwCdwSwWeIdzYQGa/EZZyqcOdwWiwj5L5eKQ=
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU=
golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
golang.org/x/mod v0.5.1/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro=
golang.org/x/mod v0.6.0-dev.0.20211013180041-c96bc1413d57/go.mod h1:3p9vT2HGsQu2K1YbXdKPJLVgG5VJdoTa1poYQBtP1AY=
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
golang.org/x/mod v0.15.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
golang.org/x/mod v0.26.0 h1:EGMPT//Ezu+ylkCijjPc+f4Aih7sZvaAr+O3EHBxvZg=
golang.org/x/mod v0.26.0/go.mod h1:/j6NAhSk8iQ723BGAUyoAcn7SlD7s15Dp9Nd/SfeaFQ=
golang.org/x/mod v0.20.0 h1:utOm6MM3R3dnawAiJgn0y+xvuYRsm1RKM/4giyfDgV0=
golang.org/x/mod v0.20.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
@@ -568,37 +441,31 @@ golang.org/x/net v0.0.0-20190125091013-d26f9f9a57f3/go.mod h1:mL1N/T3taQHkDXs73r
golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks=
golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg=
golang.org/x/net v0.15.0/go.mod h1:idbUs1IY1+zTqbi8yxTbhexhEEk5ur9LInksu6HrEpk=
golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE=
golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44=
golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM=
golang.org/x/net v0.9.0/go.mod h1:d48xBJpPfHeWQsugry2m+kC02ZBRGRgulfHnEXEuWns=
golang.org/x/net v0.33.0 h1:74SYHlV8BIgHIFC/LrYkOGIwL19eTYXQ5wc6TBuO36I=
golang.org/x/net v0.33.0/go.mod h1:HXLR5J+9DxmrqMwG9qjGCxZ+zKXxBru04zlTvWlWuN4=
golang.org/x/net v0.42.0 h1:jzkYrhi3YQWD6MLBJcsklgQsoAcw89EcZbJw8Z614hs=
golang.org/x/net v0.42.0/go.mod h1:FF1RA5d3u7nAYA4z2TkclSCKh68eSXtiFwcWQpPXdt8=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
golang.org/x/oauth2 v0.21.0 h1:tsimM75w1tF/uws5rbeHzIWxEqElMehnc+iW793zsZs=
golang.org/x/oauth2 v0.21.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI=
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y=
golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
golang.org/x/sync v0.10.0 h1:3NQrjDixjgGwUOCaF8w2+VYHv0Ve/vGYSbdkTa98gmQ=
golang.org/x/sync v0.10.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
golang.org/x/sync v0.16.0 h1:ycBJEhp9p4vXvUZNszeOq0kGTPghopOL8q0fq3vstxw=
golang.org/x/sync v0.16.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA=
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
@@ -611,95 +478,90 @@ golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7w
golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200413165638-669c56c373c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200923182605-d9f96fdee20d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA=
golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.35.0 h1:vz1N37gP5bs89s7He8XuIYXpyY0+QlsKmzipCbUtyxI=
golang.org/x/sys v0.35.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
golang.org/x/telemetry v0.0.0-20240228155512-f48c80bd79b2/go.mod h1:TeRTkGYfJXctD9OcfyVLyj2J3IxLnKwHJR8f4D8a3YE=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k=
golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo=
golang.org/x/term v0.12.0/go.mod h1:owVbMEjm3cBLCHdkQu9b1opXd4ETQWc3BhuQGKgXgvU=
golang.org/x/term v0.13.0/go.mod h1:LTmsnFJwVN6bCy1rVCoS+qHT1HhALEFxKncY3WNNh4U=
golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk=
golang.org/x/term v0.20.0/go.mod h1:8UkIAJTvZgivsXaD6/pH6U9ecQzZ45awqEOzuCvwpFY=
golang.org/x/term v0.27.0/go.mod h1:iMsnZpn0cago0GOrHO2+Y7u7JPn5AylBrcoWkElMTSM=
golang.org/x/term v0.7.0/go.mod h1:P32HKFT3hSsZrRxla30E9HqToFYAQPCMs/zFMBUFqPY=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ=
golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo=
golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ=
golang.org/x/text v0.28.0 h1:rhazDwis8INMIwQ4tpjLDzUhx6RlXqZNPEM0huQojng=
golang.org/x/text v0.28.0/go.mod h1:U8nCwOR8jO/marOQ0QbDiOngZVEBB7MAiitBuMjXiNU=
golang.org/x/time v0.8.0 h1:9i3RxcPv3PZnitoVGMPDKZSq1xW1gK1Xy3ArNOGZfEg=
golang.org/x/time v0.8.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM=
golang.org/x/time v0.5.0 h1:o7cqy6amK/52YcAKIPlM3a+Fpj35zvRj2TP+e1xFSfk=
golang.org/x/time v0.5.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM=
golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY=
golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.1.8-0.20211029000441-d6a9af8af023/go.mod h1:nABZi5QlRsZVlzPpHl034qft6wpY4eDcsTt5AaioBiU=
golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=
golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU=
golang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58=
golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golift.io/starr v1.1.0 h1:KTAecOEne/zKQvrh8mcfEA7YlQ39FnvjZRIhJSIvxL4=
golift.io/starr v1.1.0/go.mod h1:WnLkyfF7X2q676mXriGMZQrBA3wGt1BjA2qdxMmA/wg=
golift.io/starr v1.0.0 h1:IDSaSL+ZYxdLT/Lg//dg/iwZ39LHO3D5CmbLCOgSXbI=
golift.io/starr v1.0.0/go.mod h1:xnUwp4vK62bDvozW9QHUYc08m6kjwaZnGw3Db65fQHw=
google.golang.org/api v0.3.1/go.mod h1:6wY9I6uQWHQ8EM57III9mq/AjF+i8G65rmVagqKMtkk=
google.golang.org/api v0.188.0 h1:51y8fJ/b1AaaBRJr4yWm96fPcuxSo0JcegXE3DaHQHw=
google.golang.org/api v0.188.0/go.mod h1:VR0d+2SIiWOYG3r/jdm7adPW9hI2aRv9ETOSCQ9Beag=
google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
google.golang.org/appengine v1.6.8 h1:IhEN5q69dyKagZPYMSdIjS2HqprW324FRQZJcGqPAsM=
google.golang.org/appengine v1.6.8/go.mod h1:1jJ3jBArFh5pcgW8gCtRJnepW8FzD1V44FJffLiz/Ds=
google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc=
google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc=
google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo=
google.golang.org/genproto v0.0.0-20240711142825-46eb208f015d h1:/hmn0Ku5kWij/kjGsrcJeC1T/MrJi2iNWwgAqrihFwc=
google.golang.org/genproto/googleapis/api v0.0.0-20240711142825-46eb208f015d h1:kHjw/5UfflP/L5EbledDrcG4C2597RtymmGRZvHiCuY=
google.golang.org/genproto/googleapis/api v0.0.0-20240711142825-46eb208f015d/go.mod h1:mw8MG/Qz5wfgYr6VqVCiZcHe/GJEfI+oGGDCohaVgB0=
google.golang.org/genproto/googleapis/rpc v0.0.0-20240711142825-46eb208f015d h1:JU0iKnSg02Gmb5ZdV8nYsKEKsP6o/FGVWTrw4i1DA9A=
google.golang.org/genproto/googleapis/rpc v0.0.0-20240711142825-46eb208f015d/go.mod h1:Ue6ibwXGpU+dqIcODieyLOcgj7z8+IcskoNIgZxtrFY=
google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs=
google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38=
google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg=
google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY=
google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk=
google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc=
google.golang.org/grpc v1.65.0 h1:bs/cUb4lp1G5iImFFd3u5ixQzweKizoZJAwBNLR42lc=
google.golang.org/grpc v1.65.0/go.mod h1:WgYC2ypjlB0EiQi6wdKixMqukr6lBc0Vo+oOgjrM5ZQ=
google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=
google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0=
google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM=
google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE=
google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo=
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
google.golang.org/protobuf v1.36.5 h1:tPhr+woSbjfYvY6/GPufUoYizxw1cF/yFoxJ2fmpwlM=
google.golang.org/protobuf v1.36.5/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE=
google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c=
google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg=
google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw=
gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI=
gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys=
gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA=
gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k=
gopkg.in/natefinch/lumberjack.v2 v2.2.1 h1:bBRl1b0OH9s/DuPhuXpNl+VtCaJXFZ5/uEFST95x9zc=
gopkg.in/natefinch/lumberjack.v2 v2.2.1/go.mod h1:YD8tP3GAjkrDg1eZH7EGmyESg/lsYskCTPBJVb9jqSc=
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw=
@@ -714,17 +576,8 @@ gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
lukechampine.com/blake3 v1.1.6 h1:H3cROdztr7RCfoaTpGZFQsrqvweFLrqS73j7L7cmR5c=
lukechampine.com/blake3 v1.1.6/go.mod h1:tkKEOtDkNtklkXtLNEOGNq5tcV90tJiA1vAA12R78LA=
modernc.org/libc v1.22.3 h1:D/g6O5ftAfavceqlLOFwaZuA5KYafKwmr30A6iSqoyY=
modernc.org/libc v1.22.3/go.mod h1:MQrloYP209xa2zHome2a8HLiLm6k0UT8CoHpV74tOFw=
modernc.org/mathutil v1.5.0 h1:rV0Ko/6SfM+8G+yKiyI830l3Wuz1zRutdslNoQ0kfiQ=
modernc.org/mathutil v1.5.0/go.mod h1:mZW8CKdRPY1v87qxC/wUdX5O1qDzXMP5TH3wjfpga6E=
modernc.org/memory v1.5.0 h1:N+/8c5rE6EqugZwHii4IFsaJ7MUhoWX07J5tC/iI5Ds=
modernc.org/memory v1.5.0/go.mod h1:PkUhL0Mugw21sHPeskwZW4D6VscE/GQJOnIpCnW6pSU=
modernc.org/sqlite v1.21.1 h1:GyDFqNnESLOhwwDRaHGdp2jKLDzpyT/rNLglX3ZkMSU=
modernc.org/sqlite v1.21.1/go.mod h1:XwQ0wZPIh1iKb5mkvCJ3szzbhk+tykC8ZWqTRTgYRwI=
nullprogram.com/x/optparse v1.0.0/go.mod h1:KdyPE+Igbe0jQUrVfMqDMeJQIJZEuyV7pjYmp6pbG50=
rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4=
zombiezen.com/go/sqlite v0.13.1 h1:qDzxyWWmMtSSEH5qxamqBFmqA2BLSSbtODi3ojaE02o=
zombiezen.com/go/sqlite v0.13.1/go.mod h1:Ht/5Rg3Ae2hoyh1I7gbWtWAl89CNocfqeb/aAMTkJr4=

View File

@@ -3,7 +3,6 @@ package log
import (
"os"
"path/filepath"
"polaris/pkg/utils"
"strings"
"github.com/natefinch/lumberjack"
@@ -14,18 +13,16 @@ import (
var sugar *zap.SugaredLogger
var atom zap.AtomicLevel
func init() {
InitLogger(false)
}
const dataPath = "./data"
func InitLogger(toFile bool) {
func init() {
atom = zap.NewAtomicLevel()
atom.SetLevel(zap.DebugLevel)
w := zapcore.Lock(os.Stdout)
if toFile {
if os.Getenv("GIN_MODE") == "release" {
w = zapcore.AddSync(&lumberjack.Logger{
Filename: filepath.Join(utils.GetUserDataDir(), "logs", "polaris.log"),
Filename: filepath.Join(dataPath, "logs", "polaris.log"),
MaxSize: 50, // megabytes
MaxBackups: 3,
MaxAge: 30, // days

View File

@@ -1,202 +0,0 @@
package buildin
import (
"fmt"
"io/fs"
"net/http"
"os"
"path/filepath"
"polaris/pkg"
"strings"
"github.com/anacrolix/torrent"
"github.com/anacrolix/torrent/metainfo"
"github.com/pkg/errors"
)
func NewDownloader(downloadDir string) (*Downloader, error) {
cfg := torrent.NewDefaultClientConfig()
cfg.DataDir = downloadDir
//cfg.ListenPort = 51243
t, err := torrent.NewClient(cfg)
if err != nil {
return nil, errors.Wrapf(err, "create torrent client")
}
return &Downloader{cl: t, dir: downloadDir}, nil
}
type Downloader struct {
cl *torrent.Client
dir string
}
func (d *Downloader) GetAll() ([]pkg.Torrent, error) {
ts := d.cl.Torrents()
var res []pkg.Torrent
for _, t := range ts {
res = append(res, &Torrent{
t: t,
cl: d.cl,
hash: t.InfoHash().HexString(),
})
}
return res, nil
}
func (d *Downloader) Download(link, hash, dir string) (pkg.Torrent, error) {
if strings.HasPrefix(strings.ToLower(link), "magnet:") {
t, err := d.cl.AddMagnet(link)
if err != nil {
return nil, fmt.Errorf("failed to add magnet: %v", err)
}
<-t.GotInfo()
return &Torrent{
t: t,
cl: d.cl,
hash: hash,
dir: d.dir,
}, nil
}
client := &http.Client{
CheckRedirect: func(req *http.Request, via []*http.Request) error {
return http.ErrUseLastResponse //do not follow redirects
},
}
resp, err := client.Get(link)
if err != nil {
return nil, errors.Wrap(err, "get link")
}
defer resp.Body.Close()
if resp.StatusCode >= 300 && resp.StatusCode < 400 {
//redirects
tourl := resp.Header.Get("Location")
return d.Download(tourl, hash, dir)
}
info, err := metainfo.Load(resp.Body)
if err != nil {
return nil, fmt.Errorf("failed to load metainfo: %v", err)
}
t, err := d.cl.AddTorrent(info)
if err != nil {
return nil, fmt.Errorf("failed to add torrent: %v", err)
}
<-t.GotInfo()
return &Torrent{
t: t,
cl: d.cl,
hash: hash,
dir: d.dir,
}, nil
}
// func NewTorrentFromHash(hash string, downloadDir string) (*Torrent, error) {
// cl, err := NewDownloader(downloadDir)
// if err != nil {
// return nil, errors.Wrap(err, "create downloader")
// }
// ttt := cl.cl.Torrents()
// log.Infof("all torrents: %+v", ttt)
// t, _ := cl.cl.AddTorrentInfoHash(metainfo.NewHashFromHex(hash))
// // if new {
// // return nil, fmt.Errorf("torrent not found")
// // }
// <-t.GotInfo()
// return &Torrent{
// t: t,
// cl: cl.cl,
// hash: hash,
// dir: downloadDir,
// }, nil
// }
type Torrent struct {
t *torrent.Torrent
cl *torrent.Client
hash string
dir string
}
func (t *Torrent) Name() (string, error) {
return t.t.Name(), nil
}
func (t *Torrent) TotalSize() int64 {
var c int64
for _, f := range t.t.Files() {
c += f.FileInfo().Length
}
return c
}
func (t *Torrent) Progress() (int, error) {
if t.t.Complete().Bool() {
return 100, nil
}
p := int(t.t.BytesCompleted() * 100 / t.TotalSize())
if p >= 100 {
p = 99
}
return p, nil
}
func (t *Torrent) Stop() error {
return nil
}
func (t *Torrent) Start() error {
<-t.t.GotInfo()
t.t.DownloadAll()
return nil
}
func (t *Torrent) Remove() error {
files := t.t.Files()
for _, file := range files {
name := file.Path()
if err := os.RemoveAll(filepath.Join(t.dir, name)); err != nil {
return errors.Errorf("remove file (%s) error: %v", file.Path(), err)
}
}
t.t.Drop()
return nil
}
func (t *Torrent) Exists() bool {
tors := t.cl.Torrents()
for _, to := range tors {
if to.InfoHash().HexString() == t.hash {
return true
}
}
return false
}
func (t *Torrent) SeedRatio() (float64, error) {
return 0, nil
}
func (t *Torrent) GetHash() string {
return t.hash
}
func (t *Torrent) WalkFunc() func(fn func(path string, info fs.FileInfo) error) error {
files := t.t.Files()
return func(fn func(path string, info fs.FileInfo) error) error {
for _, file := range files {
name := filepath.Join(t.dir, file.Path())
info, err := os.Stat(name)
if err != nil {
return err
}
if err := fn(name, info); err != nil {
return errors.Errorf("proccess file (%s) error: %v", file.Path(), err)
}
}
return nil
}
}

View File

@@ -1,171 +0,0 @@
package deepseek
import (
"context"
"fmt"
"polaris/log"
"time"
"github.com/goccy/go-json"
"github.com/openai/openai-go"
"github.com/openai/openai-go/option"
)
func NewClient(apiKey string) *Client {
r := openai.NewClient(option.WithAPIKey(apiKey), option.WithBaseURL("https://api.deepseek.com"))
return &Client{openai: &r, model: "deepseek-chat"}
}
type Client struct {
openai *openai.Client
model string
}
func (c *Client) Test() error {
question := `What computer ran the first neural network?
EXAMPLE JSON OUTPUT:
{
"origin": "The origin of the computer",
"full_name": "The name of the device model",
"legacy": "Its influence on the field of computing",
"notable_facts": "A few key facts about the computer
}
`
chat, err_ := c.openai.Chat.Completions.New(context.Background(), openai.ChatCompletionNewParams{
// ...
ResponseFormat: openai.ChatCompletionNewParamsResponseFormatUnion{
OfJSONSchema: &openai.ResponseFormatJSONSchemaParam{
Type: "json_object",
},
},
Messages: []openai.ChatCompletionMessageParamUnion{
openai.UserMessage(question),
},
// only certain models can perform structured outputs
Model: c.model,
})
if err_ != nil {
return err_
}
log.Infof("%+v", chat.Choices[0].Message.Content)
// extract into a well-typed struct
return nil
}
type Movies struct {
Movies []struct {
Name string `json:"name"`
Match string `json:"match"`
} `json:"movies"`
}
type Tvs struct {
Tvs []Tv `json:"tvs"`
}
type Tv struct {
Name string `json:"name"`
FileName string `json:"file_name"`
Match string `json:"match"`
Season string `json:"season"`
StartEpisode string `json:"start_episode"`
EndEpisode string `json:"end_episode"`
Quality string `json:"quality"`
IsSeasonPackage string `json:"is_season_package"`
}
func (c *Client) AssessMovieNames(movieName string, releaseYear int, torrentNames []string) (*Movies, error) {
q := `用户输入的是一些文件名称,你需要判断哪些文件可能属于 %d 年的电影 %s哪些可能不是。
EXAMPLE JSON OUTPUT:
{
"movies": [
{
"name": "The name of the movie",
"match": "true or false"
},
]
}
`
q = fmt.Sprintf(q, releaseYear, movieName)
chat, err_ := c.openai.Chat.Completions.New(context.Background(), openai.ChatCompletionNewParams{
//
ResponseFormat: openai.ChatCompletionNewParamsResponseFormatUnion{
OfJSONSchema: &openai.ResponseFormatJSONSchemaParam{
Type: "json_object",
},
},
Messages: []openai.ChatCompletionMessageParamUnion{
openai.SystemMessage(q),
openai.UserMessage(fmt.Sprintf("文件名称: %v", torrentNames)),
},
// only certain models can perform structured outputs
Model: c.model,
})
if err_ != nil {
return nil, err_
}
log.Infof("%+v", chat.Choices[0].Message.Content)
var res Movies
if err := json.Unmarshal([]byte(chat.Choices[0].Message.Content), &res); err != nil {
return nil, err
}
// extract into a well-typed struct
return &res, nil
}
func (c *Client) AssessTvNames(tvName string, releaseYear int, torrentNames []string) ([]Tv, error) {
log.Debugf("deepseek tv name: %s, year: %d, torrent name len: %v", tvName, releaseYear, len(torrentNames))
t := time.Now()
defer func() {
log.Infof("deepseek assess tv name cost: %v", time.Since(t))
}()
q := `用户输入的是一些文件名称,你需要判断哪些文件可能属于 %d 年的电视剧 %s哪些可能不是并返回匹配的文件名。
EXAMPLE JSON OUTPUT:
{
"tvs": [
"matched file name 1", "matched file name 2", ...
]
}`
q = fmt.Sprintf(q, releaseYear, tvName)
var res []Tv
chat, err_ := c.openai.Chat.Completions.New(context.Background(), openai.ChatCompletionNewParams{
MaxTokens: openai.Opt(int64(4096)),
//...
ResponseFormat: openai.ChatCompletionNewParamsResponseFormatUnion{
OfJSONSchema: &openai.ResponseFormatJSONSchemaParam{
Type: "json_object",
},
},
Messages: []openai.ChatCompletionMessageParamUnion{
openai.SystemMessage(q),
openai.UserMessage(fmt.Sprintf("文件名称: %v", torrentNames)),
},
// only certain models can perform structured outputs
Model: c.model,
})
if err_ != nil {
return nil, err_
}
log.Infof("%+v", chat.Choices[0].Message.Content)
var tvs Tvs
if err := json.Unmarshal([]byte(chat.Choices[0].Message.Content), &tvs); err != nil {
return nil, err
}
res = append(res, tvs.Tvs...)
return res, nil
}

View File

@@ -1,11 +0,0 @@
package deepseek
import "testing"
func TestDeepseek(t *testing.T) {
r := NewClient("sk-")
_, err := r.AssessTvNames("基督山伯爵", 2025, []string{"The Count of Monte Cristo 2024 S01 1080p WEB-DL DD 5.1 H.264-playWEB", "The Count of Monte Cristo 2024 S01E06-08 MULTi 1080p WEB H264-AMB3R"})
if err != nil {
t.Fatal(err)
}
}

View File

@@ -1,7 +1,5 @@
package pkg
import "io/fs"
type Torrent interface {
Name() (string, error)
Progress() (int, error)
@@ -13,10 +11,10 @@ type Torrent interface {
SeedRatio() (float64, error)
GetHash() string
//Reload() error
WalkFunc() func(fn func(path string, info fs.FileInfo) error) error
}
type Downloader interface {
GetAll() ([]Torrent, error)
Download(link, hash, dir string) (Torrent, error)
Download(link, dir string) (Torrent, error)
}

View File

@@ -1,83 +0,0 @@
package eventbus
import (
"fmt"
"polaris/pkg/utils"
"reflect"
)
type EventBus struct {
handlers utils.Map[string, []EventHandler]
}
type EventHandler struct {
callback reflect.Value
async bool
}
func New() *EventBus {
return &EventBus{
handlers: utils.Map[string, []EventHandler]{},
}
}
func (e *EventBus) Subscribe(event string, fn any) error{
if reflect.TypeOf(fn).Kind() != reflect.Func {
return fmt.Errorf("handler must be a function: %v", reflect.TypeOf(fn).Kind())
}
if handlers, ok := e.handlers.Load(event); ok {
handlers = append(handlers, EventHandler{
callback: reflect.ValueOf(fn),})
e.handlers.Store(event, handlers)
} else {
e.handlers.Store(event, []EventHandler{
{callback: reflect.ValueOf(fn)},
})
}
return nil
}
func (e *EventBus) SubscribeAsync(event string, fn any) error{
if reflect.TypeOf(fn).Kind() != reflect.Func {
return fmt.Errorf("handler must be a function: %v", reflect.TypeOf(fn).Kind())
}
if handlers, ok := e.handlers.Load(event); ok {
handlers = append(handlers, EventHandler{
callback: reflect.ValueOf(fn), async: true,
})
e.handlers.Store(event, handlers)
} else {
e.handlers.Store(event, []EventHandler{
{callback: reflect.ValueOf(fn), async: true},
})
}
return nil
}
func (e *EventBus) Publish(event string, args... any) {
if handlers, ok := e.handlers.Load(event); ok {
for _, handler := range handlers {
args1 := reflectArgs(handler,args...)
if handler.async {
go handler.callback.Call(args1)
} else {
handler.callback.Call(args1)
}
}
}
}
func reflectArgs(handler EventHandler,args... any) []reflect.Value {
funcType := handler.callback.Type()
passedArguments := make([]reflect.Value, len(args))
for i, v := range args {
if v == nil {
passedArguments[i] = reflect.New(funcType.In(i)).Elem()
} else {
passedArguments[i] = reflect.ValueOf(v)
}
}
return passedArguments
}

266
pkg/gemini/gemini.go Normal file
View File

@@ -0,0 +1,266 @@
package gemini
import (
"bytes"
"context"
"encoding/json"
"fmt"
"polaris/log"
"strings"
"github.com/google/generative-ai-go/genai"
"google.golang.org/api/option"
)
func NewClient(apiKey, modelName string) (*Client, error) {
ctx := context.Background()
client, err := genai.NewClient(ctx, option.WithAPIKey(apiKey))
if err != nil {
return nil, err
}
return &Client{apiKey: apiKey, modelName: modelName, c: client}, nil
}
type Client struct {
apiKey string
modelName string
c *genai.Client
}
type TvInfo struct {
TitleEnglish string `json:"title_english"`
TitleChinses string `json:"title_chinese"`
Season int `json:"season"`
StartEpisode int `json:"start_episode"`
EndEpisode int `json:"end_episode"`
Resolution string `json:"resolution"`
Subtitle string `json:"subtitle"`
ReleaseGroup string `json:"release_group"`
Year int `json:"year"`
AudioLanguage string `json:"audio_language"`
IsCompleteSeason bool `json:"is_complete_season"`
}
func (c *Client) ParseTvInfo(q string) (*TvInfo, error) {
log.Info(q)
ctx := context.Background()
model := c.c.GenerativeModel(c.modelName)
model.ResponseMIMEType = "application/json"
model.ResponseSchema = &genai.Schema{
Type: genai.TypeObject,
Properties: map[string]*genai.Schema{
"title_english": {Type: genai.TypeString},
"title_chinese": {Type: genai.TypeString},
"season": {Type: genai.TypeInteger, Description: "season number"},
"start_episode": {Type: genai.TypeInteger},
"end_episode": {Type: genai.TypeInteger},
//"episodes": {Type: genai.TypeString},
"resolution": {Type: genai.TypeString},
"subtitle": {Type: genai.TypeString},
"release_group": {Type: genai.TypeString},
"year": {Type: genai.TypeInteger},
"audio_language": {Type: genai.TypeString},
"is_complete_season": {Type: genai.TypeBoolean},
},
Required: []string{"title_english", "title_chinese", "season", "start_episode", "resolution"},
}
resp, err := model.GenerateContent(ctx, genai.Text(q))
if err != nil {
return nil, err
}
for _, part := range resp.Candidates[0].Content.Parts {
if txt, ok := part.(genai.Text); ok {
var info TvInfo
if err := json.Unmarshal([]byte(txt), &info); err != nil {
return nil, err
}
return &info, nil
}
}
return nil, fmt.Errorf("not found")
}
type MovieInfo struct {
TitleEnglish string `json:"title_english"`
TitleChinses string `json:"title_chinese"`
Resolution string `json:"resolution"`
Subtitle string `json:"subtitle"`
ReleaseGroup string `json:"release_group"`
Year int `json:"year"`
AudioLanguage string `json:"audio_language"`
}
func (c *Client) ParseMovieInfo(q string) (*MovieInfo, error) {
log.Info(q)
ctx := context.Background()
model := c.c.GenerativeModel(c.modelName)
model.ResponseMIMEType = "application/json"
model.ResponseSchema = &genai.Schema{
Type: genai.TypeObject,
Properties: map[string]*genai.Schema{
"title_english": {Type: genai.TypeString},
"title_chinese": {Type: genai.TypeString},
"resolution": {Type: genai.TypeString},
"subtitle": {Type: genai.TypeString},
"release_group": {Type: genai.TypeString},
"year": {Type: genai.TypeInteger},
"audio_language": {Type: genai.TypeString},
},
Required: []string{"title_english", "title_chinese", "resolution"},
}
resp, err := model.GenerateContent(ctx, genai.Text(q))
if err != nil {
return nil, err
}
for _, part := range resp.Candidates[0].Content.Parts {
if txt, ok := part.(genai.Text); ok {
var info MovieInfo
if err := json.Unmarshal([]byte(txt), &info); err != nil {
return nil, err
}
return &info, nil
}
}
return nil, fmt.Errorf("not found")
}
func (c *Client) isTvSeries(q string) (bool, error) {
ctx := context.Background()
model := c.c.GenerativeModel(c.modelName)
model.ResponseMIMEType = "application/json"
model.ResponseSchema = &genai.Schema{
Type: genai.TypeBoolean, Nullable: true, Description: "whether the input text implies a tv series",
}
resp, err := model.GenerateContent(ctx, genai.Text(q))
if err != nil {
return false, err
}
for _, part := range resp.Candidates[0].Content.Parts {
if txt, ok := part.(genai.Text); ok {
return strings.ToLower(string(txt)) == "true", nil
}
}
return false, fmt.Errorf("error")
}
func (c *Client) ImpliesSameTvOrMovie(torrentName, mediaName string) bool {
ctx := context.Background()
model := c.c.GenerativeModel(c.modelName)
model.ResponseMIMEType = "application/json"
model.ResponseSchema = &genai.Schema{
Type: genai.TypeBoolean, Nullable: true,
}
q := fmt.Sprintf("whether this file name \"%s\" implies the same TV series or movie with name \"%s\"?", torrentName, mediaName)
resp, err := model.GenerateContent(ctx, genai.Text(q))
if err != nil {
return false
}
for _, part := range resp.Candidates[0].Content.Parts {
if txt, ok := part.(genai.Text); ok {
return strings.ToLower(string(txt)) == "true"
}
}
return false
}
func (c *Client) FilterTvOrMovies(resourcesNames []string, titles ...string) ([]string, error) {
ctx := context.Background()
model := c.c.GenerativeModel(c.modelName)
model.ResponseMIMEType = "application/json"
model.ResponseSchema = &genai.Schema{
Type: genai.TypeArray,
Items: &genai.Schema{Type: genai.TypeString},
}
for i, s := range titles {
titles[i] = "\"" + s + "\""
}
p := &bytes.Buffer{}
p.WriteString(`the following list of file names, list all of which implies the same TV series or movie of name`)
p.WriteString(strings.Join(titles, " or "))
p.WriteString(":\n")
for _, r := range resourcesNames {
p.WriteString(" * ")
p.WriteString(r)
p.WriteString("\n")
}
log.Debugf("FilterTvOrMovies prompt is %s", p.String())
resp, err := model.GenerateContent(ctx, genai.Text(p.String()))
if err != nil {
return nil, err
}
for _, part := range resp.Candidates[0].Content.Parts {
if txt, ok := part.(genai.Text); ok {
var s []string
if err := json.Unmarshal([]byte(txt), &s); err != nil {
return nil, err
}
return s, nil
}
}
return nil, fmt.Errorf("nothing found")
}
func (c *Client) FilterMovies(resourcesNames []string, year int, titles ...string) ([]string, error) {
ctx := context.Background()
model := c.c.GenerativeModel(c.modelName)
model.ResponseMIMEType = "application/json"
model.ResponseSchema = &genai.Schema{
Type: genai.TypeArray,
Items: &genai.Schema{Type: genai.TypeString},
}
for i, s := range titles {
titles[i] = "\"" + s + "\""
}
p := &bytes.Buffer{}
p.WriteString( fmt.Sprint("the following list of file names, list all of which match following criteria: 1. Is movie 2. Released in year %d 3. Have name of ", year))
p.WriteString(strings.Join(titles, " or "))
p.WriteString(":\n")
for _, r := range resourcesNames {
p.WriteString(" * ")
p.WriteString(r)
p.WriteString("\n")
}
log.Debugf("FilterTvOrMovies prompt is %s", p.String())
resp, err := model.GenerateContent(ctx, genai.Text(p.String()))
if err != nil {
return nil, err
}
for _, part := range resp.Candidates[0].Content.Parts {
if txt, ok := part.(genai.Text); ok {
var s []string
if err := json.Unmarshal([]byte(txt), &s); err != nil {
return nil, err
}
return s, nil
}
}
return nil, fmt.Errorf("nothing found")
}

View File

@@ -0,0 +1,8 @@
package gemini
import (
"testing"
)
func Test_any1(t *testing.T) {
}

View File

@@ -5,7 +5,6 @@ import (
"encoding/json"
"errors"
"io"
"log"
"mime/multipart"
"net/http"
"net/http/cookiejar"
@@ -94,28 +93,6 @@ func (client *Client) get(endpoint string, opts map[string]string) (*http.Respon
return resp, nil
}
func (cleint *Client) postJson(endpoint string, body any) (*http.Response, error) {
var buff bytes.Buffer
buff.WriteString("json=")
d, err := json.Marshal(body)
if err!= nil {
return nil, err
}
buff.Write(d)
log.Println(buff.String())
req, err := http.NewRequest("POST", cleint.URL+endpoint, &buff)
if err!= nil {
return nil, err
}
req.Header.Set("Content-Type", "application/x-www-form-urlencoded")
req.Header.Set("User-Agent", "go-qbittorrent v0.1")
resp, err := cleint.http.Do(req)
if err!= nil {
return nil, err
}
return resp, nil
}
// post will perform a POST request with no content-type specified
func (client *Client) post(endpoint string, opts map[string]string) (*http.Response, error) {
// add optional parameters that the user wants
@@ -338,9 +315,8 @@ func (client *Client) Preferences() (prefs Preferences, err error) {
}
// SetPreferences of the qbittorrent client
func (client *Client) SetPreferences(m map[string]any) (prefsSet bool, err error) {
resp, err := client.postJson("api/v2/app/setPreferences", m)
func (client *Client) SetPreferences() (prefsSet bool, err error) {
resp, err := client.post("api/v2/app/setPreferences", nil)
return (resp.Status == "200 OK"), err
}

View File

@@ -2,25 +2,29 @@ package douban
import (
"fmt"
"io"
"net/http"
"polaris/log"
"polaris/pkg/importlist"
"strconv"
"strings"
"time"
"github.com/PuerkitoBio/goquery"
"github.com/gocolly/colly"
)
const ua = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/133.0.0.0 Safari/537.36"
const ua = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36"
func ParseDoulist(doulistUrl string) (*importlist.Response, error) {
if !strings.Contains(doulistUrl, "doulist") {
return nil, fmt.Errorf("not doulist")
}
res, err := doHttpReq("GET", doulistUrl, nil)
req, err := http.NewRequest("GET", doulistUrl, nil)
if err != nil {
return nil, err
}
req.Header.Set("User-Agent", ua)
res, err := http.DefaultClient.Do(req)
if err != nil {
return nil, err
}
@@ -81,8 +85,13 @@ func ParseDoulist(doulistUrl string) (*importlist.Response, error) {
func parseDetailPage(url string) (string, error) {
println(url)
req, err := http.NewRequest("GET", url, nil)
if err != nil {
return "", err
}
req.Header.Set("User-Agent", ua)
res, err := doHttpReq("GET", url, nil)
res, err := http.DefaultClient.Do(req)
if err != nil {
return "", err
}
@@ -106,80 +115,3 @@ func parseDetailPage(url string) (string, error) {
_ = doc
return "", nil
}
func NewDoubanWishlist(personId string) *DoubanWishlist {
return &DoubanWishlist{PersonId: personId}
}
type DoubanWishlist struct {
PersonId string
}
const wishlistUrl = "https://movie.douban.com/people/%s/wish?sort=time&start=%d&mode=grid&tags_sort=count"
func (d *DoubanWishlist) GetWishlist(page int) (*importlist.Response, error) {
c := colly.NewCollector(colly.UserAgent(ua))
c.Limit(&colly.LimitRule{
DomainRegexp: "*",
Delay: 10 * time.Second,
RandomDelay: 2 * time.Second,
})
url := fmt.Sprintf(wishlistUrl, d.PersonId, (page-1)*15)
c.OnHTML("div[class='item comment-item']", func(e *colly.HTMLElement) {
if !strings.HasPrefix(e.Request.URL.String(), "https://movie.douban.com/people") {
return
}
e.DOM.Find("div[class='pic'] a[title]").Each(func(i int, selection *goquery.Selection) {
println(selection.Attr("href"))
url, ok := selection.Attr("href")
if ok {
c.Visit(url)
}
})
})
c.OnHTML("#content", func(h *colly.HTMLElement) {
var item importlist.Item
h.DOM.Find("h1").Each(func(i int, selection *goquery.Selection) {
selection.Find("span[property]").Each(func(i int, selection *goquery.Selection) {
println(selection.Text())
item.Title = selection.Text()
})
selection.Find("span[class='year']").Each(func(i int, selection *goquery.Selection) {
n, _ := strconv.Atoi(selection.Text())
item.Year = n
})
})
h.DOM.Find("#info").Each(func(i int, s *goquery.Selection) {
info := strings.TrimSpace(s.Text())
lines := strings.Split(info, "\n")
if len(lines) == 0 {
return
}
last := lines[len(lines)-1]
if !strings.HasPrefix(strings.ToLower(last), "imdb") {
return
}
ss := strings.Split(last, ":")
for _, p := range ss {
p := strings.TrimSpace(strings.ToLower(p))
if strings.HasPrefix(p, "tt") {
item.ImdbID = p
}
}
})
log.Info(item)
})
return nil, c.Visit(url)
}
func doHttpReq(method, url string, body io.Reader) (*http.Response, error) {
req, err := http.NewRequest(method, url, body)
if err != nil {
return nil, err
}
req.Header.Set("User-Agent", ua)
return http.DefaultClient.Do(req)
}

View File

@@ -9,10 +9,3 @@ func TestParseDoulist(t *testing.T) {
r, err := ParseDoulist("https://www.douban.com/doulist/81580/")
log.Info(r, err)
}
func Test111(t *testing.T) {
d := NewDoubanWishlist("69894889")
_, err := d.GetWishlist(1)
log.Infof("err: %v", err)
}

View File

@@ -6,7 +6,6 @@ import (
"regexp"
"strconv"
"strings"
"time"
)
type MovieMetadata struct {
@@ -16,7 +15,7 @@ type MovieMetadata struct {
IsQingban bool
}
func (m *MovieMetadata) IsAcceptable(names ...string) bool {
func (m *MovieMetadata) IsAcceptable(names... string) bool {
for _, name := range names {
re := regexp.MustCompile(`[^\p{L}\w\s]`)
name = re.ReplaceAllString(strings.ToLower(name), " ")
@@ -27,63 +26,41 @@ func (m *MovieMetadata) IsAcceptable(names ...string) bool {
re := regexp.MustCompile(`\b` + name + `\b`)
return re.MatchString(name2)
}
if strings.Contains(name2, name) {
if strings.Contains(name2, name) {
return true
}
}
return false
}
func findYear(name string) (year int, index int) {
yearRe := regexp.MustCompile(`\(\d{4}\)`)
yearMatches := yearRe.FindAllString(name, -1)
index = -1
if len(yearMatches) > 0 {
index = strings.Index(name, yearMatches[0])
y := yearMatches[0][1 : len(yearMatches[0])-1]
n, err := strconv.Atoi(y)
if err != nil {
panic(fmt.Sprintf("convert %s error: %v", y, err))
}
year = n
} else {
yearRe := regexp.MustCompile(`\d{4}`)
yearMatches := yearRe.FindAllString(name, -1)
if len(yearMatches) > 0 {
year, index = findYearInMatches(yearMatches, name)
}
}
return
}
func findYearInMatches(matches []string, name string) (year int, index int) {
if len(matches) == 0 {
return 0, -1
}
for _, y := range matches {
index = strings.Index(name, y)
n, err := strconv.Atoi(y)
if err != nil {
panic(fmt.Sprintf("convert %s error: %v", y, err))
}
if n < 1900 || n > time.Now().Year()+1 { //filter invalid year
continue
}
year = n
}
return
}
func ParseMovie(name string) *MovieMetadata {
name = strings.Join(strings.Fields(name), " ") //remove unnessary spaces
name = strings.ToLower(strings.TrimSpace(name))
var meta = &MovieMetadata{}
year, yearIndex := findYear(name)
meta.Year = year
yearRe := regexp.MustCompile(`\(\d{4}\)`)
yearMatches := yearRe.FindAllString(name, -1)
var yearIndex = -1
if len(yearMatches) > 0 {
yearIndex = strings.Index(name, yearMatches[0])
y := yearMatches[0][1 : len(yearMatches[0])-1]
n, err := strconv.Atoi(y)
if err != nil {
panic(fmt.Sprintf("convert %s error: %v", y, err))
}
meta.Year = n
} else {
yearRe := regexp.MustCompile(`\d{4}`)
yearMatches := yearRe.FindAllString(name, -1)
if len(yearMatches) > 0 {
n, err := strconv.Atoi(yearMatches[0])
if err != nil {
panic(fmt.Sprintf("convert %s error: %v", yearMatches[0], err))
}
meta.Year = n
}
}
if yearIndex != -1 {
meta.Name = name[:yearIndex]
@@ -101,7 +78,7 @@ func ParseMovie(name string) *MovieMetadata {
// https://en.wikipedia.org/wiki/Pirated_movie_release_types
func isQiangban(name string) bool {
qiangbanFilter := []string{"CAMRip", "CAM-Rip", "CAM", "HDCAM", "TS", "TSRip", "HDTS", "TELESYNC", "PDVD", "PreDVDRip", "TC", "HDTC", "TELECINE", "WP", "WORKPRINT"}
qiangbanFilter := []string{"CAMRip","CAM-Rip", "CAM", "HDCAM", "TS","TSRip", "HDTS", "TELESYNC", "PDVD", "PreDVDRip", "TC", "HDTC", "TELECINE", "WP", "WORKPRINT"}
re := regexp.MustCompile(`\W`)
name = re.ReplaceAllString(strings.ToLower(name), " ")
fields := strings.Fields(name)

View File

@@ -272,7 +272,7 @@ func matchResolution(s string) string {
func maybeSeasonPack(s string) bool {
//season pack
packRe := regexp.MustCompile(`((\d{1,2}-\d{1,2}))|(complete)|(全集)|(合集)|(\W[sS]\d{1,2}\W)`)
packRe := regexp.MustCompile(`((\d{1,2}-\d{1,2}))|(complete)|(全集)`)
if packRe.MatchString(s) {
return true
}
@@ -409,8 +409,6 @@ func parseName(name string) *Info {
if strings.TrimSpace(name) == "" {
return meta
}
year, yearP := findYear(name)
meta.Year = year
season, p := findSeason(name)
if season == -1 {
@@ -439,11 +437,7 @@ func parseName(name string) *Info {
//tv name
if utils.IsASCII(name) && p < len(name) && p-1 > 0 {
p1 := p -1
if yearP > 0 {
p1 = min(p1, yearP-1)
}
meta.NameEn = strings.TrimSpace(name[:p1])
meta.NameEn = strings.TrimSpace(name[:p-1])
meta.NameCn = meta.NameEn
} else {
fields := strings.FieldsFunc(name, func(r rune) bool {

View File

@@ -197,25 +197,6 @@ func Test_ParseTV18(t *testing.T) {
//assert.Equal(t, "720p", m.Resolution)
}
//The Count of Monte Cristo 2024 S01 1080p WEB-DL DD 5.1 H.264-playWEB
func Test_ParseTV20(t *testing.T) {
s1 := "The Count of Monte Cristo 2024 S01 1080p WEB-DL DD 5.1 H.264-playWEB "
m := ParseTv(s1)
log.Infof("results: %+v", m)
assert.Equal(t, 1, m.Season)
assert.Equal(t, true, m.IsSeasonPack)
}
func Test_ParseTV21(t *testing.T) {
s1 := "【东京不够热】基督山伯爵-华丽的复仇-【01~09】【1280x720】【简中/日双语字幕】【2018春季日剧】【合集】 "
m := ParseTv(s1)
log.Infof("results: %+v", m)
assert.Equal(t, 1, m.Season)
assert.Equal(t, 2018, m.Year)
assert.Equal(t, true, m.IsSeasonPack)
}
// The Day of the Jackal (Season 1) WEB-DL 1080p
func Test_ParseTV19(t *testing.T) {
s1 := "The Day of the Jackal (Season 1) WEB-DL 1080p "

View File

@@ -1,31 +0,0 @@
package main
import (
"net"
"polaris/log"
"polaris/pkg/nat"
)
func main() {
// This is a placeholder for the main function.
// The actual implementation will depend on the specific requirements of the application.
src, err := net.Listen("tcp", ":8080")
if err != nil {
panic(err)
}
for {
conn, err := src.Accept()
if err != nil {
panic(err)
}
log.Infof("new connection: %+v", conn)
dest, err := net.Dial("tcp", "10.0.0.8:8080")
if err != nil {
panic(err)
}
go nat.ReverseProxy(conn, dest)
}
select {}
}

View File

@@ -1,67 +0,0 @@
package nat
import (
"io"
"log"
"net"
)
func ReverseProxy(sourceConn net.Conn, targetConn net.Conn) {
serverClosed := make(chan struct{}, 1)
clientClosed := make(chan struct{}, 1)
go broker(sourceConn, targetConn, clientClosed)
go broker(targetConn, sourceConn, serverClosed)
// wait for one half of the proxy to exit, then trigger a shutdown of the
// other half by calling CloseRead(). This will break the read loop in the
// broker and allow us to fully close the connection cleanly without a
// "use of closed network connection" error.
var waitFor chan struct{}
select {
case <-clientClosed:
// the client closed first and any more packets from the server aren't
// useful, so we can optionally SetLinger(0) here to recycle the port
// faster.
waitFor = serverClosed
case <-serverClosed:
waitFor = clientClosed
}
// Wait for the other connection to close.
// This "waitFor" pattern isn't required, but gives us a way to track the
// connection and ensure all copies terminate correctly; we can trigger
// stats on entry and deferred exit of this function.
<-waitFor
}
func pipe(src net.Conn, dest net.Conn) {
errChan := make(chan error, 1)
go func() {
_, err := io.Copy(src, dest)
errChan <- err
}()
go func() {
_, err := io.Copy(dest, src)
errChan <- err
}()
<-errChan
}
// This does the actual data transfer.
// The broker only closes the Read side.
func broker(dst, src net.Conn, srcClosed chan struct{}) {
// We can handle errors in a finer-grained manner by inlining io.Copy (it's
// simple, and we drop the ReaderFrom or WriterTo checks for
// net.Conn->net.Conn transfers, which aren't needed). This would also let
// us adjust buffersize.
_, err := io.Copy(dst, src)
if err != nil {
log.Printf("Copy error: %s", err)
}
if err := src.Close(); err != nil {
log.Printf("Close error: %s", err)
}
srcClosed <- struct{}{}
}

View File

@@ -1,169 +0,0 @@
package nat
import (
"fmt"
"strings"
"polaris/log"
"github.com/pion/stun/v3"
)
func getNatIpAndPort() (*stun.XORMappedAddress, error) {
var xorAddr stun.XORMappedAddress
for _, server := range getStunServers() {
log.Infof("try to connect to stun server: %s", server)
u, err := stun.ParseURI("stun:" + server)
if err != nil {
continue
}
// Creating a "connection" to STUN server.
c, err := stun.DialURI(u, &stun.DialConfig{})
if err != nil {
continue
}
// Building binding request with random transaction id.
message := stun.MustBuild(stun.TransactionID, stun.BindingRequest)
// Sending request to STUN server, waiting for response message.
var err1 error
if err := c.Do(message, func(res stun.Event) {
if res.Error != nil {
err1 = res.Error
return
}
log.Infof("stun server %s response: %v", server, res.Message.String())
// Decoding XOR-MAPPED-ADDRESS attribute from message.
if err := xorAddr.GetFrom(res.Message); err != nil {
err1 = err
return
}
fmt.Println("your IP is", xorAddr.IP)
fmt.Println("your port is", xorAddr.Port)
}); err != nil {
log.Warnf("stun server %s error: %v", server, err)
continue
}
if err1 != nil {
log.Warnf("stun server %s error: %v", server, err1)
continue
}
break
}
return &xorAddr, nil
}
func getStunServers() []string {
var servers []string
for _, line := range strings.Split(strings.TrimSpace(stunServers1), "\n") {
line = strings.TrimSpace(line)
if line == "" {
continue
}
servers = append(servers, line)
}
return servers
}
// https://github.com/heiher/natmap/issues/18
const stunServers1 = `
stun.miwifi.com:3478
stun.chat.bilibili.com:3478
stun.cloudflare.com:3478
turn.cloudflare.com:3478
fwa.lifesizecloud.com:3478
`
// https://github.com/pradt2/always-online-stun
const stunServers = `
stun.miwifi.com:3478
stun.ukh.de:3478
stun.kanojo.de:3478
stun.m-online.net:3478
stun.nextcloud.com:3478
stun.voztovoice.org:3478
stun.oncloud7.ch:3478
stun.antisip.com:3478
stun.bitburger.de:3478
stun.acronis.com:3478
stun.signalwire.com:3478
stun.sonetel.net:3478
stun.poetamatusel.org:3478
stun.avigora.fr:3478
stun.diallog.com:3478
stun.nanocosmos.de:3478
stun.romaaeterna.nl:3478
stun.heeds.eu:3478
stun.freeswitch.org:3478
stun.engineeredarts.co.uk:3478
stun.root-1.de:3478
stun.healthtap.com:3478
stun.allflac.com:3478
stun.vavadating.com:3478
stun.godatenow.com:3478
stun.mixvoip.com:3478
stun.sip.us:3478
stun.sipthor.net:3478
stun.stochastix.de:3478
stun.kaseya.com:3478
stun.files.fm:3478
stun.meetwife.com:3478
stun.myspeciality.com:3478
stun.3wayint.com:3478
stun.voip.blackberry.com:3478
stun.axialys.net:3478
stun.bridesbay.com:3478
stun.threema.ch:3478
stun.siptrunk.com:3478
stun.ncic.com:3478
stun.1cbit.ru:3478
stun.ttmath.org:3478
stun.yesdates.com:3478
stun.sonetel.com:3478
stun.peethultra.be:3478
stun.pure-ip.com:3478
stun.business-isp.nl:3478
stun.ringostat.com:3478
stun.imp.ch:3478
stun.cope.es:3478
stun.baltmannsweiler.de:3478
stun.lovense.com:3478
stun.frozenmountain.com:3478
stun.linuxtrent.it:3478
stun.thinkrosystem.com:3478
stun.3deluxe.de:3478
stun.skydrone.aero:3478
stun.ru-brides.com:3478
stun.streamnow.ch:3478
stun.atagverwarming.nl:3478
stun.ipfire.org:3478
stun.fmo.de:3478
stun.moonlight-stream.org:3478
stun.f.haeder.net:3478
stun.nextcloud.com:443
stun.finsterwalder.com:3478
stun.voipia.net:3478
stun.zepter.ru:3478
stun.sipnet.net:3478
stun.hot-chilli.net:3478
stun.zentauron.de:3478
stun.geesthacht.de:3478
stun.annatel.net:3478
stun.flashdance.cx:3478
stun.voipgate.com:3478
stun.genymotion.com:3478
stun.graftlab.com:3478
stun.fitauto.ru:3478
stun.telnyx.com:3478
stun.verbo.be:3478
stun.dcalling.de:3478
stun.lleida.net:3478
stun.romancecompass.com:3478
stun.siplogin.de:3478
stun.bethesda.net:3478
stun.alpirsbacher.de:3478
stun.uabrides.com:3478
stun.technosens.fr:3478
stun.radiojar.com:3478
`

View File

@@ -1,14 +0,0 @@
package nat
import "testing"
func TestStun1(t *testing.T) {
// s,err := getNatIpAndPort()
// if err != nil {
// t.Logf("get nat ip and port error: %v", err)
// t.Fail()
// }
//NatTraversal()
t.Logf("nat ip: ")
}

View File

@@ -1,204 +0,0 @@
package nat
import (
"fmt"
"net"
"polaris/log"
"time"
"github.com/pion/stun/v3"
)
const (
udp = "udp4"
pingMsg = "ping"
pongMsg = "pong"
timeoutMillis = 500
)
func NewNatTraversal(addrCallback func(stun.XORMappedAddress) error, targetHost string) (*NatTraversal, error) {
conn, err := net.ListenUDP(udp, nil)
if err != nil {
return nil, fmt.Errorf("listen: %w", err)
}
log.Infof("Listening on %s", conn.LocalAddr())
messageChan := listen(conn)
s := &NatTraversal{
conn: conn,
messageChan: messageChan,
cancel: make(chan struct{}),
addrChan: make(chan stun.XORMappedAddress),
addrCallback: addrCallback,
targetHost: targetHost,
}
go s.updateNatAddr()
return s, nil
}
type NatTraversal struct {
//peerAddr *net.UDPAddr
conn *net.UDPConn
messageChan <-chan []byte
addrChan chan stun.XORMappedAddress
cancel chan struct{}
stunAddr *stun.XORMappedAddress
addrCallback func(stun.XORMappedAddress) error
targetHost string
targetPort int
}
func (s *NatTraversal) Cancel() {
close(s.cancel)
s.conn.Close()
}
func (s *NatTraversal) updateNatAddr() {
for addr := range s.addrChan {
if s.stunAddr == nil || s.stunAddr.String() != addr.String() { //new address
log.Warnf("My public address: %s\n", addr)
if s.addrCallback != nil { //execute callback
if err := s.addrCallback(addr); err != nil {
log.Warnf("callback error: %v", err)
}
}
s.targetPort = addr.Port
log.Infof("now proxy to target host: %s:%d", s.targetHost, s.targetPort)
s.stunAddr = &addr
}
}
}
func (s *NatTraversal) sendStunServerBindingMsg() error {
for _, srv := range getStunServers() {
log.Debugf("send heartbeat to stun server: %s", srv)
srvAddr, err := net.ResolveUDPAddr(udp, srv)
if err != nil {
log.Warnf("Failed to resolve server addr: %s", err)
continue
}
err = sendBindingRequest(s.conn, srvAddr)
if err != nil {
log.Warnf("send binding request: %w", err)
continue
}
return nil
}
return fmt.Errorf("failed to get STUN address")
}
func (s *NatTraversal) getNatAddr(msg []byte) (*stun.XORMappedAddress, error) {
if !stun.IsMessage(msg) {
return nil, fmt.Errorf("not a stun message")
}
m := new(stun.Message)
m.Raw = msg
decErr := m.Decode()
if decErr != nil {
return nil, fmt.Errorf("decode: %w", decErr)
}
var xorAddr stun.XORMappedAddress
if getErr := xorAddr.GetFrom(m); getErr != nil {
return nil, fmt.Errorf("getFrom: %w", getErr)
}
s.addrChan <- xorAddr
return &xorAddr, nil
}
func (s *NatTraversal) StartProxy() {
tick := time.NewTicker(60 * time.Second)
go func() { //tcker message to check public ip and port
defer tick.Stop()
for {
err := s.sendStunServerBindingMsg()
if err != nil {
log.Warnf("send stun server binding msg: %w", err)
}
select {
case <-s.cancel:
log.Infof("stun nat proxy cancelled")
return
case <-tick.C:
//do nothing
}
}
}()
for {
select {
case <-s.cancel:
log.Infof("stun nat proxy cancelled")
return
case m := <-s.messageChan:
if stun.IsMessage(m) {
s.getNatAddr(m)
} else {
peerAddr, err := net.ResolveUDPAddr(udp, fmt.Sprintf("%s:%d", s.targetHost, s.targetPort))
if err != nil {
log.Errorf("resolve peeraddr: %w", err)
continue
}
send(m, s.conn, peerAddr)
}
}
}
}
func listen(conn *net.UDPConn) <-chan []byte {
messages := make(chan []byte)
go func() {
for {
buf := make([]byte, 10240)
n, _, err := conn.ReadFromUDP(buf)
if err != nil {
close(messages)
return
}
buf = buf[:n]
messages <- buf
}
}()
return messages
}
func sendBindingRequest(conn *net.UDPConn, addr *net.UDPAddr) error {
m := stun.MustBuild(stun.TransactionID, stun.BindingRequest)
err := send(m.Raw, conn, addr)
if err != nil {
return fmt.Errorf("binding: %w", err)
}
return nil
}
func send(msg []byte, conn *net.UDPConn, addr *net.UDPAddr) error {
_, err := conn.WriteToUDP(msg, addr)
if err != nil {
return fmt.Errorf("send: %w", err)
}
return nil
}
func sendStr(msg string, conn *net.UDPConn, addr *net.UDPAddr) error {
return send([]byte(msg), conn, addr)
}

View File

@@ -1,15 +0,0 @@
package notifier
import "testing"
func TestServerChan(t *testing.T) {
s, err := NewServerChanClient(``)
if err != nil {
t.Error(err)
return
}
err = s.SendMsg("test")
if err != nil {
t.Error(err)
}
}

View File

@@ -30,7 +30,6 @@ func init() {
handler.Store("dingtalk", NewDingTalkClient)
handler.Store("telegram", NewTelegramClient)
handler.Store("bark", NewbarkClient)
handler.Store("serverchan", NewServerChanClient)
}
func Gethandler(name string) (HandlerFunc, bool) {

View File

@@ -1,89 +0,0 @@
package notifier
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
"regexp"
"strings"
"github.com/pkg/errors"
)
type ServerChanConfig struct {
Key string `json:"key"`
}
func NewServerChanClient(s string) (NotificationClient, error) {
var cfg ServerChanConfig
if err := json.Unmarshal([]byte(s), &cfg); err != nil {
return nil, errors.Wrap(err, "json")
}
return &ServerChan{Key: cfg.Key}, nil
}
type ServerChan struct {
Key string
}
func (s *ServerChan) SendMsg(msg string) error {
return scSend("Polaris", msg, s.Key)
}
func scSend(text string, desp string, key string) error {
data := url.Values{}
data.Set("text", text)
data.Set("desp", desp)
// 根据 sendkey 是否以 "sctp" 开头决定 API 的 URL
var apiUrl string
if strings.HasPrefix(key, "sctp") {
// 使用正则表达式提取数字部分
re := regexp.MustCompile(`sctp(\d+)t`)
matches := re.FindStringSubmatch(key)
if len(matches) > 1 {
num := matches[1]
apiUrl = fmt.Sprintf("https://%s.push.ft07.com/send/%s.send", num, key)
} else {
return errors.New("invalid sendkey format for sctp")
}
} else {
apiUrl = fmt.Sprintf("https://sctapi.ftqq.com/%s.send", key)
}
client := &http.Client{}
req, err := http.NewRequest("POST", apiUrl, strings.NewReader(data.Encode()))
if err != nil {
return err
}
req.Header.Set("Content-Type", "application/x-www-form-urlencoded")
resp, err := client.Do(req)
if err != nil {
return err
}
defer resp.Body.Close()
d, err := io.ReadAll(resp.Body)
if err != nil {
return err
}
var r response
if err := json.Unmarshal(d, &r); err != nil {
return err
}
if r.Code != 0 {
return errors.New(r.Message)
}
return nil
}
type response struct {
Code int `json:"code"`
Message string `json:"message"`
}

View File

@@ -31,28 +31,26 @@ func New(apiKey, url string) *Client {
return &Client{p: p, apiKey: apiKey, url: url}
}
func (c *Client) GetIndexers() ([]*ent.Indexers, error) {
func (c *Client) GetIndexers(t ProwlarrSupportType) ([]*db.TorznabInfo, error) {
ins, err := c.p.GetIndexers()
if err != nil {
return nil, err
}
var indexers []*ent.Indexers
var indexers []*db.TorznabInfo
for _, in := range ins {
tvSearch := true
movieSearch := true
if len(in.Capabilities.TvSearchParams) == 0 { //no tv resource in this indexer
tvSearch = false
if !in.Enable {
continue
}
if len(in.Capabilities.MovieSearchParams) == 0 { //no movie resource in this indexer
movieSearch = false
if t == "tv" && len(in.Capabilities.TvSearchParams) == 0 { //no tv resource in this indexer
continue
} else if t == "movie" && len(in.Capabilities.MovieSearchParams) == 0 { //no movie resource in this indexer
continue
}
seedRatio := 0.0
for _, f := range in.Fields {
if f.Name == "torrentBaseSettings.seedRatio" && f.Value != nil {
if r, ok := f.Value.(float64); ok {
seedRatio = r
break
}
}
}
@@ -63,18 +61,17 @@ func (c *Client) GetIndexers() ([]*ent.Indexers, error) {
data, _ := json.Marshal(&setting)
entIndexer := ent.Indexers{
Disabled: !in.Enable,
Name: in.Name,
Implementation: "torznab",
Priority: int(in.Priority),
Priority: 128 - int(in.Priority),
SeedRatio: float32(seedRatio),
Settings: string(data),
TvSearch: tvSearch,
MovieSearch: movieSearch,
APIKey: c.apiKey,
URL: fmt.Sprintf("%s/%d/api", strings.TrimSuffix(c.url, "/"), in.ID),
}
indexers = append(indexers, &entIndexer)
indexers = append(indexers, &db.TorznabInfo{
Indexers: &entIndexer,
TorznabSetting: setting,
})
}
return indexers, nil
}

View File

@@ -7,7 +7,7 @@ import (
func Test111(t *testing.T) {
c := New("", "http://10.0.0.8:9696/")
apis , err := c.GetIndexers()
apis , err := c.GetIndexers("tv")
log.Infof("errors: %v", err)
log.Infof("indexers: %+v", apis[0])
}

View File

@@ -2,9 +2,7 @@ package qbittorrent
import (
"fmt"
"io/fs"
"os"
"path/filepath"
"polaris/pkg"
"polaris/pkg/go-qbittorrent/qbt"
"polaris/pkg/utils"
@@ -61,25 +59,17 @@ func (c *Client) GetAll() ([]pkg.Torrent, error) {
return res, nil
}
func (c *Client) GetListenPort() (int, error) {
pref, err := c.c.Preferences()
func (c *Client) Download(link, dir string) (pkg.Torrent, error) {
magnet, err := utils.Link2Magnet(link)
if err != nil {
return 0, errors.Wrap(err, "get preferences")
return nil, errors.Errorf("converting link to magnet error, link: %v, error: %v", link, err)
}
return pref.ListenPort, nil
}
func (c *Client) SetListenPort(port int) error {
ok, err := c.c.SetPreferences(map[string]any{"listen_port": port})
if !ok || err != nil {
return errors.Wrap(err, "set preferences")
hash, err := utils.MagnetHash(magnet)
if err != nil {
return nil, errors.Wrap(err, "get hash")
}
return nil
}
func (c *Client) Download(link, hash, dir string) (pkg.Torrent, error) {
err := c.c.DownloadLinks([]string{link}, qbt.DownloadOptions{Savepath: &dir, Category: &c.category})
err = c.c.DownloadLinks([]string{magnet}, qbt.DownloadOptions{Savepath: &dir, Category: &c.category})
if err != nil {
return nil, errors.Wrap(err, "qbt download")
}
@@ -87,23 +77,11 @@ func (c *Client) Download(link, hash, dir string) (pkg.Torrent, error) {
}
func NewTorrentHash(info Info, hash string) (*Torrent, error) {
func NewTorrent(info Info, link string) (*Torrent, error) {
c, err := NewClient(info.URL, info.User, info.Password)
if err != nil {
return nil, err
}
t := &Torrent{
c: c.c,
hash: hash,
}
if !t.Exists() {
return nil, errors.Errorf("torrent not exist: %v", hash)
}
return t, nil
}
func NewTorrent(info Info, link string) (*Torrent, error) {
magnet, err := utils.Link2Magnet(link)
if err != nil {
return nil, errors.Errorf("converting link to magnet error, link: %v, error: %v", link, err)
@@ -113,8 +91,14 @@ func NewTorrent(info Info, link string) (*Torrent, error) {
if err != nil {
return nil, err
}
return NewTorrentHash(info, hash)
t := &Torrent{
c: c.c,
hash: hash,
}
if !t.Exists() {
return nil, errors.Errorf("torrent not exist: %v", magnet)
}
return t, nil
}
type Torrent struct {
@@ -218,49 +202,3 @@ func (t *Torrent) SeedRatio() (float64, error) {
}
return qb.Ratio, nil
}
func (t *Torrent) Walk(f func(string) error) error {
files, err := t.c.TorrentFiles(t.hash)
if err != nil {
return err
}
for _, file := range files {
if err := f(file.Name); err != nil {
return errors.Errorf("proccess file (%s) error: %v", file.Name, err)
}
}
return nil
}
func (t *Torrent) WalkFunc() func(fn func(path string, info fs.FileInfo) error) error {
files, err := t.c.TorrentFiles(t.hash)
if err != nil {
return func(fn func(path string, info fs.FileInfo) error) error {
return err
}
}
t1, err := t.getTorrent()
if err != nil {
return func(fn func(path string, info fs.FileInfo) error) error {
return err
}
}
return func(fn func(path string, info fs.FileInfo) error) error {
for _, file := range files {
name := filepath.Join(t1.SavePath, file.Name)
info, err := os.Stat(name)
if err != nil {
return err
}
if err := fn(name, info); err != nil {
return errors.Errorf("proccess file (%s) error: %v", file.Name, err)
}
}
return nil
}
}

View File

@@ -11,17 +11,10 @@ func Test1(t *testing.T) {
log.Errorf("new client error: %v", err)
t.Fail()
}
log.Infof("new client success: %v", c)
port, err := c.GetListenPort()
if err != nil {
log.Errorf("get listen port error: %v", err)
t.Fail()
} else {
log.Infof("listen port: %d", port)
err := c.SetListenPort(port + 1)
if err!= nil {
log.Errorf("set listen port error: %v", err)
t.Fail()
}
all, err := c.GetAll()
for _, t := range all {
name, _ := t.Name()
log.Infof("torrent: %+v", name)
}
}

View File

@@ -3,6 +3,7 @@ package storage
import (
"io"
"io/fs"
"os"
"path/filepath"
"polaris/pkg/alist"
@@ -27,7 +28,14 @@ type Alist struct {
subtitleFormats []string
}
func (a *Alist) Copy(src, dest string, walkFn WalkFn) error {
func (a *Alist) Move(src, dest string) error {
if err := a.Copy(src, dest); err != nil {
return err
}
return os.RemoveAll(src)
}
func (a *Alist) Copy(src, dest string) error {
b, err := NewBase(src, a.videoFormats, a.subtitleFormats)
if err != nil {
return err
@@ -43,7 +51,7 @@ func (a *Alist) Copy(src, dest string, walkFn WalkFn) error {
}
baseDest := filepath.Join(a.baseDir, dest)
return b.Upload(baseDest, false, false, false, uploadFunc, mkdirFunc, walkFn)
return b.Upload(baseDest, false, false, false, uploadFunc, mkdirFunc)
}
func (a *Alist) ReadDir(dir string) ([]fs.FileInfo, error) {
@@ -67,4 +75,4 @@ func (a *Alist) UploadProgress() float64 {
func (a *Alist) RemoveAll(path string) error {
return nil
}
}

View File

@@ -13,10 +13,9 @@ import (
"github.com/pkg/errors"
)
type WalkFn func(fn func(path string, info fs.FileInfo) error) error
type Storage interface {
//Move(src, dest string) error
Copy(src, dest string, walkFn WalkFn) error
Move(src, dest string) error
Copy(src, dest string) error
ReadDir(dir string) ([]fs.FileInfo, error)
ReadFile(string) ([]byte, error)
WriteFile(string, []byte) error
@@ -80,7 +79,7 @@ func (b *Base) isFileNeeded(name string) bool {
}
func (b *Base) Upload(destDir string, tryLink, detectMime, changeMediaHash bool, upload uploadFunc, mkdir func(string) error, walkFn WalkFn) error {
func (b *Base) Upload(destDir string, tryLink, detectMime, changeMediaHash bool, upload uploadFunc, mkdir func(string) error) error {
if !b.checkVideoFilesExist() {
return errors.Errorf("torrent has no video file(s)")
}
@@ -96,20 +95,15 @@ func (b *Base) Upload(destDir string, tryLink, detectMime, changeMediaHash bool,
}
log.Debugf("local storage target base dir is: %v", targetBase)
err = walkFn(func(path string, info fs.FileInfo) (err error) {
err = filepath.Walk(b.src, func(path string, info fs.FileInfo, err error) error {
if err != nil {
return err
}
rel, err := filepath.Rel(b.src, path)
if err != nil {
return errors.Wrapf(err, "relation between %s and %s", b.src, path)
}
destName := filepath.Clean(filepath.Join(targetBase, rel))
if !strings.HasPrefix(destName, targetBase) {
//如果目标路径不是在目标目录下,则报错
return errors.Errorf("destination: %s is not in target dir: %s", destName, targetBase)
}
destName := filepath.Join(targetBase, rel)
if info.IsDir() {
mkdir(destName)
@@ -118,13 +112,6 @@ func (b *Base) Upload(destDir string, tryLink, detectMime, changeMediaHash bool,
log.Debugf("file is not needed, skip: %s", info.Name())
return nil
}
defer func () {
if err == nil {
log.Infof("copy file success, filename %s, destination %s", rel, destName)
}
}()
if tryLink {
if err := os.Link(path, destName); err == nil {
return nil //link success

View File

@@ -6,7 +6,6 @@ import (
"io/ioutil"
"os"
"path/filepath"
"polaris/log"
"github.com/gabriel-vasile/mimetype"
"github.com/pkg/errors"
@@ -23,7 +22,7 @@ type LocalStorage struct {
subtitleFormats []string
}
func (l *LocalStorage) Copy(src, destDir string,walkFn WalkFn) error {
func (l *LocalStorage) Copy(src, destDir string) error {
b, err := NewBase(src, l.videoFormats, l.subtitleFormats)
if err != nil {
return err
@@ -31,13 +30,6 @@ func (l *LocalStorage) Copy(src, destDir string,walkFn WalkFn) error {
baseDest := filepath.Join(l.dir, destDir)
uploadFunc := func(destPath string, destInfo fs.FileInfo, srcReader io.Reader, mimeType *mimetype.MIME) error {
baseDir := filepath.Dir(destPath)
if _, err := os.Stat(baseDir); os.IsNotExist(err) {
if err := os.MkdirAll(baseDir, os.ModePerm); err != nil {
return errors.Wrapf(err, "create dir %s", baseDir)
}
log.Infof("create local dir %s", baseDir)
}
if writer, err := os.OpenFile(destPath, os.O_RDWR|os.O_CREATE|os.O_TRUNC, os.ModePerm); err != nil {
return errors.Wrapf(err, "create file %s", destPath)
} else {
@@ -52,7 +44,14 @@ func (l *LocalStorage) Copy(src, destDir string,walkFn WalkFn) error {
}
return b.Upload(baseDest, true, false, false, uploadFunc, func(s string) error {
return os.Mkdir(s, os.ModePerm)
}, walkFn)
})
}
func (l *LocalStorage) Move(src, destDir string) error {
if err := l.Copy(src, destDir); err != nil {
return err
}
return os.RemoveAll(src)
}
func (l *LocalStorage) ReadDir(dir string) ([]fs.FileInfo, error) {

View File

@@ -34,7 +34,7 @@ func NewWebdavStorage(url, user, password, path string, changeMediaHash bool, vi
}, nil
}
func (w *WebdavStorage) Copy(local, remoteDir string, walkFn WalkFn) error {
func (w *WebdavStorage) Copy(local, remoteDir string) error {
b, err := NewBase(local, w.videoFormats, w.subtitleFormats)
if err != nil {
return err
@@ -57,7 +57,14 @@ func (w *WebdavStorage) Copy(local, remoteDir string, walkFn WalkFn) error {
return b.Upload(filepath.Join(w.dir, remoteDir), false, true, w.changeMediaHash, uploadFunc, func(s string) error {
return nil
}, walkFn)
})
}
func (w *WebdavStorage) Move(local, remoteDir string) error {
if err := w.Copy(local, remoteDir); err != nil {
return err
}
return os.RemoveAll(local)
}
func (w *WebdavStorage) ReadDir(dir string) ([]fs.FileInfo, error) {

Some files were not shown because too many files have changed in this diff Show More