From 1f462190c1f830a10ec7c729b41d916433ee1bdd Mon Sep 17 00:00:00 2001 From: WithoutPants <53250216+WithoutPants@users.noreply.github.com> Date: Fri, 18 Oct 2024 17:23:16 +1100 Subject: [PATCH] Upgrade gqlgenc and regenerate stash-box client --- go.mod | 34 +- go.sum | 30 + internal/api/server.go | 3 +- internal/manager/task_scan.go | 4 +- .../stashbox/graphql/generated_client.go | 1413 ++++++++++++----- .../stashbox/graphql/generated_models.go | 193 ++- pkg/scraper/stashbox/stash_box.go | 15 +- 7 files changed, 1186 insertions(+), 506 deletions(-) diff --git a/go.mod b/go.mod index 7f7d6170332..445584bfa4d 100644 --- a/go.mod +++ b/go.mod @@ -1,11 +1,13 @@ module github.com/stashapp/stash -go 1.22 +go 1.22.5 + +toolchain go1.22.8 require ( - github.com/99designs/gqlgen v0.17.49 + github.com/99designs/gqlgen v0.17.55 github.com/WithoutPants/sortorder v0.0.0-20230616003020-921c9ef69552 - github.com/Yamashou/gqlgenc v0.0.6 + github.com/Yamashou/gqlgenc v0.25.3 github.com/anacrolix/dms v1.2.2 github.com/antchfx/htmlquery v1.3.0 github.com/asticode/go-astisub v0.25.1 @@ -47,27 +49,27 @@ require ( github.com/tidwall/gjson v1.16.0 github.com/vearutop/statigz v1.4.0 github.com/vektah/dataloaden v0.3.0 - github.com/vektah/gqlparser/v2 v2.5.16 + github.com/vektah/gqlparser/v2 v2.5.18 github.com/vektra/mockery/v2 v2.10.0 github.com/xWTF/chardet v0.0.0-20230208095535-c780f2ac244e github.com/zencoder/go-dash/v3 v3.0.2 - golang.org/x/crypto v0.24.0 + golang.org/x/crypto v0.28.0 golang.org/x/image v0.18.0 - golang.org/x/net v0.26.0 - golang.org/x/sys v0.21.0 - golang.org/x/term v0.21.0 - golang.org/x/text v0.16.0 + golang.org/x/net v0.30.0 + golang.org/x/sys v0.26.0 + golang.org/x/term v0.25.0 + golang.org/x/text v0.19.0 gopkg.in/guregu/null.v4 v4.0.0 gopkg.in/yaml.v2 v2.4.0 ) require ( - github.com/agnivade/levenshtein v1.1.1 // indirect + github.com/agnivade/levenshtein v1.2.0 // indirect github.com/antchfx/xpath v1.2.3 // indirect github.com/asticode/go-astikit v0.20.0 // indirect github.com/asticode/go-astits v1.8.0 // indirect github.com/chromedp/sysutil v1.0.0 // indirect - github.com/cpuguy83/go-md2man/v2 v2.0.4 // indirect + github.com/cpuguy83/go-md2man/v2 v2.0.5 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/dlclark/regexp2 v1.7.0 // indirect github.com/fsnotify/fsnotify v1.6.0 // indirect @@ -108,12 +110,12 @@ require ( github.com/subosito/gotenv v1.6.0 // indirect github.com/tidwall/match v1.1.1 // indirect github.com/tidwall/pretty v1.2.1 // indirect - github.com/urfave/cli/v2 v2.27.2 // indirect - github.com/xrash/smetrics v0.0.0-20240312152122-5f08fbb34913 // indirect + github.com/urfave/cli/v2 v2.27.5 // indirect + github.com/xrash/smetrics v0.0.0-20240521201337-686a1a2994c1 // indirect go.uber.org/atomic v1.11.0 // indirect - golang.org/x/mod v0.18.0 // indirect - golang.org/x/sync v0.7.0 // indirect - golang.org/x/tools v0.22.0 // indirect + golang.org/x/mod v0.21.0 // indirect + golang.org/x/sync v0.8.0 // indirect + golang.org/x/tools v0.26.0 // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index 8c3b00d61f8..29d5d125319 100644 --- a/go.sum +++ b/go.sum @@ -54,6 +54,8 @@ filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4 github.com/99designs/gqlgen v0.17.2/go.mod h1:K5fzLKwtph+FFgh9j7nFbRUdBKvTcGnsta51fsMTn3o= github.com/99designs/gqlgen v0.17.49 h1:b3hNGexHd33fBSAd4NDT/c3NCcQzcAVkknhN9ym36YQ= github.com/99designs/gqlgen v0.17.49/go.mod h1:tC8YFVZMed81x7UJ7ORUwXF4Kn6SXuucFqQBhN8+BU0= +github.com/99designs/gqlgen v0.17.55 h1:3vzrNWYyzSZjGDFo68e5j9sSauLxfKvLp+6ioRokVtM= +github.com/99designs/gqlgen v0.17.55/go.mod h1:3Bq768f8hgVPGZxL8aY9MaYmbxa6llPM/qu1IGH1EJo= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/DATA-DOG/go-sqlmock v1.5.0 h1:Shsta01QNfFxHCfpW6YH2STWB0MudeXXEWMr20OEh60= @@ -67,10 +69,14 @@ github.com/WithoutPants/sortorder v0.0.0-20230616003020-921c9ef69552 h1:eukVk+mG github.com/WithoutPants/sortorder v0.0.0-20230616003020-921c9ef69552/go.mod h1:LKbO1i6L1lSlwWx4NHWVECxubHNKFz2YQoEMGXAFVy8= github.com/Yamashou/gqlgenc v0.0.6 h1:wfMTtuVSrX2N1z5/ssecxx+E7l1fa0FOq5mwFW47oY4= github.com/Yamashou/gqlgenc v0.0.6/go.mod h1:WOXjogecRGpD1WKgxnnyHJo0/Dxn44p/LNRoE6mtFQo= +github.com/Yamashou/gqlgenc v0.25.3 h1:mVV8/Ho8EDZUQKQZbQqqXGNq8jc8aQfPpHhZOnTkMNE= +github.com/Yamashou/gqlgenc v0.25.3/go.mod h1:G0g1N81xpIklVdnyboW1zwOHcj/n4hNfhTwfN29Rjig= github.com/agnivade/levenshtein v1.0.1/go.mod h1:CURSv5d9Uaml+FovSIICkLbAUZ9S4RqaHDIsdSBg7lM= github.com/agnivade/levenshtein v1.1.0/go.mod h1:veldBMzWxcCG2ZvUTKD2kJNRdCk5hVbJomOvKkmgYbo= github.com/agnivade/levenshtein v1.1.1 h1:QY8M92nrzkmr798gCo3kmMyqXFzdQVpxLlGPRBij0P8= github.com/agnivade/levenshtein v1.1.1/go.mod h1:veldBMzWxcCG2ZvUTKD2kJNRdCk5hVbJomOvKkmgYbo= +github.com/agnivade/levenshtein v1.2.0 h1:U9L4IOT0Y3i0TIlUIDJ7rVUziKi/zPbrJGaFrtYH3SY= +github.com/agnivade/levenshtein v1.2.0/go.mod h1:QVVI16kDrtSuwcpd0p1+xMC6Z/VfhtCyDIjcwga4/DU= 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= @@ -166,6 +172,8 @@ github.com/cpuguy83/go-md2man/v2 v2.0.1/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46t github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/cpuguy83/go-md2man/v2 v2.0.4 h1:wfIWP927BUkWJb2NmU/kNDYIBTh/ziUX91+lVfRxZq4= github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= +github.com/cpuguy83/go-md2man/v2 v2.0.5 h1:ZtcqGrnekaHpVLArFSe4HK5DoKx1T0rq2DwVB0alcyc= +github.com/cpuguy83/go-md2man/v2 v2.0.5/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= @@ -667,6 +675,8 @@ github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqri github.com/urfave/cli/v2 v2.3.0/go.mod h1:LJmUH05zAU44vOAcrfzZQKsZbVcdbOG8rtL3/XcUArI= github.com/urfave/cli/v2 v2.27.2 h1:6e0H+AkS+zDckwPCUrZkKX38mRaau4nL2uipkJpbkcI= github.com/urfave/cli/v2 v2.27.2/go.mod h1:g0+79LmHHATl7DAcHO99smiR/T7uGLw84w8Y42x+4eM= +github.com/urfave/cli/v2 v2.27.5 h1:WoHEJLdsXr6dDWoJgMq/CboDmyY/8HMMH1fTECbih+w= +github.com/urfave/cli/v2 v2.27.5/go.mod h1:3Sevf16NykTbInEnD0yKkjDAeZDS0A6bzhBH5hrMvTQ= github.com/vearutop/statigz v1.4.0 h1:RQL0KG3j/uyA/PFpHeZ/L6l2ta920/MxlOAIGEOuwmU= github.com/vearutop/statigz v1.4.0/go.mod h1:LYTolBLiz9oJISwiVKnOQoIwhO1LWX1A7OECawGS8XE= github.com/vektah/dataloaden v0.3.0 h1:ZfVN2QD6swgvp+tDqdH/OIT/wu3Dhu0cus0k5gIZS84= @@ -675,6 +685,8 @@ github.com/vektah/gqlparser/v2 v2.4.0/go.mod h1:flJWIR04IMQPGz+BXLrORkrARBxv/rty github.com/vektah/gqlparser/v2 v2.4.1/go.mod h1:flJWIR04IMQPGz+BXLrORkrARBxv/rtyIAFvd/MceW0= github.com/vektah/gqlparser/v2 v2.5.16 h1:1gcmLTvs3JLKXckwCwlUagVn/IlV2bwqle0vJ0vy5p8= github.com/vektah/gqlparser/v2 v2.5.16/go.mod h1:1lz1OeCqgQbQepsGxPVywrjdBHW2T08PUS3pJqepRww= +github.com/vektah/gqlparser/v2 v2.5.18 h1:zSND3GtutylAQ1JpWnTHcqtaRZjl+y3NROeW8vuNo6Y= +github.com/vektah/gqlparser/v2 v2.5.18/go.mod h1:6HLzf7JKv9Fi3APymudztFQNmLXR5qJeEo6BOFcXVfc= github.com/vektra/mockery/v2 v2.10.0 h1:MiiQWxwdq7/ET6dCXLaJzSGEN17k758H7JHS9kOdiks= github.com/vektra/mockery/v2 v2.10.0/go.mod h1:m/WO2UzWzqgVX3nvqpRQq70I4Z7jbSCRhdmkgtp+Ab4= github.com/willf/bitset v1.1.9/go.mod h1:RjeCKbqT1RxIR/KWY6phxZiaY1IyutSBfGjNPySAYV4= @@ -682,6 +694,8 @@ github.com/xWTF/chardet v0.0.0-20230208095535-c780f2ac244e h1:GruPsb+44XvYAzuAgJ github.com/xWTF/chardet v0.0.0-20230208095535-c780f2ac244e/go.mod h1:wA8kQ8WFipMciY9WcWzqQgZordm/P7l8IZdvx1crwmc= github.com/xrash/smetrics v0.0.0-20240312152122-5f08fbb34913 h1:+qGGcbkzsfDQNPPe9UDgpxAWQrhbbBXOYJFQDq/dtJw= github.com/xrash/smetrics v0.0.0-20240312152122-5f08fbb34913/go.mod h1:4aEEwZQutDLsQv2Deui4iYQ6DWTxR14g6m8Wv88+Xqk= +github.com/xrash/smetrics v0.0.0-20240521201337-686a1a2994c1 h1:gEOO8jv9F4OT7lGCjxCBTO/36wtF6j2nSip77qHd4x4= +github.com/xrash/smetrics v0.0.0-20240521201337-686a1a2994c1/go.mod h1:Ohn+xnUBiLI6FVj/9LpzZWtj1/D6lUovWYBkxHVV3aM= github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= @@ -730,6 +744,8 @@ golang.org/x/crypto v0.0.0-20220112180741-5e0467b6c7ce/go.mod h1:IxCIyHEi3zRg3s0 golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.24.0 h1:mnl8DM0o513X8fdIkmyFE/5hTYxbwYOjDS/+rK6qpRI= golang.org/x/crypto v0.24.0/go.mod h1:Z1PMYSOR5nyMcyAVAIQSKCDwalqy85Aqn1x3Ws4L5DM= +golang.org/x/crypto v0.28.0 h1:GBDwsMXVQi34v5CCYUm2jkJvu4cbtru2U4TN2PSyQnw= +golang.org/x/crypto v0.28.0/go.mod h1:rmgy+3RHxRZMyY0jjAJShp2zgEdOqj2AO7U0pYmeQ7U= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -774,6 +790,8 @@ golang.org/x/mod v0.6.0-dev.0.20220106191415-9b9b3d81d5e3/go.mod h1:3p9vT2HGsQu2 golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.18.0 h1:5+9lSbEzPSdWkH32vYPBwEpX8KwDbM52Ud9xBUvNlb0= golang.org/x/mod v0.18.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/mod v0.21.0 h1:vvrHzRwRfVKSiLrG+d4FMl/Qi4ukBCE6kZlTUkDYRT0= +golang.org/x/mod v0.21.0/go.mod h1:6SkKJ3Xj0I0BrPOZoBy3bdMptDDU9oJrpohJ3eWZ1fY= 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-20181023162649-9b4f9f5ad519/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -825,6 +843,8 @@ golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug golang.org/x/net v0.5.0/go.mod h1:DivGGAXEgPSlEBzxGzZI+ZLohi+xUj054jfeKui00ws= golang.org/x/net v0.26.0 h1:soB7SVo0PWrY4vPW/+ay0jKDNScG2X9wFeYlXIvJsOQ= golang.org/x/net v0.26.0/go.mod h1:5YKkiSynbBIh3p6iOc/vibscux0x38BZDkn8sCUPxHE= +golang.org/x/net v0.30.0 h1:AcW1SDZMkb8IpzCdQUaIq2sP4sZ4zw+55h6ynffypl4= +golang.org/x/net v0.30.0/go.mod h1:2wGyMJ5iFasEhkwi13ChkO/t1ECNC4X4eBKkVFyYFlU= 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.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -856,6 +876,8 @@ golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ= +golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= 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= @@ -949,11 +971,15 @@ golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.10.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.21.0 h1:rF+pYz3DAGSQAxAu1CbC7catZg4ebC4UIeIhKxBZvws= golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.26.0 h1:KHjCJyddX0LoSTb3J+vWpupP9p0oznkqVk/IfjymZbo= +golang.org/x/sys v0.26.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= 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.4.0/go.mod h1:9P2UbLfCdcvo3p/nzKvsmas4TnlujnuoV9hGgYzW1lQ= golang.org/x/term v0.21.0 h1:WVXCp+/EBEHOj53Rvu+7KiT/iElMrO8ACK16SMZ3jaA= golang.org/x/term v0.21.0/go.mod h1:ooXLefLobQVslOqselCNF4SxFAaoS6KujMbsGzSDmX0= +golang.org/x/term v0.25.0 h1:WtHI/ltw4NvSUig5KARz9h521QvRC8RmF/cuYqifU24= +golang.org/x/term v0.25.0/go.mod h1:RPyXicDX+6vLxogjjRxjgD2TKtmAO6NZBsBRfrOLu7M= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -968,6 +994,8 @@ golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= golang.org/x/text v0.6.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4= golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI= +golang.org/x/text v0.19.0 h1:kTxAhCbGbxhK0IwgSKiMO5awPoDQ0RpfiVYBfK860YM= +golang.org/x/text v0.19.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -1035,6 +1063,8 @@ golang.org/x/tools v0.1.10/go.mod h1:Uh6Zz+xoGYZom868N8YTex3t7RhtHDBrE8Gzo9bV56E golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.22.0 h1:gqSGLZqv+AI9lIQzniJ0nZDRG5GBPsSi+DRNHWNz6yA= golang.org/x/tools v0.22.0/go.mod h1:aCwcsjqvq7Yqt6TNyX7QMU2enbQ/Gt0bo6krSeEri+c= +golang.org/x/tools v0.26.0 h1:v/60pFQmzmT9ExmjDv2gGIfi3OqfKoEP6I5+umXlbnQ= +golang.org/x/tools v0.26.0/go.mod h1:TPVVj70c7JJ3WCazhD8OdXcZg/og+b9+tH/KxylGwH0= 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= diff --git a/internal/api/server.go b/internal/api/server.go index 63a81da7c2e..bce8e6a07d1 100644 --- a/internal/api/server.go +++ b/internal/api/server.go @@ -27,6 +27,7 @@ import ( "github.com/go-chi/httplog" "github.com/gorilla/websocket" "github.com/vearutop/statigz" + "github.com/vektah/gqlparser/v2/ast" "github.com/stashapp/stash/internal/api/loaders" "github.com/stashapp/stash/internal/build" @@ -185,7 +186,7 @@ func Initialize() (*Server, error) { MaxUploadSize: cfg.GetMaxUploadSize(), }) - gqlSrv.SetQueryCache(gqlLru.New(1000)) + gqlSrv.SetQueryCache(gqlLru.New[*ast.QueryDocument](1000)) gqlSrv.Use(gqlExtension.Introspection{}) gqlSrv.SetErrorPresenter(gqlErrorHandler) diff --git a/internal/manager/task_scan.go b/internal/manager/task_scan.go index 48a06d09829..6f7f34b3c9d 100644 --- a/internal/manager/task_scan.go +++ b/internal/manager/task_scan.go @@ -123,7 +123,7 @@ type handlerRequiredFilter struct { GalleryFinder galleryFinder CaptionUpdater video.CaptionUpdater - FolderCache *lru.LRU + FolderCache *lru.LRU[bool] videoFileNamingAlgorithm models.HashAlgorithm } @@ -138,7 +138,7 @@ func newHandlerRequiredFilter(c *config.Config, repo models.Repository) *handler ImageFinder: repo.Image, GalleryFinder: repo.Gallery, CaptionUpdater: repo.File, - FolderCache: lru.New(processes * 2), + FolderCache: lru.New[bool](processes * 2), videoFileNamingAlgorithm: c.GetVideoFileNamingAlgorithm(), } } diff --git a/pkg/scraper/stashbox/graphql/generated_client.go b/pkg/scraper/stashbox/graphql/generated_client.go index b87d70343fa..9b9340239bb 100644 --- a/pkg/scraper/stashbox/graphql/generated_client.go +++ b/pkg/scraper/stashbox/graphql/generated_client.go @@ -6,240 +6,796 @@ import ( "context" "net/http" - "github.com/Yamashou/gqlgenc/client" + "github.com/Yamashou/gqlgenc/clientv2" ) type StashBoxGraphQLClient interface { - FindSceneByFingerprint(ctx context.Context, fingerprint FingerprintQueryInput, httpRequestOptions ...client.HTTPRequestOption) (*FindSceneByFingerprint, error) - FindScenesByFullFingerprints(ctx context.Context, fingerprints []*FingerprintQueryInput, httpRequestOptions ...client.HTTPRequestOption) (*FindScenesByFullFingerprints, error) - FindScenesBySceneFingerprints(ctx context.Context, fingerprints [][]*FingerprintQueryInput, httpRequestOptions ...client.HTTPRequestOption) (*FindScenesBySceneFingerprints, error) - SearchScene(ctx context.Context, term string, httpRequestOptions ...client.HTTPRequestOption) (*SearchScene, error) - SearchPerformer(ctx context.Context, term string, httpRequestOptions ...client.HTTPRequestOption) (*SearchPerformer, error) - FindPerformerByID(ctx context.Context, id string, httpRequestOptions ...client.HTTPRequestOption) (*FindPerformerByID, error) - FindSceneByID(ctx context.Context, id string, httpRequestOptions ...client.HTTPRequestOption) (*FindSceneByID, error) - FindStudio(ctx context.Context, id *string, name *string, httpRequestOptions ...client.HTTPRequestOption) (*FindStudio, error) - SubmitFingerprint(ctx context.Context, input FingerprintSubmission, httpRequestOptions ...client.HTTPRequestOption) (*SubmitFingerprint, error) - Me(ctx context.Context, httpRequestOptions ...client.HTTPRequestOption) (*Me, error) - SubmitSceneDraft(ctx context.Context, input SceneDraftInput, httpRequestOptions ...client.HTTPRequestOption) (*SubmitSceneDraft, error) - SubmitPerformerDraft(ctx context.Context, input PerformerDraftInput, httpRequestOptions ...client.HTTPRequestOption) (*SubmitPerformerDraft, error) + FindSceneByFingerprint(ctx context.Context, fingerprint FingerprintQueryInput, interceptors ...clientv2.RequestInterceptor) (*FindSceneByFingerprint, error) + FindScenesByFullFingerprints(ctx context.Context, fingerprints []*FingerprintQueryInput, interceptors ...clientv2.RequestInterceptor) (*FindScenesByFullFingerprints, error) + FindScenesBySceneFingerprints(ctx context.Context, fingerprints [][]*FingerprintQueryInput, interceptors ...clientv2.RequestInterceptor) (*FindScenesBySceneFingerprints, error) + SearchScene(ctx context.Context, term string, interceptors ...clientv2.RequestInterceptor) (*SearchScene, error) + SearchPerformer(ctx context.Context, term string, interceptors ...clientv2.RequestInterceptor) (*SearchPerformer, error) + FindPerformerByID(ctx context.Context, id string, interceptors ...clientv2.RequestInterceptor) (*FindPerformerByID, error) + FindSceneByID(ctx context.Context, id string, interceptors ...clientv2.RequestInterceptor) (*FindSceneByID, error) + FindStudio(ctx context.Context, id *string, name *string, interceptors ...clientv2.RequestInterceptor) (*FindStudio, error) + SubmitFingerprint(ctx context.Context, input FingerprintSubmission, interceptors ...clientv2.RequestInterceptor) (*SubmitFingerprint, error) + Me(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*Me, error) + SubmitSceneDraft(ctx context.Context, input SceneDraftInput, interceptors ...clientv2.RequestInterceptor) (*SubmitSceneDraft, error) + SubmitPerformerDraft(ctx context.Context, input PerformerDraftInput, interceptors ...clientv2.RequestInterceptor) (*SubmitPerformerDraft, error) } type Client struct { - Client *client.Client -} - -func NewClient(cli *http.Client, baseURL string, options ...client.HTTPRequestOption) StashBoxGraphQLClient { - return &Client{Client: client.NewClient(cli, baseURL, options...)} -} - -type Query struct { - FindPerformer *Performer "json:\"findPerformer\" graphql:\"findPerformer\"" - QueryPerformers QueryPerformersResultType "json:\"queryPerformers\" graphql:\"queryPerformers\"" - FindStudio *Studio "json:\"findStudio\" graphql:\"findStudio\"" - QueryStudios QueryStudiosResultType "json:\"queryStudios\" graphql:\"queryStudios\"" - FindTag *Tag "json:\"findTag\" graphql:\"findTag\"" - QueryTags QueryTagsResultType "json:\"queryTags\" graphql:\"queryTags\"" - FindTagCategory *TagCategory "json:\"findTagCategory\" graphql:\"findTagCategory\"" - QueryTagCategories QueryTagCategoriesResultType "json:\"queryTagCategories\" graphql:\"queryTagCategories\"" - FindScene *Scene "json:\"findScene\" graphql:\"findScene\"" - FindSceneByFingerprint []*Scene "json:\"findSceneByFingerprint\" graphql:\"findSceneByFingerprint\"" - FindScenesByFingerprints []*Scene "json:\"findScenesByFingerprints\" graphql:\"findScenesByFingerprints\"" - FindScenesByFullFingerprints []*Scene "json:\"findScenesByFullFingerprints\" graphql:\"findScenesByFullFingerprints\"" - FindScenesBySceneFingerprints [][]*Scene "json:\"findScenesBySceneFingerprints\" graphql:\"findScenesBySceneFingerprints\"" - QueryScenes QueryScenesResultType "json:\"queryScenes\" graphql:\"queryScenes\"" - FindSite *Site "json:\"findSite\" graphql:\"findSite\"" - QuerySites QuerySitesResultType "json:\"querySites\" graphql:\"querySites\"" - FindEdit *Edit "json:\"findEdit\" graphql:\"findEdit\"" - QueryEdits QueryEditsResultType "json:\"queryEdits\" graphql:\"queryEdits\"" - FindUser *User "json:\"findUser\" graphql:\"findUser\"" - QueryUsers QueryUsersResultType "json:\"queryUsers\" graphql:\"queryUsers\"" - Me *User "json:\"me\" graphql:\"me\"" - SearchPerformer []*Performer "json:\"searchPerformer\" graphql:\"searchPerformer\"" - SearchScene []*Scene "json:\"searchScene\" graphql:\"searchScene\"" - SearchTag []*Tag "json:\"searchTag\" graphql:\"searchTag\"" - FindDraft *Draft "json:\"findDraft\" graphql:\"findDraft\"" - FindDrafts []*Draft "json:\"findDrafts\" graphql:\"findDrafts\"" - QueryExistingScene QueryExistingSceneResult "json:\"queryExistingScene\" graphql:\"queryExistingScene\"" - Version Version "json:\"version\" graphql:\"version\"" - GetConfig StashBoxConfig "json:\"getConfig\" graphql:\"getConfig\"" -} -type Mutation struct { - SceneCreate *Scene "json:\"sceneCreate\" graphql:\"sceneCreate\"" - SceneUpdate *Scene "json:\"sceneUpdate\" graphql:\"sceneUpdate\"" - SceneDestroy bool "json:\"sceneDestroy\" graphql:\"sceneDestroy\"" - PerformerCreate *Performer "json:\"performerCreate\" graphql:\"performerCreate\"" - PerformerUpdate *Performer "json:\"performerUpdate\" graphql:\"performerUpdate\"" - PerformerDestroy bool "json:\"performerDestroy\" graphql:\"performerDestroy\"" - StudioCreate *Studio "json:\"studioCreate\" graphql:\"studioCreate\"" - StudioUpdate *Studio "json:\"studioUpdate\" graphql:\"studioUpdate\"" - StudioDestroy bool "json:\"studioDestroy\" graphql:\"studioDestroy\"" - TagCreate *Tag "json:\"tagCreate\" graphql:\"tagCreate\"" - TagUpdate *Tag "json:\"tagUpdate\" graphql:\"tagUpdate\"" - TagDestroy bool "json:\"tagDestroy\" graphql:\"tagDestroy\"" - UserCreate *User "json:\"userCreate\" graphql:\"userCreate\"" - UserUpdate *User "json:\"userUpdate\" graphql:\"userUpdate\"" - UserDestroy bool "json:\"userDestroy\" graphql:\"userDestroy\"" - ImageCreate *Image "json:\"imageCreate\" graphql:\"imageCreate\"" - ImageDestroy bool "json:\"imageDestroy\" graphql:\"imageDestroy\"" - NewUser *string "json:\"newUser\" graphql:\"newUser\"" - ActivateNewUser *User "json:\"activateNewUser\" graphql:\"activateNewUser\"" - GenerateInviteCode *string "json:\"generateInviteCode\" graphql:\"generateInviteCode\"" - RescindInviteCode bool "json:\"rescindInviteCode\" graphql:\"rescindInviteCode\"" - GrantInvite int "json:\"grantInvite\" graphql:\"grantInvite\"" - RevokeInvite int "json:\"revokeInvite\" graphql:\"revokeInvite\"" - TagCategoryCreate *TagCategory "json:\"tagCategoryCreate\" graphql:\"tagCategoryCreate\"" - TagCategoryUpdate *TagCategory "json:\"tagCategoryUpdate\" graphql:\"tagCategoryUpdate\"" - TagCategoryDestroy bool "json:\"tagCategoryDestroy\" graphql:\"tagCategoryDestroy\"" - SiteCreate *Site "json:\"siteCreate\" graphql:\"siteCreate\"" - SiteUpdate *Site "json:\"siteUpdate\" graphql:\"siteUpdate\"" - SiteDestroy bool "json:\"siteDestroy\" graphql:\"siteDestroy\"" - RegenerateAPIKey string "json:\"regenerateAPIKey\" graphql:\"regenerateAPIKey\"" - ResetPassword bool "json:\"resetPassword\" graphql:\"resetPassword\"" - ChangePassword bool "json:\"changePassword\" graphql:\"changePassword\"" - SceneEdit Edit "json:\"sceneEdit\" graphql:\"sceneEdit\"" - PerformerEdit Edit "json:\"performerEdit\" graphql:\"performerEdit\"" - StudioEdit Edit "json:\"studioEdit\" graphql:\"studioEdit\"" - TagEdit Edit "json:\"tagEdit\" graphql:\"tagEdit\"" - SceneEditUpdate Edit "json:\"sceneEditUpdate\" graphql:\"sceneEditUpdate\"" - PerformerEditUpdate Edit "json:\"performerEditUpdate\" graphql:\"performerEditUpdate\"" - StudioEditUpdate Edit "json:\"studioEditUpdate\" graphql:\"studioEditUpdate\"" - TagEditUpdate Edit "json:\"tagEditUpdate\" graphql:\"tagEditUpdate\"" - EditVote Edit "json:\"editVote\" graphql:\"editVote\"" - EditComment Edit "json:\"editComment\" graphql:\"editComment\"" - ApplyEdit Edit "json:\"applyEdit\" graphql:\"applyEdit\"" - CancelEdit Edit "json:\"cancelEdit\" graphql:\"cancelEdit\"" - SubmitFingerprint bool "json:\"submitFingerprint\" graphql:\"submitFingerprint\"" - SubmitSceneDraft DraftSubmissionStatus "json:\"submitSceneDraft\" graphql:\"submitSceneDraft\"" - SubmitPerformerDraft DraftSubmissionStatus "json:\"submitPerformerDraft\" graphql:\"submitPerformerDraft\"" - DestroyDraft bool "json:\"destroyDraft\" graphql:\"destroyDraft\"" - FavoritePerformer bool "json:\"favoritePerformer\" graphql:\"favoritePerformer\"" - FavoriteStudio bool "json:\"favoriteStudio\" graphql:\"favoriteStudio\"" + Client *clientv2.Client } + +func NewClient(cli *http.Client, baseURL string, options *clientv2.Options, interceptors ...clientv2.RequestInterceptor) StashBoxGraphQLClient { + return &Client{Client: clientv2.NewClient(cli, baseURL, options, interceptors...)} +} + type URLFragment struct { URL string "json:\"url\" graphql:\"url\"" Type string "json:\"type\" graphql:\"type\"" } + +func (t *URLFragment) GetURL() string { + if t == nil { + t = &URLFragment{} + } + return t.URL +} +func (t *URLFragment) GetType() string { + if t == nil { + t = &URLFragment{} + } + return t.Type +} + type ImageFragment struct { ID string "json:\"id\" graphql:\"id\"" URL string "json:\"url\" graphql:\"url\"" Width int "json:\"width\" graphql:\"width\"" Height int "json:\"height\" graphql:\"height\"" } + +func (t *ImageFragment) GetID() string { + if t == nil { + t = &ImageFragment{} + } + return t.ID +} +func (t *ImageFragment) GetURL() string { + if t == nil { + t = &ImageFragment{} + } + return t.URL +} +func (t *ImageFragment) GetWidth() int { + if t == nil { + t = &ImageFragment{} + } + return t.Width +} +func (t *ImageFragment) GetHeight() int { + if t == nil { + t = &ImageFragment{} + } + return t.Height +} + type StudioFragment struct { - Name string "json:\"name\" graphql:\"name\"" - ID string "json:\"id\" graphql:\"id\"" - Urls []*URLFragment "json:\"urls\" graphql:\"urls\"" - Parent *struct { - Name string "json:\"name\" graphql:\"name\"" - ID string "json:\"id\" graphql:\"id\"" - } "json:\"parent\" graphql:\"parent\"" - Images []*ImageFragment "json:\"images\" graphql:\"images\"" + Name string "json:\"name\" graphql:\"name\"" + ID string "json:\"id\" graphql:\"id\"" + Urls []*URLFragment "json:\"urls\" graphql:\"urls\"" + Parent *StudioFragment_Parent "json:\"parent,omitempty\" graphql:\"parent\"" + Images []*ImageFragment "json:\"images\" graphql:\"images\"" +} + +func (t *StudioFragment) GetName() string { + if t == nil { + t = &StudioFragment{} + } + return t.Name +} +func (t *StudioFragment) GetID() string { + if t == nil { + t = &StudioFragment{} + } + return t.ID +} +func (t *StudioFragment) GetUrls() []*URLFragment { + if t == nil { + t = &StudioFragment{} + } + return t.Urls +} +func (t *StudioFragment) GetParent() *StudioFragment_Parent { + if t == nil { + t = &StudioFragment{} + } + return t.Parent +} +func (t *StudioFragment) GetImages() []*ImageFragment { + if t == nil { + t = &StudioFragment{} + } + return t.Images } + type TagFragment struct { Name string "json:\"name\" graphql:\"name\"" ID string "json:\"id\" graphql:\"id\"" } + +func (t *TagFragment) GetName() string { + if t == nil { + t = &TagFragment{} + } + return t.Name +} +func (t *TagFragment) GetID() string { + if t == nil { + t = &TagFragment{} + } + return t.ID +} + type FuzzyDateFragment struct { Date string "json:\"date\" graphql:\"date\"" Accuracy DateAccuracyEnum "json:\"accuracy\" graphql:\"accuracy\"" } + +func (t *FuzzyDateFragment) GetDate() string { + if t == nil { + t = &FuzzyDateFragment{} + } + return t.Date +} +func (t *FuzzyDateFragment) GetAccuracy() *DateAccuracyEnum { + if t == nil { + t = &FuzzyDateFragment{} + } + return &t.Accuracy +} + type MeasurementsFragment struct { - BandSize *int "json:\"band_size\" graphql:\"band_size\"" - CupSize *string "json:\"cup_size\" graphql:\"cup_size\"" - Waist *int "json:\"waist\" graphql:\"waist\"" - Hip *int "json:\"hip\" graphql:\"hip\"" + BandSize *int "json:\"band_size,omitempty\" graphql:\"band_size\"" + CupSize *string "json:\"cup_size,omitempty\" graphql:\"cup_size\"" + Waist *int "json:\"waist,omitempty\" graphql:\"waist\"" + Hip *int "json:\"hip,omitempty\" graphql:\"hip\"" } + +func (t *MeasurementsFragment) GetBandSize() *int { + if t == nil { + t = &MeasurementsFragment{} + } + return t.BandSize +} +func (t *MeasurementsFragment) GetCupSize() *string { + if t == nil { + t = &MeasurementsFragment{} + } + return t.CupSize +} +func (t *MeasurementsFragment) GetWaist() *int { + if t == nil { + t = &MeasurementsFragment{} + } + return t.Waist +} +func (t *MeasurementsFragment) GetHip() *int { + if t == nil { + t = &MeasurementsFragment{} + } + return t.Hip +} + type BodyModificationFragment struct { Location string "json:\"location\" graphql:\"location\"" - Description *string "json:\"description\" graphql:\"description\"" + Description *string "json:\"description,omitempty\" graphql:\"description\"" +} + +func (t *BodyModificationFragment) GetLocation() string { + if t == nil { + t = &BodyModificationFragment{} + } + return t.Location +} +func (t *BodyModificationFragment) GetDescription() *string { + if t == nil { + t = &BodyModificationFragment{} + } + return t.Description } + type PerformerFragment struct { ID string "json:\"id\" graphql:\"id\"" Name string "json:\"name\" graphql:\"name\"" - Disambiguation *string "json:\"disambiguation\" graphql:\"disambiguation\"" + Disambiguation *string "json:\"disambiguation,omitempty\" graphql:\"disambiguation\"" Aliases []string "json:\"aliases\" graphql:\"aliases\"" - Gender *GenderEnum "json:\"gender\" graphql:\"gender\"" + Gender *GenderEnum "json:\"gender,omitempty\" graphql:\"gender\"" MergedIds []string "json:\"merged_ids\" graphql:\"merged_ids\"" Urls []*URLFragment "json:\"urls\" graphql:\"urls\"" Images []*ImageFragment "json:\"images\" graphql:\"images\"" - Birthdate *FuzzyDateFragment "json:\"birthdate\" graphql:\"birthdate\"" - Ethnicity *EthnicityEnum "json:\"ethnicity\" graphql:\"ethnicity\"" - Country *string "json:\"country\" graphql:\"country\"" - EyeColor *EyeColorEnum "json:\"eye_color\" graphql:\"eye_color\"" - HairColor *HairColorEnum "json:\"hair_color\" graphql:\"hair_color\"" - Height *int "json:\"height\" graphql:\"height\"" - Measurements MeasurementsFragment "json:\"measurements\" graphql:\"measurements\"" - BreastType *BreastTypeEnum "json:\"breast_type\" graphql:\"breast_type\"" - CareerStartYear *int "json:\"career_start_year\" graphql:\"career_start_year\"" - CareerEndYear *int "json:\"career_end_year\" graphql:\"career_end_year\"" - Tattoos []*BodyModificationFragment "json:\"tattoos\" graphql:\"tattoos\"" - Piercings []*BodyModificationFragment "json:\"piercings\" graphql:\"piercings\"" + Birthdate *FuzzyDateFragment "json:\"birthdate,omitempty\" graphql:\"birthdate\"" + Ethnicity *EthnicityEnum "json:\"ethnicity,omitempty\" graphql:\"ethnicity\"" + Country *string "json:\"country,omitempty\" graphql:\"country\"" + EyeColor *EyeColorEnum "json:\"eye_color,omitempty\" graphql:\"eye_color\"" + HairColor *HairColorEnum "json:\"hair_color,omitempty\" graphql:\"hair_color\"" + Height *int "json:\"height,omitempty\" graphql:\"height\"" + Measurements *MeasurementsFragment "json:\"measurements\" graphql:\"measurements\"" + BreastType *BreastTypeEnum "json:\"breast_type,omitempty\" graphql:\"breast_type\"" + CareerStartYear *int "json:\"career_start_year,omitempty\" graphql:\"career_start_year\"" + CareerEndYear *int "json:\"career_end_year,omitempty\" graphql:\"career_end_year\"" + Tattoos []*BodyModificationFragment "json:\"tattoos,omitempty\" graphql:\"tattoos\"" + Piercings []*BodyModificationFragment "json:\"piercings,omitempty\" graphql:\"piercings\"" +} + +func (t *PerformerFragment) GetID() string { + if t == nil { + t = &PerformerFragment{} + } + return t.ID +} +func (t *PerformerFragment) GetName() string { + if t == nil { + t = &PerformerFragment{} + } + return t.Name +} +func (t *PerformerFragment) GetDisambiguation() *string { + if t == nil { + t = &PerformerFragment{} + } + return t.Disambiguation } +func (t *PerformerFragment) GetAliases() []string { + if t == nil { + t = &PerformerFragment{} + } + return t.Aliases +} +func (t *PerformerFragment) GetGender() *GenderEnum { + if t == nil { + t = &PerformerFragment{} + } + return t.Gender +} +func (t *PerformerFragment) GetMergedIds() []string { + if t == nil { + t = &PerformerFragment{} + } + return t.MergedIds +} +func (t *PerformerFragment) GetUrls() []*URLFragment { + if t == nil { + t = &PerformerFragment{} + } + return t.Urls +} +func (t *PerformerFragment) GetImages() []*ImageFragment { + if t == nil { + t = &PerformerFragment{} + } + return t.Images +} +func (t *PerformerFragment) GetBirthdate() *FuzzyDateFragment { + if t == nil { + t = &PerformerFragment{} + } + return t.Birthdate +} +func (t *PerformerFragment) GetEthnicity() *EthnicityEnum { + if t == nil { + t = &PerformerFragment{} + } + return t.Ethnicity +} +func (t *PerformerFragment) GetCountry() *string { + if t == nil { + t = &PerformerFragment{} + } + return t.Country +} +func (t *PerformerFragment) GetEyeColor() *EyeColorEnum { + if t == nil { + t = &PerformerFragment{} + } + return t.EyeColor +} +func (t *PerformerFragment) GetHairColor() *HairColorEnum { + if t == nil { + t = &PerformerFragment{} + } + return t.HairColor +} +func (t *PerformerFragment) GetHeight() *int { + if t == nil { + t = &PerformerFragment{} + } + return t.Height +} +func (t *PerformerFragment) GetMeasurements() *MeasurementsFragment { + if t == nil { + t = &PerformerFragment{} + } + return t.Measurements +} +func (t *PerformerFragment) GetBreastType() *BreastTypeEnum { + if t == nil { + t = &PerformerFragment{} + } + return t.BreastType +} +func (t *PerformerFragment) GetCareerStartYear() *int { + if t == nil { + t = &PerformerFragment{} + } + return t.CareerStartYear +} +func (t *PerformerFragment) GetCareerEndYear() *int { + if t == nil { + t = &PerformerFragment{} + } + return t.CareerEndYear +} +func (t *PerformerFragment) GetTattoos() []*BodyModificationFragment { + if t == nil { + t = &PerformerFragment{} + } + return t.Tattoos +} +func (t *PerformerFragment) GetPiercings() []*BodyModificationFragment { + if t == nil { + t = &PerformerFragment{} + } + return t.Piercings +} + type PerformerAppearanceFragment struct { - As *string "json:\"as\" graphql:\"as\"" - Performer PerformerFragment "json:\"performer\" graphql:\"performer\"" + As *string "json:\"as,omitempty\" graphql:\"as\"" + Performer *PerformerFragment "json:\"performer\" graphql:\"performer\"" } + +func (t *PerformerAppearanceFragment) GetAs() *string { + if t == nil { + t = &PerformerAppearanceFragment{} + } + return t.As +} +func (t *PerformerAppearanceFragment) GetPerformer() *PerformerFragment { + if t == nil { + t = &PerformerAppearanceFragment{} + } + return t.Performer +} + type FingerprintFragment struct { Algorithm FingerprintAlgorithm "json:\"algorithm\" graphql:\"algorithm\"" Hash string "json:\"hash\" graphql:\"hash\"" Duration int "json:\"duration\" graphql:\"duration\"" } + +func (t *FingerprintFragment) GetAlgorithm() *FingerprintAlgorithm { + if t == nil { + t = &FingerprintFragment{} + } + return &t.Algorithm +} +func (t *FingerprintFragment) GetHash() string { + if t == nil { + t = &FingerprintFragment{} + } + return t.Hash +} +func (t *FingerprintFragment) GetDuration() int { + if t == nil { + t = &FingerprintFragment{} + } + return t.Duration +} + type SceneFragment struct { ID string "json:\"id\" graphql:\"id\"" - Title *string "json:\"title\" graphql:\"title\"" - Code *string "json:\"code\" graphql:\"code\"" - Details *string "json:\"details\" graphql:\"details\"" - Director *string "json:\"director\" graphql:\"director\"" - Duration *int "json:\"duration\" graphql:\"duration\"" - Date *string "json:\"date\" graphql:\"date\"" + Title *string "json:\"title,omitempty\" graphql:\"title\"" + Code *string "json:\"code,omitempty\" graphql:\"code\"" + Details *string "json:\"details,omitempty\" graphql:\"details\"" + Director *string "json:\"director,omitempty\" graphql:\"director\"" + Duration *int "json:\"duration,omitempty\" graphql:\"duration\"" + Date *string "json:\"date,omitempty\" graphql:\"date\"" Urls []*URLFragment "json:\"urls\" graphql:\"urls\"" Images []*ImageFragment "json:\"images\" graphql:\"images\"" - Studio *StudioFragment "json:\"studio\" graphql:\"studio\"" + Studio *StudioFragment "json:\"studio,omitempty\" graphql:\"studio\"" Tags []*TagFragment "json:\"tags\" graphql:\"tags\"" Performers []*PerformerAppearanceFragment "json:\"performers\" graphql:\"performers\"" Fingerprints []*FingerprintFragment "json:\"fingerprints\" graphql:\"fingerprints\"" } + +func (t *SceneFragment) GetID() string { + if t == nil { + t = &SceneFragment{} + } + return t.ID +} +func (t *SceneFragment) GetTitle() *string { + if t == nil { + t = &SceneFragment{} + } + return t.Title +} +func (t *SceneFragment) GetCode() *string { + if t == nil { + t = &SceneFragment{} + } + return t.Code +} +func (t *SceneFragment) GetDetails() *string { + if t == nil { + t = &SceneFragment{} + } + return t.Details +} +func (t *SceneFragment) GetDirector() *string { + if t == nil { + t = &SceneFragment{} + } + return t.Director +} +func (t *SceneFragment) GetDuration() *int { + if t == nil { + t = &SceneFragment{} + } + return t.Duration +} +func (t *SceneFragment) GetDate() *string { + if t == nil { + t = &SceneFragment{} + } + return t.Date +} +func (t *SceneFragment) GetUrls() []*URLFragment { + if t == nil { + t = &SceneFragment{} + } + return t.Urls +} +func (t *SceneFragment) GetImages() []*ImageFragment { + if t == nil { + t = &SceneFragment{} + } + return t.Images +} +func (t *SceneFragment) GetStudio() *StudioFragment { + if t == nil { + t = &SceneFragment{} + } + return t.Studio +} +func (t *SceneFragment) GetTags() []*TagFragment { + if t == nil { + t = &SceneFragment{} + } + return t.Tags +} +func (t *SceneFragment) GetPerformers() []*PerformerAppearanceFragment { + if t == nil { + t = &SceneFragment{} + } + return t.Performers +} +func (t *SceneFragment) GetFingerprints() []*FingerprintFragment { + if t == nil { + t = &SceneFragment{} + } + return t.Fingerprints +} + +type StudioFragment_Parent struct { + Name string "json:\"name\" graphql:\"name\"" + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *StudioFragment_Parent) GetName() string { + if t == nil { + t = &StudioFragment_Parent{} + } + return t.Name +} +func (t *StudioFragment_Parent) GetID() string { + if t == nil { + t = &StudioFragment_Parent{} + } + return t.ID +} + +type SceneFragment_Studio_StudioFragment_Parent struct { + Name string "json:\"name\" graphql:\"name\"" + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *SceneFragment_Studio_StudioFragment_Parent) GetName() string { + if t == nil { + t = &SceneFragment_Studio_StudioFragment_Parent{} + } + return t.Name +} +func (t *SceneFragment_Studio_StudioFragment_Parent) GetID() string { + if t == nil { + t = &SceneFragment_Studio_StudioFragment_Parent{} + } + return t.ID +} + +type FindSceneByFingerprint_FindSceneByFingerprint_SceneFragment_Studio_StudioFragment_Parent struct { + Name string "json:\"name\" graphql:\"name\"" + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *FindSceneByFingerprint_FindSceneByFingerprint_SceneFragment_Studio_StudioFragment_Parent) GetName() string { + if t == nil { + t = &FindSceneByFingerprint_FindSceneByFingerprint_SceneFragment_Studio_StudioFragment_Parent{} + } + return t.Name +} +func (t *FindSceneByFingerprint_FindSceneByFingerprint_SceneFragment_Studio_StudioFragment_Parent) GetID() string { + if t == nil { + t = &FindSceneByFingerprint_FindSceneByFingerprint_SceneFragment_Studio_StudioFragment_Parent{} + } + return t.ID +} + +type FindScenesByFullFingerprints_FindScenesByFullFingerprints_SceneFragment_Studio_StudioFragment_Parent struct { + Name string "json:\"name\" graphql:\"name\"" + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *FindScenesByFullFingerprints_FindScenesByFullFingerprints_SceneFragment_Studio_StudioFragment_Parent) GetName() string { + if t == nil { + t = &FindScenesByFullFingerprints_FindScenesByFullFingerprints_SceneFragment_Studio_StudioFragment_Parent{} + } + return t.Name +} +func (t *FindScenesByFullFingerprints_FindScenesByFullFingerprints_SceneFragment_Studio_StudioFragment_Parent) GetID() string { + if t == nil { + t = &FindScenesByFullFingerprints_FindScenesByFullFingerprints_SceneFragment_Studio_StudioFragment_Parent{} + } + return t.ID +} + +type FindScenesBySceneFingerprints_FindScenesBySceneFingerprints_SceneFragment_Studio_StudioFragment_Parent struct { + Name string "json:\"name\" graphql:\"name\"" + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *FindScenesBySceneFingerprints_FindScenesBySceneFingerprints_SceneFragment_Studio_StudioFragment_Parent) GetName() string { + if t == nil { + t = &FindScenesBySceneFingerprints_FindScenesBySceneFingerprints_SceneFragment_Studio_StudioFragment_Parent{} + } + return t.Name +} +func (t *FindScenesBySceneFingerprints_FindScenesBySceneFingerprints_SceneFragment_Studio_StudioFragment_Parent) GetID() string { + if t == nil { + t = &FindScenesBySceneFingerprints_FindScenesBySceneFingerprints_SceneFragment_Studio_StudioFragment_Parent{} + } + return t.ID +} + +type SearchScene_SearchScene_SceneFragment_Studio_StudioFragment_Parent struct { + Name string "json:\"name\" graphql:\"name\"" + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *SearchScene_SearchScene_SceneFragment_Studio_StudioFragment_Parent) GetName() string { + if t == nil { + t = &SearchScene_SearchScene_SceneFragment_Studio_StudioFragment_Parent{} + } + return t.Name +} +func (t *SearchScene_SearchScene_SceneFragment_Studio_StudioFragment_Parent) GetID() string { + if t == nil { + t = &SearchScene_SearchScene_SceneFragment_Studio_StudioFragment_Parent{} + } + return t.ID +} + +type FindSceneByID_FindScene_SceneFragment_Studio_StudioFragment_Parent struct { + Name string "json:\"name\" graphql:\"name\"" + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *FindSceneByID_FindScene_SceneFragment_Studio_StudioFragment_Parent) GetName() string { + if t == nil { + t = &FindSceneByID_FindScene_SceneFragment_Studio_StudioFragment_Parent{} + } + return t.Name +} +func (t *FindSceneByID_FindScene_SceneFragment_Studio_StudioFragment_Parent) GetID() string { + if t == nil { + t = &FindSceneByID_FindScene_SceneFragment_Studio_StudioFragment_Parent{} + } + return t.ID +} + +type FindStudio_FindStudio_StudioFragment_Parent struct { + Name string "json:\"name\" graphql:\"name\"" + ID string "json:\"id\" graphql:\"id\"" +} + +func (t *FindStudio_FindStudio_StudioFragment_Parent) GetName() string { + if t == nil { + t = &FindStudio_FindStudio_StudioFragment_Parent{} + } + return t.Name +} +func (t *FindStudio_FindStudio_StudioFragment_Parent) GetID() string { + if t == nil { + t = &FindStudio_FindStudio_StudioFragment_Parent{} + } + return t.ID +} + +type Me_Me struct { + Name string "json:\"name\" graphql:\"name\"" +} + +func (t *Me_Me) GetName() string { + if t == nil { + t = &Me_Me{} + } + return t.Name +} + +type SubmitSceneDraft_SubmitSceneDraft struct { + ID *string "json:\"id,omitempty\" graphql:\"id\"" +} + +func (t *SubmitSceneDraft_SubmitSceneDraft) GetID() *string { + if t == nil { + t = &SubmitSceneDraft_SubmitSceneDraft{} + } + return t.ID +} + +type SubmitPerformerDraft_SubmitPerformerDraft struct { + ID *string "json:\"id,omitempty\" graphql:\"id\"" +} + +func (t *SubmitPerformerDraft_SubmitPerformerDraft) GetID() *string { + if t == nil { + t = &SubmitPerformerDraft_SubmitPerformerDraft{} + } + return t.ID +} + type FindSceneByFingerprint struct { FindSceneByFingerprint []*SceneFragment "json:\"findSceneByFingerprint\" graphql:\"findSceneByFingerprint\"" } + +func (t *FindSceneByFingerprint) GetFindSceneByFingerprint() []*SceneFragment { + if t == nil { + t = &FindSceneByFingerprint{} + } + return t.FindSceneByFingerprint +} + type FindScenesByFullFingerprints struct { FindScenesByFullFingerprints []*SceneFragment "json:\"findScenesByFullFingerprints\" graphql:\"findScenesByFullFingerprints\"" } + +func (t *FindScenesByFullFingerprints) GetFindScenesByFullFingerprints() []*SceneFragment { + if t == nil { + t = &FindScenesByFullFingerprints{} + } + return t.FindScenesByFullFingerprints +} + type FindScenesBySceneFingerprints struct { FindScenesBySceneFingerprints [][]*SceneFragment "json:\"findScenesBySceneFingerprints\" graphql:\"findScenesBySceneFingerprints\"" } + +func (t *FindScenesBySceneFingerprints) GetFindScenesBySceneFingerprints() [][]*SceneFragment { + if t == nil { + t = &FindScenesBySceneFingerprints{} + } + return t.FindScenesBySceneFingerprints +} + type SearchScene struct { SearchScene []*SceneFragment "json:\"searchScene\" graphql:\"searchScene\"" } + +func (t *SearchScene) GetSearchScene() []*SceneFragment { + if t == nil { + t = &SearchScene{} + } + return t.SearchScene +} + type SearchPerformer struct { SearchPerformer []*PerformerFragment "json:\"searchPerformer\" graphql:\"searchPerformer\"" } + +func (t *SearchPerformer) GetSearchPerformer() []*PerformerFragment { + if t == nil { + t = &SearchPerformer{} + } + return t.SearchPerformer +} + type FindPerformerByID struct { - FindPerformer *PerformerFragment "json:\"findPerformer\" graphql:\"findPerformer\"" + FindPerformer *PerformerFragment "json:\"findPerformer,omitempty\" graphql:\"findPerformer\"" } + +func (t *FindPerformerByID) GetFindPerformer() *PerformerFragment { + if t == nil { + t = &FindPerformerByID{} + } + return t.FindPerformer +} + type FindSceneByID struct { - FindScene *SceneFragment "json:\"findScene\" graphql:\"findScene\"" + FindScene *SceneFragment "json:\"findScene,omitempty\" graphql:\"findScene\"" +} + +func (t *FindSceneByID) GetFindScene() *SceneFragment { + if t == nil { + t = &FindSceneByID{} + } + return t.FindScene } + type FindStudio struct { - FindStudio *StudioFragment "json:\"findStudio\" graphql:\"findStudio\"" + FindStudio *StudioFragment "json:\"findStudio,omitempty\" graphql:\"findStudio\"" +} + +func (t *FindStudio) GetFindStudio() *StudioFragment { + if t == nil { + t = &FindStudio{} + } + return t.FindStudio } + type SubmitFingerprint struct { SubmitFingerprint bool "json:\"submitFingerprint\" graphql:\"submitFingerprint\"" } + +func (t *SubmitFingerprint) GetSubmitFingerprint() bool { + if t == nil { + t = &SubmitFingerprint{} + } + return t.SubmitFingerprint +} + type Me struct { - Me *struct { - Name string "json:\"name\" graphql:\"name\"" - } "json:\"me\" graphql:\"me\"" + Me *Me_Me "json:\"me,omitempty\" graphql:\"me\"" +} + +func (t *Me) GetMe() *Me_Me { + if t == nil { + t = &Me{} + } + return t.Me } + type SubmitSceneDraft struct { - SubmitSceneDraft struct { - ID *string "json:\"id\" graphql:\"id\"" - } "json:\"submitSceneDraft\" graphql:\"submitSceneDraft\"" + SubmitSceneDraft SubmitSceneDraft_SubmitSceneDraft "json:\"submitSceneDraft\" graphql:\"submitSceneDraft\"" } + +func (t *SubmitSceneDraft) GetSubmitSceneDraft() *SubmitSceneDraft_SubmitSceneDraft { + if t == nil { + t = &SubmitSceneDraft{} + } + return &t.SubmitSceneDraft +} + type SubmitPerformerDraft struct { - SubmitPerformerDraft struct { - ID *string "json:\"id\" graphql:\"id\"" - } "json:\"submitPerformerDraft\" graphql:\"submitPerformerDraft\"" + SubmitPerformerDraft SubmitPerformerDraft_SubmitPerformerDraft "json:\"submitPerformerDraft\" graphql:\"submitPerformerDraft\"" +} + +func (t *SubmitPerformerDraft) GetSubmitPerformerDraft() *SubmitPerformerDraft_SubmitPerformerDraft { + if t == nil { + t = &SubmitPerformerDraft{} + } + return &t.SubmitPerformerDraft } const FindSceneByFingerprintDocument = `query FindSceneByFingerprint ($fingerprint: FingerprintQueryInput!) { @@ -247,11 +803,6 @@ const FindSceneByFingerprintDocument = `query FindSceneByFingerprint ($fingerpri ... SceneFragment } } -fragment FingerprintFragment on Fingerprint { - algorithm - hash - duration -} fragment SceneFragment on Scene { id title @@ -279,28 +830,16 @@ fragment SceneFragment on Scene { ... FingerprintFragment } } +fragment URLFragment on URL { + url + type +} fragment ImageFragment on Image { id url width height } -fragment TagFragment on Tag { - name - id -} -fragment FuzzyDateFragment on FuzzyDate { - date - accuracy -} -fragment BodyModificationFragment on BodyModification { - location - description -} -fragment URLFragment on URL { - url - type -} fragment StudioFragment on Studio { name id @@ -315,6 +854,10 @@ fragment StudioFragment on Studio { ... ImageFragment } } +fragment TagFragment on Tag { + name + id +} fragment PerformerAppearanceFragment on PerformerAppearance { as performer { @@ -355,21 +898,38 @@ fragment PerformerFragment on Performer { ... BodyModificationFragment } } +fragment FuzzyDateFragment on FuzzyDate { + date + accuracy +} fragment MeasurementsFragment on Measurements { band_size cup_size waist hip } +fragment BodyModificationFragment on BodyModification { + location + description +} +fragment FingerprintFragment on Fingerprint { + algorithm + hash + duration +} ` -func (c *Client) FindSceneByFingerprint(ctx context.Context, fingerprint FingerprintQueryInput, httpRequestOptions ...client.HTTPRequestOption) (*FindSceneByFingerprint, error) { - vars := map[string]interface{}{ +func (c *Client) FindSceneByFingerprint(ctx context.Context, fingerprint FingerprintQueryInput, interceptors ...clientv2.RequestInterceptor) (*FindSceneByFingerprint, error) { + vars := map[string]any{ "fingerprint": fingerprint, } var res FindSceneByFingerprint - if err := c.Client.Post(ctx, "FindSceneByFingerprint", FindSceneByFingerprintDocument, &res, vars, httpRequestOptions...); err != nil { + if err := c.Client.Post(ctx, "FindSceneByFingerprint", FindSceneByFingerprintDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + return nil, err } @@ -381,16 +941,36 @@ const FindScenesByFullFingerprintsDocument = `query FindScenesByFullFingerprints ... SceneFragment } } -fragment MeasurementsFragment on Measurements { - band_size - cup_size - waist - hip -} -fragment FingerprintFragment on Fingerprint { - algorithm - hash +fragment SceneFragment on Scene { + id + title + code + details + director duration + date + urls { + ... URLFragment + } + images { + ... ImageFragment + } + studio { + ... StudioFragment + } + tags { + ... TagFragment + } + performers { + ... PerformerAppearanceFragment + } + fingerprints { + ... FingerprintFragment + } +} +fragment URLFragment on URL { + url + type } fragment ImageFragment on Image { id @@ -398,6 +978,20 @@ fragment ImageFragment on Image { width height } +fragment StudioFragment on Studio { + name + id + urls { + ... URLFragment + } + parent { + name + id + } + images { + ... ImageFragment + } +} fragment TagFragment on Tag { name id @@ -446,64 +1040,34 @@ fragment FuzzyDateFragment on FuzzyDate { date accuracy } +fragment MeasurementsFragment on Measurements { + band_size + cup_size + waist + hip +} fragment BodyModificationFragment on BodyModification { location description } -fragment SceneFragment on Scene { - id - title - code - details - director +fragment FingerprintFragment on Fingerprint { + algorithm + hash duration - date - urls { - ... URLFragment - } - images { - ... ImageFragment - } - studio { - ... StudioFragment - } - tags { - ... TagFragment - } - performers { - ... PerformerAppearanceFragment - } - fingerprints { - ... FingerprintFragment - } -} -fragment URLFragment on URL { - url - type -} -fragment StudioFragment on Studio { - name - id - urls { - ... URLFragment - } - parent { - name - id - } - images { - ... ImageFragment - } } ` -func (c *Client) FindScenesByFullFingerprints(ctx context.Context, fingerprints []*FingerprintQueryInput, httpRequestOptions ...client.HTTPRequestOption) (*FindScenesByFullFingerprints, error) { - vars := map[string]interface{}{ +func (c *Client) FindScenesByFullFingerprints(ctx context.Context, fingerprints []*FingerprintQueryInput, interceptors ...clientv2.RequestInterceptor) (*FindScenesByFullFingerprints, error) { + vars := map[string]any{ "fingerprints": fingerprints, } var res FindScenesByFullFingerprints - if err := c.Client.Post(ctx, "FindScenesByFullFingerprints", FindScenesByFullFingerprintsDocument, &res, vars, httpRequestOptions...); err != nil { + if err := c.Client.Post(ctx, "FindScenesByFullFingerprints", FindScenesByFullFingerprintsDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + return nil, err } @@ -515,41 +1079,43 @@ const FindScenesBySceneFingerprintsDocument = `query FindScenesBySceneFingerprin ... SceneFragment } } -fragment ImageFragment on Image { - id - url - width - height -} -fragment TagFragment on Tag { - name +fragment SceneFragment on Scene { id -} -fragment PerformerAppearanceFragment on PerformerAppearance { - as - performer { - ... PerformerFragment - } -} -fragment MeasurementsFragment on Measurements { - band_size - cup_size - waist - hip -} -fragment BodyModificationFragment on BodyModification { - location - description -} -fragment FingerprintFragment on Fingerprint { - algorithm - hash + title + code + details + director duration + date + urls { + ... URLFragment + } + images { + ... ImageFragment + } + studio { + ... StudioFragment + } + tags { + ... TagFragment + } + performers { + ... PerformerAppearanceFragment + } + fingerprints { + ... FingerprintFragment + } } fragment URLFragment on URL { url type } +fragment ImageFragment on Image { + id + url + width + height +} fragment StudioFragment on Studio { name id @@ -564,6 +1130,16 @@ fragment StudioFragment on Studio { ... ImageFragment } } +fragment TagFragment on Tag { + name + id +} +fragment PerformerAppearanceFragment on PerformerAppearance { + as + performer { + ... PerformerFragment + } +} fragment PerformerFragment on Performer { id name @@ -602,42 +1178,34 @@ fragment FuzzyDateFragment on FuzzyDate { date accuracy } -fragment SceneFragment on Scene { - id - title - code - details - director +fragment MeasurementsFragment on Measurements { + band_size + cup_size + waist + hip +} +fragment BodyModificationFragment on BodyModification { + location + description +} +fragment FingerprintFragment on Fingerprint { + algorithm + hash duration - date - urls { - ... URLFragment - } - images { - ... ImageFragment - } - studio { - ... StudioFragment - } - tags { - ... TagFragment - } - performers { - ... PerformerAppearanceFragment - } - fingerprints { - ... FingerprintFragment - } } ` -func (c *Client) FindScenesBySceneFingerprints(ctx context.Context, fingerprints [][]*FingerprintQueryInput, httpRequestOptions ...client.HTTPRequestOption) (*FindScenesBySceneFingerprints, error) { - vars := map[string]interface{}{ +func (c *Client) FindScenesBySceneFingerprints(ctx context.Context, fingerprints [][]*FingerprintQueryInput, interceptors ...clientv2.RequestInterceptor) (*FindScenesBySceneFingerprints, error) { + vars := map[string]any{ "fingerprints": fingerprints, } var res FindScenesBySceneFingerprints - if err := c.Client.Post(ctx, "FindScenesBySceneFingerprints", FindScenesBySceneFingerprintsDocument, &res, vars, httpRequestOptions...); err != nil { + if err := c.Client.Post(ctx, "FindScenesBySceneFingerprints", FindScenesBySceneFingerprintsDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + return nil, err } @@ -676,27 +1244,6 @@ fragment SceneFragment on Scene { ... FingerprintFragment } } -fragment PerformerAppearanceFragment on PerformerAppearance { - as - performer { - ... PerformerFragment - } -} -fragment FuzzyDateFragment on FuzzyDate { - date - accuracy -} -fragment MeasurementsFragment on Measurements { - band_size - cup_size - waist - hip -} -fragment FingerprintFragment on Fingerprint { - algorithm - hash - duration -} fragment URLFragment on URL { url type @@ -725,6 +1272,12 @@ fragment TagFragment on Tag { name id } +fragment PerformerAppearanceFragment on PerformerAppearance { + as + performer { + ... PerformerFragment + } +} fragment PerformerFragment on Performer { id name @@ -759,19 +1312,38 @@ fragment PerformerFragment on Performer { ... BodyModificationFragment } } +fragment FuzzyDateFragment on FuzzyDate { + date + accuracy +} +fragment MeasurementsFragment on Measurements { + band_size + cup_size + waist + hip +} fragment BodyModificationFragment on BodyModification { location description } +fragment FingerprintFragment on Fingerprint { + algorithm + hash + duration +} ` -func (c *Client) SearchScene(ctx context.Context, term string, httpRequestOptions ...client.HTTPRequestOption) (*SearchScene, error) { - vars := map[string]interface{}{ +func (c *Client) SearchScene(ctx context.Context, term string, interceptors ...clientv2.RequestInterceptor) (*SearchScene, error) { + vars := map[string]any{ "term": term, } var res SearchScene - if err := c.Client.Post(ctx, "SearchScene", SearchSceneDocument, &res, vars, httpRequestOptions...); err != nil { + if err := c.Client.Post(ctx, "SearchScene", SearchSceneDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + return nil, err } @@ -843,13 +1415,17 @@ fragment BodyModificationFragment on BodyModification { } ` -func (c *Client) SearchPerformer(ctx context.Context, term string, httpRequestOptions ...client.HTTPRequestOption) (*SearchPerformer, error) { - vars := map[string]interface{}{ +func (c *Client) SearchPerformer(ctx context.Context, term string, interceptors ...clientv2.RequestInterceptor) (*SearchPerformer, error) { + vars := map[string]any{ "term": term, } var res SearchPerformer - if err := c.Client.Post(ctx, "SearchPerformer", SearchPerformerDocument, &res, vars, httpRequestOptions...); err != nil { + if err := c.Client.Post(ctx, "SearchPerformer", SearchPerformerDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + return nil, err } @@ -861,26 +1437,6 @@ const FindPerformerByIDDocument = `query FindPerformerByID ($id: ID!) { ... PerformerFragment } } -fragment ImageFragment on Image { - id - url - width - height -} -fragment FuzzyDateFragment on FuzzyDate { - date - accuracy -} -fragment MeasurementsFragment on Measurements { - band_size - cup_size - waist - hip -} -fragment BodyModificationFragment on BodyModification { - location - description -} fragment PerformerFragment on Performer { id name @@ -919,15 +1475,39 @@ fragment URLFragment on URL { url type } +fragment ImageFragment on Image { + id + url + width + height +} +fragment FuzzyDateFragment on FuzzyDate { + date + accuracy +} +fragment MeasurementsFragment on Measurements { + band_size + cup_size + waist + hip +} +fragment BodyModificationFragment on BodyModification { + location + description +} ` -func (c *Client) FindPerformerByID(ctx context.Context, id string, httpRequestOptions ...client.HTTPRequestOption) (*FindPerformerByID, error) { - vars := map[string]interface{}{ +func (c *Client) FindPerformerByID(ctx context.Context, id string, interceptors ...clientv2.RequestInterceptor) (*FindPerformerByID, error) { + vars := map[string]any{ "id": id, } var res FindPerformerByID - if err := c.Client.Post(ctx, "FindPerformerByID", FindPerformerByIDDocument, &res, vars, httpRequestOptions...); err != nil { + if err := c.Client.Post(ctx, "FindPerformerByID", FindPerformerByIDDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + return nil, err } @@ -939,6 +1519,43 @@ const FindSceneByIDDocument = `query FindSceneByID ($id: ID!) { ... SceneFragment } } +fragment SceneFragment on Scene { + id + title + code + details + director + duration + date + urls { + ... URLFragment + } + images { + ... ImageFragment + } + studio { + ... StudioFragment + } + tags { + ... TagFragment + } + performers { + ... PerformerAppearanceFragment + } + fingerprints { + ... FingerprintFragment + } +} +fragment URLFragment on URL { + url + type +} +fragment ImageFragment on Image { + id + url + width + height +} fragment StudioFragment on Studio { name id @@ -963,25 +1580,6 @@ fragment PerformerAppearanceFragment on PerformerAppearance { ... PerformerFragment } } -fragment FuzzyDateFragment on FuzzyDate { - date - accuracy -} -fragment FingerprintFragment on Fingerprint { - algorithm - hash - duration -} -fragment ImageFragment on Image { - id - url - width - height -} -fragment URLFragment on URL { - url - type -} fragment PerformerFragment on Performer { id name @@ -1016,6 +1614,10 @@ fragment PerformerFragment on Performer { ... BodyModificationFragment } } +fragment FuzzyDateFragment on FuzzyDate { + date + accuracy +} fragment MeasurementsFragment on Measurements { band_size cup_size @@ -1026,42 +1628,24 @@ fragment BodyModificationFragment on BodyModification { location description } -fragment SceneFragment on Scene { - id - title - code - details - director +fragment FingerprintFragment on Fingerprint { + algorithm + hash duration - date - urls { - ... URLFragment - } - images { - ... ImageFragment - } - studio { - ... StudioFragment - } - tags { - ... TagFragment - } - performers { - ... PerformerAppearanceFragment - } - fingerprints { - ... FingerprintFragment - } } ` -func (c *Client) FindSceneByID(ctx context.Context, id string, httpRequestOptions ...client.HTTPRequestOption) (*FindSceneByID, error) { - vars := map[string]interface{}{ +func (c *Client) FindSceneByID(ctx context.Context, id string, interceptors ...clientv2.RequestInterceptor) (*FindSceneByID, error) { + vars := map[string]any{ "id": id, } var res FindSceneByID - if err := c.Client.Post(ctx, "FindSceneByID", FindSceneByIDDocument, &res, vars, httpRequestOptions...); err != nil { + if err := c.Client.Post(ctx, "FindSceneByID", FindSceneByIDDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + return nil, err } @@ -1099,14 +1683,18 @@ fragment ImageFragment on Image { } ` -func (c *Client) FindStudio(ctx context.Context, id *string, name *string, httpRequestOptions ...client.HTTPRequestOption) (*FindStudio, error) { - vars := map[string]interface{}{ +func (c *Client) FindStudio(ctx context.Context, id *string, name *string, interceptors ...clientv2.RequestInterceptor) (*FindStudio, error) { + vars := map[string]any{ "id": id, "name": name, } var res FindStudio - if err := c.Client.Post(ctx, "FindStudio", FindStudioDocument, &res, vars, httpRequestOptions...); err != nil { + if err := c.Client.Post(ctx, "FindStudio", FindStudioDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + return nil, err } @@ -1118,13 +1706,17 @@ const SubmitFingerprintDocument = `mutation SubmitFingerprint ($input: Fingerpri } ` -func (c *Client) SubmitFingerprint(ctx context.Context, input FingerprintSubmission, httpRequestOptions ...client.HTTPRequestOption) (*SubmitFingerprint, error) { - vars := map[string]interface{}{ +func (c *Client) SubmitFingerprint(ctx context.Context, input FingerprintSubmission, interceptors ...clientv2.RequestInterceptor) (*SubmitFingerprint, error) { + vars := map[string]any{ "input": input, } var res SubmitFingerprint - if err := c.Client.Post(ctx, "SubmitFingerprint", SubmitFingerprintDocument, &res, vars, httpRequestOptions...); err != nil { + if err := c.Client.Post(ctx, "SubmitFingerprint", SubmitFingerprintDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + return nil, err } @@ -1138,11 +1730,15 @@ const MeDocument = `query Me { } ` -func (c *Client) Me(ctx context.Context, httpRequestOptions ...client.HTTPRequestOption) (*Me, error) { - vars := map[string]interface{}{} +func (c *Client) Me(ctx context.Context, interceptors ...clientv2.RequestInterceptor) (*Me, error) { + vars := map[string]any{} var res Me - if err := c.Client.Post(ctx, "Me", MeDocument, &res, vars, httpRequestOptions...); err != nil { + if err := c.Client.Post(ctx, "Me", MeDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + return nil, err } @@ -1156,13 +1752,17 @@ const SubmitSceneDraftDocument = `mutation SubmitSceneDraft ($input: SceneDraftI } ` -func (c *Client) SubmitSceneDraft(ctx context.Context, input SceneDraftInput, httpRequestOptions ...client.HTTPRequestOption) (*SubmitSceneDraft, error) { - vars := map[string]interface{}{ +func (c *Client) SubmitSceneDraft(ctx context.Context, input SceneDraftInput, interceptors ...clientv2.RequestInterceptor) (*SubmitSceneDraft, error) { + vars := map[string]any{ "input": input, } var res SubmitSceneDraft - if err := c.Client.Post(ctx, "SubmitSceneDraft", SubmitSceneDraftDocument, &res, vars, httpRequestOptions...); err != nil { + if err := c.Client.Post(ctx, "SubmitSceneDraft", SubmitSceneDraftDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + return nil, err } @@ -1176,15 +1776,34 @@ const SubmitPerformerDraftDocument = `mutation SubmitPerformerDraft ($input: Per } ` -func (c *Client) SubmitPerformerDraft(ctx context.Context, input PerformerDraftInput, httpRequestOptions ...client.HTTPRequestOption) (*SubmitPerformerDraft, error) { - vars := map[string]interface{}{ +func (c *Client) SubmitPerformerDraft(ctx context.Context, input PerformerDraftInput, interceptors ...clientv2.RequestInterceptor) (*SubmitPerformerDraft, error) { + vars := map[string]any{ "input": input, } var res SubmitPerformerDraft - if err := c.Client.Post(ctx, "SubmitPerformerDraft", SubmitPerformerDraftDocument, &res, vars, httpRequestOptions...); err != nil { + if err := c.Client.Post(ctx, "SubmitPerformerDraft", SubmitPerformerDraftDocument, &res, vars, interceptors...); err != nil { + if c.Client.ParseDataWhenErrors { + return &res, err + } + return nil, err } return &res, nil } + +var DocumentOperationNames = map[string]string{ + FindSceneByFingerprintDocument: "FindSceneByFingerprint", + FindScenesByFullFingerprintsDocument: "FindScenesByFullFingerprints", + FindScenesBySceneFingerprintsDocument: "FindScenesBySceneFingerprints", + SearchSceneDocument: "SearchScene", + SearchPerformerDocument: "SearchPerformer", + FindPerformerByIDDocument: "FindPerformerByID", + FindSceneByIDDocument: "FindSceneByID", + FindStudioDocument: "FindStudio", + SubmitFingerprintDocument: "SubmitFingerprint", + MeDocument: "Me", + SubmitSceneDraftDocument: "SubmitSceneDraft", + SubmitPerformerDraftDocument: "SubmitPerformerDraft", +} diff --git a/pkg/scraper/stashbox/graphql/generated_models.go b/pkg/scraper/stashbox/graphql/generated_models.go index 87f99db47a9..39022f6eaf7 100644 --- a/pkg/scraper/stashbox/graphql/generated_models.go +++ b/pkg/scraper/stashbox/graphql/generated_models.go @@ -80,7 +80,7 @@ type Draft struct { ID string `json:"id"` Created time.Time `json:"created"` Expires time.Time `json:"expires"` - Data DraftData `json:"data,omitempty"` + Data DraftData `json:"data"` } type DraftEntity struct { @@ -88,10 +88,12 @@ type DraftEntity struct { ID *string `json:"id,omitempty"` } -func (DraftEntity) IsSceneDraftStudio() {} -func (DraftEntity) IsSceneDraftTag() {} func (DraftEntity) IsSceneDraftPerformer() {} +func (DraftEntity) IsSceneDraftStudio() {} + +func (DraftEntity) IsSceneDraftTag() {} + type DraftEntityInput struct { Name string `json:"name"` ID *string `json:"id,omitempty"` @@ -114,7 +116,7 @@ type Edit struct { Target EditTarget `json:"target,omitempty"` TargetType TargetTypeEnum `json:"target_type"` // Objects to merge with the target. Only applicable to merges - MergeSources []EditTarget `json:"merge_sources,omitempty"` + MergeSources []EditTarget `json:"merge_sources"` Operation OperationEnum `json:"operation"` Bot bool `json:"bot"` Details EditDetails `json:"details,omitempty"` @@ -122,8 +124,8 @@ type Edit struct { OldDetails EditDetails `json:"old_details,omitempty"` // Entity specific options Options *PerformerEditOptions `json:"options,omitempty"` - Comments []*EditComment `json:"comments,omitempty"` - Votes []*EditVote `json:"votes,omitempty"` + Comments []*EditComment `json:"comments"` + Votes []*EditVote `json:"votes"` // = Accepted - Rejected VoteCount int `json:"vote_count"` // Is the edit considered destructive. @@ -179,11 +181,13 @@ type EditQueryInput struct { // Filter by user voted status Voted *UserVotedFilterEnum `json:"voted,omitempty"` // Filter to bot edits only - IsBot *bool `json:"is_bot,omitempty"` - Page int `json:"page"` - PerPage int `json:"per_page"` - Direction SortDirectionEnum `json:"direction"` - Sort EditSortEnum `json:"sort"` + IsBot *bool `json:"is_bot,omitempty"` + // Filter out user's own edits + IncludeUserSubmitted *bool `json:"include_user_submitted,omitempty"` + Page int `json:"page"` + PerPage int `json:"per_page"` + Direction SortDirectionEnum `json:"direction"` + Sort EditSortEnum `json:"sort"` } type EditVote struct { @@ -237,7 +241,7 @@ type FingerprintQueryInput struct { type FingerprintSubmission struct { SceneID string `json:"scene_id"` - Fingerprint *FingerprintInput `json:"fingerprint,omitempty"` + Fingerprint *FingerprintInput `json:"fingerprint"` Unmatch *bool `json:"unmatch,omitempty"` } @@ -246,6 +250,12 @@ type FuzzyDate struct { Accuracy DateAccuracyEnum `json:"accuracy"` } +type GenerateInviteCodeInput struct { + Keys *int `json:"keys,omitempty"` + Uses *int `json:"uses,omitempty"` + TTL *int `json:"ttl,omitempty"` +} + type GrantInviteInput struct { UserID string `json:"user_id"` Amount int `json:"amount"` @@ -257,7 +267,7 @@ type HairColorCriterionInput struct { } type IDCriterionInput struct { - Value []string `json:"value,omitempty"` + Value []string `json:"value"` Modifier CriterionModifier `json:"modifier"` } @@ -287,6 +297,12 @@ type IntCriterionInput struct { Modifier CriterionModifier `json:"modifier"` } +type InviteKey struct { + ID string `json:"id"` + Uses *int `json:"uses,omitempty"` + Expires *time.Time `json:"expires,omitempty"` +} + type Measurements struct { CupSize *string `json:"cup_size,omitempty"` BandSize *int `json:"band_size,omitempty"` @@ -300,10 +316,13 @@ type MultiIDCriterionInput struct { } type MultiStringCriterionInput struct { - Value []string `json:"value,omitempty"` + Value []string `json:"value"` Modifier CriterionModifier `json:"modifier"` } +type Mutation struct { +} + type NewUserInput struct { Email string `json:"email"` InviteKey *string `json:"invite_key,omitempty"` @@ -313,9 +332,9 @@ type Performer struct { ID string `json:"id"` Name string `json:"name"` Disambiguation *string `json:"disambiguation,omitempty"` - Aliases []string `json:"aliases,omitempty"` + Aliases []string `json:"aliases"` Gender *GenderEnum `json:"gender,omitempty"` - Urls []*URL `json:"urls,omitempty"` + Urls []*URL `json:"urls"` Birthdate *FuzzyDate `json:"birthdate,omitempty"` BirthDate *string `json:"birth_date,omitempty"` Age *int `json:"age,omitempty"` @@ -325,7 +344,7 @@ type Performer struct { HairColor *HairColorEnum `json:"hair_color,omitempty"` // Height in cm Height *int `json:"height,omitempty"` - Measurements *Measurements `json:"measurements,omitempty"` + Measurements *Measurements `json:"measurements"` CupSize *string `json:"cup_size,omitempty"` BandSize *int `json:"band_size,omitempty"` WaistSize *int `json:"waist_size,omitempty"` @@ -335,23 +354,24 @@ type Performer struct { CareerEndYear *int `json:"career_end_year,omitempty"` Tattoos []*BodyModification `json:"tattoos,omitempty"` Piercings []*BodyModification `json:"piercings,omitempty"` - Images []*Image `json:"images,omitempty"` + Images []*Image `json:"images"` Deleted bool `json:"deleted"` - Edits []*Edit `json:"edits,omitempty"` + Edits []*Edit `json:"edits"` SceneCount int `json:"scene_count"` - Scenes []*Scene `json:"scenes,omitempty"` - MergedIds []string `json:"merged_ids,omitempty"` - Studios []*PerformerStudio `json:"studios,omitempty"` + Scenes []*Scene `json:"scenes"` + MergedIds []string `json:"merged_ids"` + Studios []*PerformerStudio `json:"studios"` IsFavorite bool `json:"is_favorite"` Created time.Time `json:"created"` Updated time.Time `json:"updated"` } -func (Performer) IsEditTarget() {} +func (Performer) IsEditTarget() {} + func (Performer) IsSceneDraftPerformer() {} type PerformerAppearance struct { - Performer *Performer `json:"performer,omitempty"` + Performer *Performer `json:"performer"` // Performing as alias As *string `json:"as,omitempty"` } @@ -466,11 +486,11 @@ type PerformerEdit struct { AddedImages []*Image `json:"added_images,omitempty"` RemovedImages []*Image `json:"removed_images,omitempty"` DraftID *string `json:"draft_id,omitempty"` - Aliases []string `json:"aliases,omitempty"` - Urls []*URL `json:"urls,omitempty"` - Images []*Image `json:"images,omitempty"` - Tattoos []*BodyModification `json:"tattoos,omitempty"` - Piercings []*BodyModification `json:"piercings,omitempty"` + Aliases []string `json:"aliases"` + Urls []*URL `json:"urls"` + Images []*Image `json:"images"` + Tattoos []*BodyModification `json:"tattoos"` + Piercings []*BodyModification `json:"piercings"` } func (PerformerEdit) IsEditDetails() {} @@ -501,7 +521,7 @@ type PerformerEditDetailsInput struct { } type PerformerEditInput struct { - Edit *EditInput `json:"edit,omitempty"` + Edit *EditInput `json:"edit"` // Not required for destroy type Details *PerformerEditDetailsInput `json:"details,omitempty"` // Controls aliases modification for merges and name modifications @@ -572,7 +592,7 @@ type PerformerScenesInput struct { } type PerformerStudio struct { - Studio *Studio `json:"studio,omitempty"` + Studio *Studio `json:"studio"` SceneCount int `json:"scene_count"` } @@ -601,55 +621,59 @@ type PerformerUpdateInput struct { ImageIds []string `json:"image_ids,omitempty"` } +// The query root for this schema +type Query struct { +} + type QueryEditsResultType struct { Count int `json:"count"` - Edits []*Edit `json:"edits,omitempty"` + Edits []*Edit `json:"edits"` } type QueryExistingSceneInput struct { Title *string `json:"title,omitempty"` StudioID *string `json:"studio_id,omitempty"` - Fingerprints []*FingerprintInput `json:"fingerprints,omitempty"` + Fingerprints []*FingerprintInput `json:"fingerprints"` } type QueryExistingSceneResult struct { - Edits []*Edit `json:"edits,omitempty"` - Scenes []*Scene `json:"scenes,omitempty"` + Edits []*Edit `json:"edits"` + Scenes []*Scene `json:"scenes"` } type QueryPerformersResultType struct { Count int `json:"count"` - Performers []*Performer `json:"performers,omitempty"` + Performers []*Performer `json:"performers"` } type QueryScenesResultType struct { Count int `json:"count"` - Scenes []*Scene `json:"scenes,omitempty"` + Scenes []*Scene `json:"scenes"` } type QuerySitesResultType struct { Count int `json:"count"` - Sites []*Site `json:"sites,omitempty"` + Sites []*Site `json:"sites"` } type QueryStudiosResultType struct { Count int `json:"count"` - Studios []*Studio `json:"studios,omitempty"` + Studios []*Studio `json:"studios"` } type QueryTagCategoriesResultType struct { Count int `json:"count"` - TagCategories []*TagCategory `json:"tag_categories,omitempty"` + TagCategories []*TagCategory `json:"tag_categories"` } type QueryTagsResultType struct { Count int `json:"count"` - Tags []*Tag `json:"tags,omitempty"` + Tags []*Tag `json:"tags"` } type QueryUsersResultType struct { Count int `json:"count"` - Users []*User `json:"users,omitempty"` + Users []*User `json:"users"` } type ResetPasswordInput struct { @@ -662,7 +686,7 @@ type RevokeInviteInput struct { } type RoleCriterionInput struct { - Value []RoleEnum `json:"value,omitempty"` + Value []RoleEnum `json:"value"` Modifier CriterionModifier `json:"modifier"` } @@ -672,17 +696,17 @@ type Scene struct { Details *string `json:"details,omitempty"` Date *string `json:"date,omitempty"` ReleaseDate *string `json:"release_date,omitempty"` - Urls []*URL `json:"urls,omitempty"` + Urls []*URL `json:"urls"` Studio *Studio `json:"studio,omitempty"` - Tags []*Tag `json:"tags,omitempty"` - Images []*Image `json:"images,omitempty"` - Performers []*PerformerAppearance `json:"performers,omitempty"` - Fingerprints []*Fingerprint `json:"fingerprints,omitempty"` + Tags []*Tag `json:"tags"` + Images []*Image `json:"images"` + Performers []*PerformerAppearance `json:"performers"` + Fingerprints []*Fingerprint `json:"fingerprints"` Duration *int `json:"duration,omitempty"` Director *string `json:"director,omitempty"` Code *string `json:"code,omitempty"` Deleted bool `json:"deleted"` - Edits []*Edit `json:"edits,omitempty"` + Edits []*Edit `json:"edits"` Created time.Time `json:"created"` Updated time.Time `json:"updated"` } @@ -698,7 +722,7 @@ type SceneCreateInput struct { Performers []*PerformerAppearanceInput `json:"performers,omitempty"` TagIds []string `json:"tag_ids,omitempty"` ImageIds []string `json:"image_ids,omitempty"` - Fingerprints []*FingerprintEditInput `json:"fingerprints,omitempty"` + Fingerprints []*FingerprintEditInput `json:"fingerprints"` Duration *int `json:"duration,omitempty"` Director *string `json:"director,omitempty"` Code *string `json:"code,omitempty"` @@ -717,10 +741,10 @@ type SceneDraft struct { URL *URL `json:"url,omitempty"` Date *string `json:"date,omitempty"` Studio SceneDraftStudio `json:"studio,omitempty"` - Performers []SceneDraftPerformer `json:"performers,omitempty"` + Performers []SceneDraftPerformer `json:"performers"` Tags []SceneDraftTag `json:"tags,omitempty"` Image *Image `json:"image,omitempty"` - Fingerprints []*DraftFingerprint `json:"fingerprints,omitempty"` + Fingerprints []*DraftFingerprint `json:"fingerprints"` } func (SceneDraft) IsDraftData() {} @@ -745,11 +769,11 @@ type SceneEdit struct { Director *string `json:"director,omitempty"` Code *string `json:"code,omitempty"` DraftID *string `json:"draft_id,omitempty"` - Urls []*URL `json:"urls,omitempty"` - Performers []*PerformerAppearance `json:"performers,omitempty"` - Tags []*Tag `json:"tags,omitempty"` - Images []*Image `json:"images,omitempty"` - Fingerprints []*Fingerprint `json:"fingerprints,omitempty"` + Urls []*URL `json:"urls"` + Performers []*PerformerAppearance `json:"performers"` + Tags []*Tag `json:"tags"` + Images []*Image `json:"images"` + Fingerprints []*Fingerprint `json:"fingerprints"` } func (SceneEdit) IsEditDetails() {} @@ -771,7 +795,7 @@ type SceneEditDetailsInput struct { } type SceneEditInput struct { - Edit *EditInput `json:"edit,omitempty"` + Edit *EditInput `json:"edit"` // Not required for destroy type Details *SceneEditDetailsInput `json:"details,omitempty"` } @@ -829,7 +853,7 @@ type Site struct { Description *string `json:"description,omitempty"` URL *string `json:"url,omitempty"` Regex *string `json:"regex,omitempty"` - ValidTypes []ValidSiteTypeEnum `json:"valid_types,omitempty"` + ValidTypes []ValidSiteTypeEnum `json:"valid_types"` Icon string `json:"icon"` Created time.Time `json:"created"` Updated time.Time `json:"updated"` @@ -840,7 +864,7 @@ type SiteCreateInput struct { Description *string `json:"description,omitempty"` URL *string `json:"url,omitempty"` Regex *string `json:"regex,omitempty"` - ValidTypes []ValidSiteTypeEnum `json:"valid_types,omitempty"` + ValidTypes []ValidSiteTypeEnum `json:"valid_types"` } type SiteDestroyInput struct { @@ -853,7 +877,7 @@ type SiteUpdateInput struct { Description *string `json:"description,omitempty"` URL *string `json:"url,omitempty"` Regex *string `json:"regex,omitempty"` - ValidTypes []ValidSiteTypeEnum `json:"valid_types,omitempty"` + ValidTypes []ValidSiteTypeEnum `json:"valid_types"` } type StashBoxConfig struct { @@ -865,6 +889,7 @@ type StashBoxConfig struct { VotingPeriod int `json:"voting_period"` MinDestructiveVotingPeriod int `json:"min_destructive_voting_period"` VoteCronInterval string `json:"vote_cron_interval"` + GuidelinesURL string `json:"guidelines_url"` } type StringCriterionInput struct { @@ -875,19 +900,20 @@ type StringCriterionInput struct { type Studio struct { ID string `json:"id"` Name string `json:"name"` - Urls []*URL `json:"urls,omitempty"` + Urls []*URL `json:"urls"` Parent *Studio `json:"parent,omitempty"` - ChildStudios []*Studio `json:"child_studios,omitempty"` - Images []*Image `json:"images,omitempty"` + ChildStudios []*Studio `json:"child_studios"` + Images []*Image `json:"images"` Deleted bool `json:"deleted"` IsFavorite bool `json:"is_favorite"` Created time.Time `json:"created"` Updated time.Time `json:"updated"` - Performers *QueryPerformersResultType `json:"performers,omitempty"` + Performers *QueryPerformersResultType `json:"performers"` } +func (Studio) IsEditTarget() {} + func (Studio) IsSceneDraftStudio() {} -func (Studio) IsEditTarget() {} type StudioCreateInput struct { Name string `json:"name"` @@ -908,8 +934,8 @@ type StudioEdit struct { Parent *Studio `json:"parent,omitempty"` AddedImages []*Image `json:"added_images,omitempty"` RemovedImages []*Image `json:"removed_images,omitempty"` - Images []*Image `json:"images,omitempty"` - Urls []*URL `json:"urls,omitempty"` + Images []*Image `json:"images"` + Urls []*URL `json:"urls"` } func (StudioEdit) IsEditDetails() {} @@ -922,7 +948,7 @@ type StudioEditDetailsInput struct { } type StudioEditInput struct { - Edit *EditInput `json:"edit,omitempty"` + Edit *EditInput `json:"edit"` // Not required for destroy type Details *StudioEditDetailsInput `json:"details,omitempty"` } @@ -956,15 +982,16 @@ type Tag struct { ID string `json:"id"` Name string `json:"name"` Description *string `json:"description,omitempty"` - Aliases []string `json:"aliases,omitempty"` + Aliases []string `json:"aliases"` Deleted bool `json:"deleted"` - Edits []*Edit `json:"edits,omitempty"` + Edits []*Edit `json:"edits"` Category *TagCategory `json:"category,omitempty"` Created time.Time `json:"created"` Updated time.Time `json:"updated"` } -func (Tag) IsEditTarget() {} +func (Tag) IsEditTarget() {} + func (Tag) IsSceneDraftTag() {} type TagCategory struct { @@ -1008,7 +1035,7 @@ type TagEdit struct { AddedAliases []string `json:"added_aliases,omitempty"` RemovedAliases []string `json:"removed_aliases,omitempty"` Category *TagCategory `json:"category,omitempty"` - Aliases []string `json:"aliases,omitempty"` + Aliases []string `json:"aliases"` } func (TagEdit) IsEditDetails() {} @@ -1021,7 +1048,7 @@ type TagEditDetailsInput struct { } type TagEditInput struct { - Edit *EditInput `json:"edit,omitempty"` + Edit *EditInput `json:"edit"` // Not required for destroy type Details *TagEditDetailsInput `json:"details,omitempty"` } @@ -1034,7 +1061,6 @@ type TagQueryInput struct { // Filter to search name - assumes like query unless quoted Name *string `json:"name,omitempty"` // Filter to category ID - IsFavorite *bool `json:"is_favorite,omitempty"` CategoryID *string `json:"category_id,omitempty"` Page int `json:"page"` PerPage int `json:"per_page"` @@ -1053,7 +1079,7 @@ type TagUpdateInput struct { type URL struct { URL string `json:"url"` Type string `json:"type"` - Site *Site `json:"site,omitempty"` + Site *Site `json:"site"` } type URLInput struct { @@ -1071,14 +1097,15 @@ type User struct { // Should not be visible to other users APIKey *string `json:"api_key,omitempty"` // Vote counts by type - VoteCount *UserVoteCount `json:"vote_count,omitempty"` + VoteCount *UserVoteCount `json:"vote_count"` // Edit counts by status - EditCount *UserEditCount `json:"edit_count,omitempty"` + EditCount *UserEditCount `json:"edit_count"` // Calls to the API from this user over a configurable time period - APICalls int `json:"api_calls"` - InvitedBy *User `json:"invited_by,omitempty"` - InviteTokens *int `json:"invite_tokens,omitempty"` - ActiveInviteCodes []string `json:"active_invite_codes,omitempty"` + APICalls int `json:"api_calls"` + InvitedBy *User `json:"invited_by,omitempty"` + InviteTokens *int `json:"invite_tokens,omitempty"` + ActiveInviteCodes []string `json:"active_invite_codes,omitempty"` + InviteCodes []*InviteKey `json:"invite_codes,omitempty"` } type UserChangePasswordInput struct { @@ -1092,7 +1119,7 @@ type UserCreateInput struct { Name string `json:"name"` // Password in plain text Password string `json:"password"` - Roles []RoleEnum `json:"roles,omitempty"` + Roles []RoleEnum `json:"roles"` Email string `json:"email"` InvitedByID *string `json:"invited_by_id,omitempty"` } diff --git a/pkg/scraper/stashbox/stash_box.go b/pkg/scraper/stashbox/stash_box.go index 0b0cf68d67e..44fd59b6979 100644 --- a/pkg/scraper/stashbox/stash_box.go +++ b/pkg/scraper/stashbox/stash_box.go @@ -13,7 +13,7 @@ import ( "strconv" "strings" - "github.com/Yamashou/gqlgenc/client" + "github.com/Yamashou/gqlgenc/clientv2" "github.com/Yamashou/gqlgenc/graphqljson" "github.com/gofrs/uuid/v5" "golang.org/x/text/cases" @@ -89,12 +89,13 @@ type Client struct { // NewClient returns a new instance of a stash-box client. func NewClient(box models.StashBox, repo Repository) *Client { - authHeader := func(req *http.Request) { + authHeader := func(ctx context.Context, req *http.Request, gqlInfo *clientv2.GQLRequestInfo, res interface{}, next clientv2.RequestInterceptorFunc) error { req.Header.Set("ApiKey", box.APIKey) + return next(ctx, req, gqlInfo, res) } client := &graphql.Client{ - Client: client.NewClient(http.DefaultClient, box.Endpoint, authHeader), + Client: clientv2.NewClient(http.DefaultClient, box.Endpoint, nil, authHeader), } return &Client{ @@ -627,7 +628,7 @@ func performerFragmentToScrapedPerformer(p graphql.PerformerFragment) *models.Sc Name: &p.Name, Disambiguation: p.Disambiguation, Country: p.Country, - Measurements: formatMeasurements(p.Measurements), + Measurements: formatMeasurements(*p.Measurements), CareerLength: formatCareerLength(p.CareerStartYear, p.CareerEndYear), Tattoos: formatBodyModifications(p.Tattoos), Piercings: formatBodyModifications(p.Piercings), @@ -805,7 +806,7 @@ func (c Client) sceneFragmentToScrapedScene(ctx context.Context, s *graphql.Scen } for _, p := range s.Performers { - sp := performerFragmentToScrapedPerformer(p.Performer) + sp := performerFragmentToScrapedPerformer(*p.Performer) err := match.ScrapedPerformer(ctx, pqb, sp, &c.box.Endpoint) if err != nil { @@ -1281,7 +1282,7 @@ func (c *Client) submitDraft(ctx context.Context, query string, input interface{ "input": input, } - r := &client.Request{ + r := &clientv2.Request{ Query: query, Variables: vars, OperationName: "", @@ -1341,7 +1342,7 @@ func (c *Client) submitDraft(ctx context.Context, query string, input interface{ if len(respGQL.Errors) > 0 { // try to parse standard graphql error - errors := &client.GqlErrorList{} + errors := &clientv2.GqlErrorList{} if e := json.Unmarshal(responseBytes, errors); e != nil { return fmt.Errorf("failed to parse graphql errors. Response content %s - %w ", string(responseBytes), e) }