Skip to content

Commit 01c8dc1

Browse files
authored
Merge pull request #134 from RA341/main
fix autobuy
2 parents fe88884 + 4f86662 commit 01c8dc1

File tree

13 files changed

+294
-214
lines changed

13 files changed

+294
-214
lines changed

Dockerfile

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,4 @@
1-
FROM debian:13-slim AS flutter_builder
2-
3-
ENV DEBIAN_FRONTEND=noninteractive
4-
5-
RUN apt-get update && apt-get install -y \
6-
git \
7-
curl \
8-
unzip \
9-
xz-utils \
10-
&& rm -rf /var/lib/apt/lists/*
11-
12-
ENV FLUTTER_VERSION=3.35.4
13-
RUN git clone https://github.com/flutter/flutter.git -b stable /flutter
14-
ENV PATH="/flutter/bin:${PATH}"
1+
FROM ghcr.io/ra341/dfw:latest AS flutter_builder
152

163
WORKDIR /web/
174

core/go.mod

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ require (
2525
google.golang.org/protobuf v1.36.10
2626
gopkg.in/natefinch/lumberjack.v2 v2.2.1
2727
gorm.io/driver/sqlite v1.6.0
28-
gorm.io/gorm v1.31.0
28+
gorm.io/gorm v1.31.1
2929
resty.dev/v3 v3.0.0-beta.3
3030
)
3131

@@ -42,7 +42,7 @@ require (
4242
github.com/davecgh/go-spew v1.1.1 // indirect
4343
github.com/distribution/reference v0.6.0 // indirect
4444
github.com/docker/go-units v0.5.0 // indirect
45-
github.com/ebitengine/purego v0.8.4 // indirect
45+
github.com/ebitengine/purego v0.9.0 // indirect
4646
github.com/fatih/color v1.18.0 // indirect
4747
github.com/felixge/httpsnoop v1.0.4 // indirect
4848
github.com/getlantern/context v0.0.0-20220418194847-3d5e7a086201 // indirect
@@ -57,11 +57,11 @@ require (
5757
github.com/go-stack/stack v1.8.1 // indirect
5858
github.com/google/uuid v1.6.0 // indirect
5959
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
60-
github.com/hekmon/cunits/v2 v2.1.0 // indirect
60+
github.com/hekmon/cunits/v2 v2.1.1 // indirect
6161
github.com/jinzhu/inflection v1.0.0 // indirect
6262
github.com/jinzhu/now v1.1.5 // indirect
63-
github.com/klauspost/compress v1.18.0 // indirect
64-
github.com/lufia/plan9stats v0.0.0-20250827001030-24949be3fa54 // indirect
63+
github.com/klauspost/compress v1.18.1 // indirect
64+
github.com/lufia/plan9stats v0.0.0-20251013123823-9fd1530e3ec3 // indirect
6565
github.com/magiconair/properties v1.8.10 // indirect
6666
github.com/mattn/go-colorable v0.1.14 // indirect
6767
github.com/mattn/go-isatty v0.0.20 // indirect
@@ -80,8 +80,8 @@ require (
8080
github.com/pkg/errors v0.9.1 // indirect
8181
github.com/pmezard/go-difflib v1.0.0 // indirect
8282
github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 // indirect
83-
github.com/shirou/gopsutil/v4 v4.25.8 // indirect
84-
github.com/shoenig/go-m1cpu v0.1.6 // indirect
83+
github.com/shirou/gopsutil/v4 v4.25.10 // indirect
84+
github.com/shoenig/go-m1cpu v0.1.7 // indirect
8585
github.com/sirupsen/logrus v1.9.3 // indirect
8686
github.com/tklauser/go-sysconf v0.3.15 // indirect
8787
github.com/tklauser/numcpus v0.10.0 // indirect

core/go.sum

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4
4141
github.com/docker/go-units v0.5.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk=
4242
github.com/ebitengine/purego v0.8.4 h1:CF7LEKg5FFOsASUj0+QwaXf8Ht6TlFxg09+S9wz0omw=
4343
github.com/ebitengine/purego v0.8.4/go.mod h1:iIjxzd6CiRiOG0UyXP+V1+jWqUXVjPKLAI0mRfJZTmQ=
44+
github.com/ebitengine/purego v0.9.0 h1:mh0zpKBIXDceC63hpvPuGLiJ8ZAa3DfrFTudmfi8A4k=
45+
github.com/ebitengine/purego v0.9.0/go.mod h1:iIjxzd6CiRiOG0UyXP+V1+jWqUXVjPKLAI0mRfJZTmQ=
4446
github.com/fatih/color v1.18.0 h1:S8gINlzdQ840/4pfAwic/ZE0djQEH3wM94VfqLTZcOM=
4547
github.com/fatih/color v1.18.0/go.mod h1:4FelSpRwEGDpQ12mAdzqdOukCy4u8WUtOY6lkT/6HfU=
4648
github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg=
@@ -101,6 +103,8 @@ github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9n
101103
github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48=
102104
github.com/hekmon/cunits/v2 v2.1.0 h1:k6wIjc4PlacNOHwKEMBgWV2/c8jyD4eRMs5mR1BBhI0=
103105
github.com/hekmon/cunits/v2 v2.1.0/go.mod h1:9r1TycXYXaTmEWlAIfFV8JT+Xo59U96yUJAYHxzii2M=
106+
github.com/hekmon/cunits/v2 v2.1.1 h1:E7RWES+bIJX8SK8EO7WmQ9xz5SnXVZ43I04yDqIHU2g=
107+
github.com/hekmon/cunits/v2 v2.1.1/go.mod h1:9r1TycXYXaTmEWlAIfFV8JT+Xo59U96yUJAYHxzii2M=
104108
github.com/hekmon/transmissionrpc/v3 v3.0.0 h1:0Fb11qE0IBh4V4GlOwHNYpqpjcYDp5GouolwrpmcUDQ=
105109
github.com/hekmon/transmissionrpc/v3 v3.0.0/go.mod h1:38SlNhFzinVUuY87wGj3acOmRxeYZAZfrj6Re7UgCDg=
106110
github.com/jackpal/bencode-go v1.0.2 h1:LcCNfZ344u0LpBPOZNjpCLps/wUOuN4r87Fy9+5yU8g=
@@ -115,6 +119,8 @@ github.com/joho/godotenv v1.5.1 h1:7eLL/+HRGLY0ldzfGMeQkb7vMd0as4CfYvUVzLqw0N0=
115119
github.com/joho/godotenv v1.5.1/go.mod h1:f4LDr5Voq0i2e/R5DDNOoa2zzDfwtkZa6DnEwAbqwq4=
116120
github.com/klauspost/compress v1.18.0 h1:c/Cqfb0r+Yi+JtIEq73FWXVkRonBlf0CRNYc8Zttxdo=
117121
github.com/klauspost/compress v1.18.0/go.mod h1:2Pp+KzxcywXVXMr50+X0Q/Lsb43OQHYWRCY2AiWywWQ=
122+
github.com/klauspost/compress v1.18.1 h1:bcSGx7UbpBqMChDtsF28Lw6v/G94LPrrbMbdC3JH2co=
123+
github.com/klauspost/compress v1.18.1/go.mod h1:ZQFFVG+MdnR0P+l6wpXgIL4NTtwiKIdBnrBd8Nrxr+0=
118124
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
119125
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
120126
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
@@ -124,6 +130,8 @@ github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
124130
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
125131
github.com/lufia/plan9stats v0.0.0-20250827001030-24949be3fa54 h1:mFWunSatvkQQDhpdyuFAYwyAan3hzCuma+Pz8sqvOfg=
126132
github.com/lufia/plan9stats v0.0.0-20250827001030-24949be3fa54/go.mod h1:autxFIvghDt3jPTLoqZ9OZ7s9qTGNAWmYCjVFWPX/zg=
133+
github.com/lufia/plan9stats v0.0.0-20251013123823-9fd1530e3ec3 h1:PwQumkgq4/acIiZhtifTV5OUqqiP82UAl0h87xj/l9k=
134+
github.com/lufia/plan9stats v0.0.0-20251013123823-9fd1530e3ec3/go.mod h1:autxFIvghDt3jPTLoqZ9OZ7s9qTGNAWmYCjVFWPX/zg=
127135
github.com/lxn/walk v0.0.0-20210112085537-c389da54e794/go.mod h1:E23UucZGqpuUANJooIbHWCufXvOcT6E7Stq81gU+CSQ=
128136
github.com/lxn/win v0.0.0-20210218163916-a377121e959e/go.mod h1:KxxjdtRkfNoYDCUP5ryK7XJJNTnpC8atvtmTheChOtk=
129137
github.com/magiconair/properties v1.8.10 h1:s31yESBquKXCV9a/ScB3ESkOjUYYv+X0rg8SYxI99mE=
@@ -185,10 +193,15 @@ github.com/shirou/gopsutil/v3 v3.24.5 h1:i0t8kL+kQTvpAYToeuiVk3TgDeKOFioZO3Ztz/i
185193
github.com/shirou/gopsutil/v3 v3.24.5/go.mod h1:bsoOS1aStSs9ErQ1WWfxllSeS1K5D+U30r2NfcubMVk=
186194
github.com/shirou/gopsutil/v4 v4.25.8 h1:NnAsw9lN7587WHxjJA9ryDnqhJpFH6A+wagYWTOH970=
187195
github.com/shirou/gopsutil/v4 v4.25.8/go.mod h1:q9QdMmfAOVIw7a+eF86P7ISEU6ka+NLgkUxlopV4RwI=
196+
github.com/shirou/gopsutil/v4 v4.25.10 h1:at8lk/5T1OgtuCp+AwrDofFRjnvosn0nkN2OLQ6g8tA=
197+
github.com/shirou/gopsutil/v4 v4.25.10/go.mod h1:+kSwyC8DRUD9XXEHCAFjK+0nuArFJM0lva+StQAcskM=
188198
github.com/shoenig/go-m1cpu v0.1.6 h1:nxdKQNcEB6vzgA2E2bvzKIYRuNj7XNJ4S/aRSwKzFtM=
189199
github.com/shoenig/go-m1cpu v0.1.6/go.mod h1:1JJMcUBvfNwpq05QDQVAnx3gUHr9IYF7GNg9SUEw2VQ=
200+
github.com/shoenig/go-m1cpu v0.1.7 h1:C76Yd0ObKR82W4vhfjZiCp0HxcSZ8Nqd84v+HZ0qyI0=
201+
github.com/shoenig/go-m1cpu v0.1.7/go.mod h1:KkDOw6m3ZJQAPHbrzkZki4hnx+pDRR1Lo+ldA56wD5w=
190202
github.com/shoenig/test v0.6.4 h1:kVTaSd7WLz5WZ2IaoM0RSzRsUD+m8wRR+5qvntpn4LU=
191203
github.com/shoenig/test v0.6.4/go.mod h1:byHiCGXqrVaflBLAMq/srcZIHynQPQgeyvkvXnjqq0k=
204+
github.com/shoenig/test v1.7.0 h1:eWcHtTXa6QLnBvm0jgEabMRN/uJ4DMV3M8xUGgRkZmk=
192205
github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ=
193206
github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=
194207
github.com/skratchdot/open-golang v0.0.0-20200116055534-eef842397966/go.mod h1:sUM3LWHvSMaG192sy56D9F7CNvL7jUJVXoqM1QKLnog=
@@ -315,6 +328,8 @@ gorm.io/driver/sqlite v1.6.0 h1:WHRRrIiulaPiPFmDcod6prc4l2VGVWHz80KspNsxSfQ=
315328
gorm.io/driver/sqlite v1.6.0/go.mod h1:AO9V1qIQddBESngQUKWL9yoH93HIeA1X6V633rBwyT8=
316329
gorm.io/gorm v1.31.0 h1:0VlycGreVhK7RF/Bwt51Fk8v0xLiiiFdbGDPIZQ7mJY=
317330
gorm.io/gorm v1.31.0/go.mod h1:XyQVbO2k6YkOis7C2437jSit3SsDK72s7n7rsSHd+Gs=
331+
gorm.io/gorm v1.31.1 h1:7CA8FTFz/gRfgqgpeKIBcervUn3xSyPUmr6B2WXJ7kg=
332+
gorm.io/gorm v1.31.1/go.mod h1:XyQVbO2k6YkOis7C2437jSit3SsDK72s7n7rsSHd+Gs=
318333
gotest.tools/v3 v3.5.2 h1:7koQfIKdy+I8UTetycgUqXWSDwpgv193Ka+qRsmBY8Q=
319334
gotest.tools/v3 v3.5.2/go.mod h1:LtdLGcnqToBH83WByAAi/wiwSFCArdFIUV/xxN4pcjA=
320335
resty.dev/v3 v3.0.0-beta.3 h1:3kEwzEgCnnS6Ob4Emlk94t+I/gClyoah7SnNi67lt+E=

core/internal/app/app.go

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -43,26 +43,27 @@ func NewApp(conf *sc.GoudaConfig) *App {
4343

4444
authSrv := auth.NewService(db, db)
4545
catSrv := category.NewService(db)
46-
mamSrv := mam.NewService(func() sc.MamConfig {
47-
return conf.GetVal().Mam
48-
})
46+
mamSrv := mam.NewService(
47+
func() *sc.MamConfig {
48+
return &conf.Load().Mam
49+
},
50+
func() *sc.Logger {
51+
return &conf.Load().Log
52+
},
53+
)
4954
downloadSrv := downloads.NewService(
5055
db,
5156
func() *sc.TorrentClient {
52-
val := conf.GetVal().TorrentClient
53-
return &val
57+
return &conf.Load().TorrentClient
5458
},
5559
func() *sc.UserPermissions {
56-
val := conf.GetVal().Permissions
57-
return &val
60+
return &conf.Load().Permissions
5861
},
5962
func() *sc.Directories {
60-
val := conf.GetVal().Dir
61-
return &val
63+
return &conf.Load().Dir
6264
},
6365
func() *sc.Downloader {
64-
val := conf.GetVal().Downloader
65-
return &val
66+
return &conf.Load().Downloader
6667
},
6768
)
6869

core/internal/downloads/service.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ func (d *Service) TestAndUpdateClient() error {
8282
func (d *Service) TestClient(client *sc.TorrentClient) (dc.DownloadClient, error) {
8383
newClient, err := dc.TestTorrentClient(client)
8484
if err != nil {
85-
return nil, fmt.Errorf("unable to connect torrent torrentClient: %v", err)
85+
return nil, fmt.Errorf("unable to connect torrent client: %w", err)
8686
}
8787
return newClient, nil
8888
}

core/internal/mam/background.go

Lines changed: 0 additions & 131 deletions
This file was deleted.

core/internal/mam/background_test.go

Lines changed: 0 additions & 19 deletions
This file was deleted.

core/internal/mam/handler.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ func NewHandler(srv *Service) *Handler {
1818
}
1919

2020
func (h *Handler) IsMamSetup(context.Context, *connect.Request[v1.IsMamSetupRequest]) (*connect.Response[v1.IsMamSetupResponse], error) {
21-
if h.srv.provider().MamToken == "" {
21+
if h.srv.conf().MamToken == "" {
2222
return nil, fmt.Errorf("mam key not set")
2323
}
2424

0 commit comments

Comments
 (0)