Skip to content

Commit

Permalink
Merge branch 'xbapps:master' into util
Browse files Browse the repository at this point in the history
  • Loading branch information
theRealKLH authored Nov 16, 2023
2 parents 951879a + 6e90171 commit 7e61d90
Show file tree
Hide file tree
Showing 58 changed files with 254 additions and 331 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
node-version: '12'

- name: Checkout code
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4

- name: Check code formatting using gofmt
uses: Jerome1337/[email protected]
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
with:
ref: master
submodules: 'true'
Expand Down
18 changes: 9 additions & 9 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ require (
github.com/abbot/go-http-auth v0.4.0
github.com/anacrolix/ffprobe v1.1.0
github.com/araddon/dateparse v0.0.0-20210429162001-6b43995a97de
github.com/avast/retry-go/v4 v4.5.0
github.com/avast/retry-go/v4 v4.5.1
github.com/blevesearch/bleve/v2 v2.3.10
github.com/bregydoc/gtranslate v0.0.0-20200913051839-1bd07f6c1fc5
github.com/creasty/defaults v1.7.0
Expand Down Expand Up @@ -54,14 +54,14 @@ require (
github.com/thoas/go-funk v0.9.3
github.com/tidwall/gjson v1.17.0
github.com/x-cray/logrus-prefixed-formatter v0.5.2
github.com/xo/dburl v0.17.0
golang.org/x/crypto v0.14.0
golang.org/x/net v0.17.0
golang.org/x/oauth2 v0.13.0
golang.org/x/sys v0.13.0
golang.org/x/text v0.13.0
github.com/xo/dburl v0.17.1
golang.org/x/crypto v0.15.0
golang.org/x/net v0.18.0
golang.org/x/oauth2 v0.14.0
golang.org/x/sys v0.14.0
golang.org/x/text v0.14.0
gopkg.in/gormigrate.v1 v1.6.0
willnorris.com/go/imageproxy v0.11.3-0.20230802154432-da55ecefd3a9
willnorris.com/go/imageproxy v0.11.3-0.20231113231555-ef50c1f9a64e
)

require (
Expand Down Expand Up @@ -143,7 +143,7 @@ require (
github.com/xi2/xz v0.0.0-20171230120015-48954b6210f8 // indirect
go.etcd.io/bbolt v1.3.7 // indirect
golang.org/x/image v0.10.0 // indirect
golang.org/x/term v0.13.0 // indirect
golang.org/x/term v0.14.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/protobuf v1.31.0 // indirect
gopkg.in/sourcemap.v1 v1.0.5 // indirect
Expand Down
18 changes: 18 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ github.com/araddon/dateparse v0.0.0-20210429162001-6b43995a97de h1:FxWPpzIjnTlhP
github.com/araddon/dateparse v0.0.0-20210429162001-6b43995a97de/go.mod h1:DCaWoUhZrYW9p1lxo/cm8EmUOOzAPSEZNGF2DK1dJgw=
github.com/avast/retry-go/v4 v4.5.0 h1:QoRAZZ90cj5oni2Lsgl2GW8mNTnUCnmpx/iKpwVisHg=
github.com/avast/retry-go/v4 v4.5.0/go.mod h1:7hLEXp0oku2Nir2xBAsg0PTphp9z71bN5Aq1fboC3+I=
github.com/avast/retry-go/v4 v4.5.1 h1:AxIx0HGi4VZ3I02jr78j5lZ3M6x1E0Ivxa6b0pUUh7o=
github.com/avast/retry-go/v4 v4.5.1/go.mod h1:/sipNsvNB3RRuT5iNcb6h73nw3IBmXJ/H3XrCQYSOpc=
github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
github.com/bits-and-blooms/bitset v1.2.0 h1:Kn4yilvwNtMACtf1eYDlG8H77R07mZSPbMjLyS07ChA=
Expand Down Expand Up @@ -370,6 +372,8 @@ github.com/xo/dburl v0.16.0 h1:jlBeGe8fnsW+vBYemte903WHQbJnZx7OpJZy2ofq+5g=
github.com/xo/dburl v0.16.0/go.mod h1:B7/G9FGungw6ighV8xJNwWYQPMfn3gsi2sn5SE8Bzco=
github.com/xo/dburl v0.17.0 h1:sUgx24FNMbdxjutH6r4eg4y5S75RMjb/C+eGqnttcqU=
github.com/xo/dburl v0.17.0/go.mod h1:B7/G9FGungw6ighV8xJNwWYQPMfn3gsi2sn5SE8Bzco=
github.com/xo/dburl v0.17.1 h1:n8jpWqYwe8TJQ1n8OvJuKDP9GxnPS+52T/xQtjADTIM=
github.com/xo/dburl v0.17.1/go.mod h1:B7/G9FGungw6ighV8xJNwWYQPMfn3gsi2sn5SE8Bzco=
github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
go.etcd.io/bbolt v1.3.7 h1:j+zJOnnEjF/kyHlDDgGnVL/AIqIJPq8UoB2GSNfkUfQ=
go.etcd.io/bbolt v1.3.7/go.mod h1:N9Mkw9X8x5fupy0IKsmuqVtoGDyxsaDlbk4Rd05IAQw=
Expand All @@ -383,6 +387,8 @@ golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPh
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
golang.org/x/crypto v0.14.0 h1:wBqGXzWJW6m1XrIKlAH0Hs1JJ7+9KBwnIO8v66Q9cHc=
golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4=
golang.org/x/crypto v0.15.0 h1:frVn1TEaCEaZcn3Tmd7Y2b5KKPaZ+I32Q2OA3kYp5TA=
golang.org/x/crypto v0.15.0/go.mod h1:4ChreQoLWfG3xLDer1WdlH5NdlQ3+mwnQq1YTKY+72g=
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/image v0.0.0-20191009234506-e7c1f5e7dbb8/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
golang.org/x/image v0.10.0 h1:gXjUUtwtx5yOE0VKWq1CH4IJAClq4UGgUA3i+rpON9M=
Expand Down Expand Up @@ -416,12 +422,16 @@ golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg=
golang.org/x/net v0.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM=
golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE=
golang.org/x/net v0.18.0 h1:mIYleuAkSbHh0tCv7RvjL3F6ZVbLjq4+R7zbOn3Kokg=
golang.org/x/net v0.18.0/go.mod h1:/czyP5RqHAH4odGYxBJ1qz0+CE5WZ+2j1YgoEo8F2jQ=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/oauth2 v0.2.0/go.mod h1:Cwn6afJ8jrQwYMxQDTpISoXmXW9I6qF6vDeuuoX3Ibs=
golang.org/x/oauth2 v0.11.0 h1:vPL4xzxBM4niKCW6g9whtaWVXTJf1U5e4aZxxFx/gbU=
golang.org/x/oauth2 v0.11.0/go.mod h1:LdF7O/8bLR/qWK9DrpXmbHLTouvRHK0SgJl0GmDBchk=
golang.org/x/oauth2 v0.13.0 h1:jDDenyj+WgFtmV3zYVoi8aE2BwtXFLWOA67ZfNWftiY=
golang.org/x/oauth2 v0.13.0/go.mod h1:/JMhi4ZRXAf4HG9LiNmxvk+45+96RUlVThiH8FzNBn0=
golang.org/x/oauth2 v0.14.0 h1:P0Vrf/2538nmC0H+pEQ3MNFRRnVR7RlqyVw+bvm26z0=
golang.org/x/oauth2 v0.14.0/go.mod h1:lAtNWgaWfL4cm7j2OV8TxGi9Qb7ECORx8DktCY74OwM=
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
Expand Down Expand Up @@ -449,13 +459,17 @@ golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE=
golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.14.0 h1:Vz7Qs629MkJkGyHxUlRHizWJRG2j8fbQKjELVSNhy7Q=
golang.org/x/sys v0.14.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.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc=
golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k=
golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo=
golang.org/x/term v0.13.0 h1:bb+I9cTfFazGW51MZqBVmZy7+JEJMouUHTUSKVQLBek=
golang.org/x/term v0.13.0/go.mod h1:LTmsnFJwVN6bCy1rVCoS+qHT1HhALEFxKncY3WNNh4U=
golang.org/x/term v0.14.0 h1:LGK9IlZ8T9jvdy6cTdfKUCltatMFOehAQo9SRC46UQ8=
golang.org/x/term v0.14.0/go.mod h1:TySc+nGkYR6qt8km8wUhuFRTVSMIX3XPR58y2lC8vww=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
Expand All @@ -467,6 +481,8 @@ golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
golang.org/x/text v0.11.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k=
golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=
golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
golang.org/x/time v0.3.0 h1:rg5rLMjNzMS1RkNLzCG38eapWhnYLFYXDXj2gOlr8j4=
golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
Expand Down Expand Up @@ -533,3 +549,5 @@ willnorris.com/go/gifresize v1.0.0 h1:GKS68zjNhHMqkgNTv4iFAO/j/sNcVSOHQ7SqmDAIAm
willnorris.com/go/gifresize v1.0.0/go.mod h1:eBM8gogBGCcaH603vxSpnfjwXIpq6nmnj/jauBDKtAk=
willnorris.com/go/imageproxy v0.11.3-0.20230802154432-da55ecefd3a9 h1:q8x9zY+f2kiW9B2C7bseFNW44w4kKeAu9eoCplqeeZw=
willnorris.com/go/imageproxy v0.11.3-0.20230802154432-da55ecefd3a9/go.mod h1:hDdpt+NIOi8OsV4fa9pFjIpo/7DXd0in7wOF22Az/o0=
willnorris.com/go/imageproxy v0.11.3-0.20231113231555-ef50c1f9a64e h1:TF6FfnbyfLJJG3/xHBxbZralOo+wB0LMD0fFz30G9YU=
willnorris.com/go/imageproxy v0.11.3-0.20231113231555-ef50c1f9a64e/go.mod h1:dWeBm4q0BA+XSs5ZEp0Aab4M55uu1daFMrbewDqEO1w=
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@
"wampy": "6.4.2"
},
"devDependencies": {
"@babel/core": "7.23.2",
"@babel/eslint-parser": "7.22.15",
"@babel/core": "7.23.3",
"@babel/eslint-parser": "7.23.3",
"@vue/cli-plugin-babel": "5.0.8",
"@vue/cli-plugin-eslint": "5.0.8",
"@vue/cli-service": "5.0.8",
Expand Down
33 changes: 0 additions & 33 deletions pkg/api/actors.go
Original file line number Diff line number Diff line change
Expand Up @@ -487,39 +487,6 @@ func checkStringArrayChanged(field_name string, newValue *string, actorField *st
}
}

func checkURLArrayChanged(field_name string, newValue *string, actorField *string, actorId uint) {
if *actorField != *newValue {
var actorArray []models.ActorLink
var newArray []string
json.Unmarshal([]byte(*newValue), &newArray)
json.Unmarshal([]byte(*actorField), &actorArray)
for _, actorField := range actorArray {
exists := false
for _, newField := range newArray {
if newField == actorField.Url {
exists = true
}
}
if !exists {
models.AddActionActor(actorId, "edit_actor", "delete", field_name, actorField.Url)
}
}
for _, newField := range newArray {
exists := false
for _, actorField := range actorArray {
if newField == actorField.Url {
exists = true
}
}
if !exists {
models.AddActionActor(actorId, "edit_actor", "add", field_name, newField)
}
}

*actorField = *newValue
}
}

func (i ActorResource) setActorImage(req *restful.Request, resp *restful.Response) {
var r RequestSetActorImage
err := req.ReadEntity(&r)
Expand Down
2 changes: 1 addition & 1 deletion pkg/api/akas.go
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ func (i AkaResource) getAka(req *restful.Request, resp *restful.Response) {

var aka models.Aka
db, _ := models.GetDB()
err = aka.GetIfExistByPK(uint(sceneId))
_ = aka.GetIfExistByPK(uint(sceneId))
db.Close()

resp.WriteHeaderAndEntity(http.StatusOK, aka)
Expand Down
2 changes: 1 addition & 1 deletion pkg/api/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"github.com/xbapps/xbvr/pkg/common"
)

var log = common.Log
var log = &common.Log

func APIError(req *restful.Request, resp *restful.Response, status int, err error) {
resp.WriteError(status, err)
Expand Down
10 changes: 1 addition & 9 deletions pkg/api/dms.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import (
"net/http"
"path/filepath"
"strconv"
"time"

restfulspec "github.com/emicklei/go-restful-openapi/v2"
"github.com/emicklei/go-restful/v3"
Expand All @@ -19,13 +18,6 @@ import (

type DMSResource struct{}

var (
lastSessionID uint
lastSessionSceneID uint
lastSessionStart time.Time
lastSessionEnd time.Time
)

func (i DMSResource) WebService() *restful.WebService {
tags := []string{"DMS"}

Expand Down Expand Up @@ -112,6 +104,6 @@ func (i DMSResource) getFile(req *restful.Request, resp *restful.Response) {
if err != nil {
return
}
http.Redirect(resp.ResponseWriter, req.Request, url, 302)
http.Redirect(resp.ResponseWriter, req.Request, url, http.StatusFound)
}
}
6 changes: 3 additions & 3 deletions pkg/api/files.go
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ func removeFileByFileId(fileId uint) models.Scene {
if err == nil {
deleted = true
} else {
log.Errorf("Error deleting file ", err)
log.Errorf("error deleting file: %v", err)
}
case "putio":
id, err := strconv.ParseInt(file.Path, 10, 64)
Expand All @@ -343,7 +343,7 @@ func removeFileByFileId(fileId uint) models.Scene {
if err == nil {
deleted = true
} else {
log.Errorf("Error deleting file ", err)
log.Errorf("error deleting file %v", err)
}
}

Expand All @@ -355,7 +355,7 @@ func removeFileByFileId(fileId uint) models.Scene {
}
}
} else {
log.Errorf("Error deleting file ", err)
log.Errorf("error deleting file %v", err)
}
return scene
}
24 changes: 5 additions & 19 deletions pkg/api/heresphere.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ import (
"encoding/base64"
"encoding/json"
"fmt"
"io/ioutil"
"io"
"math"
"net/http"
"os"
"path/filepath"
"sort"
"strconv"
Expand Down Expand Up @@ -107,7 +108,7 @@ type HereSphereAuthRequest struct {
var RequestBody []byte

func HeresphereAuthFilter(req *restful.Request, resp *restful.Response, chain *restful.FilterChain) {
RequestBody, _ = ioutil.ReadAll(req.Request.Body)
RequestBody, _ = io.ReadAll(req.Request.Body)
if isDeoAuthEnabled() {
var authorized bool
var requestData HereSphereAuthRequest
Expand Down Expand Up @@ -358,13 +359,7 @@ func (i HeresphereResource) getHeresphereScene(req *restful.Request, resp *restf
if len(encoding.VideoSources) > 0 {
hsp.Name = encoding.Name
for _, source := range encoding.VideoSources {
hspSource := HeresphereSource{
URL: source.URL,
Width: source.Width,
Height: source.Height,
Resolution: source.Resolution,
Size: source.Size,
}
hspSource := HeresphereSource(source)
hsp.Sources = append(hsp.Sources, hspSource)
}
media = append(media, hsp)
Expand Down Expand Up @@ -893,7 +888,7 @@ func ProcessHeresphereUpdates(scene *models.Scene, requestData HereSphereAuthReq
}

fName := filepath.Join(scene.Files[0].Path, strings.TrimSuffix(scene.Files[0].Filename, filepath.Ext(videoFile.Filename))+".hsp")
ioutil.WriteFile(fName, hspContent, 0644)
os.WriteFile(fName, hspContent, 0644)

tasks.ScanLocalHspFile(fName, videoFile.VolumeID, scene.ID)
}
Expand Down Expand Up @@ -949,15 +944,6 @@ func findEndPos(requestData HereSphereAuthRequest) float64 {
return endpos
}

func matchCuepoint(findCuepoint models.SceneCuepoint, cuepointList []models.SceneCuepoint) int {
for idx, cuepoint := range cuepointList {
if cuepoint.Name == findCuepoint.Name && cuepoint.TimeStart == findCuepoint.TimeStart && *cuepoint.Track == *findCuepoint.Track && cuepoint.TimeEnd == findCuepoint.TimeEnd {
return idx
}
}
return -1
}

func (i HeresphereResource) getHeresphereLibrary(req *restful.Request, resp *restful.Response) {
log.Infof("getHeresphereLibrary called, enabled %v", config.Config.Interfaces.DeoVR.Enabled)
if !config.Config.Interfaces.DeoVR.Enabled {
Expand Down
5 changes: 2 additions & 3 deletions pkg/api/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import (
"crypto/sha1"
"encoding/json"
"fmt"
"io/ioutil"
"net/http"
"os"
"path/filepath"
Expand Down Expand Up @@ -71,7 +70,7 @@ type RequestSaveOptionsAdvanced struct {
}

type RequestSaveOptionsFunscripts struct {
ScrapeFunscripts bool `json:"scrapeFunscripts":`
ScrapeFunscripts bool `json:"scrapeFunscripts"`
}
type RequestSaveOptionsDLNA struct {
Enabled bool `json:"enabled"`
Expand Down Expand Up @@ -935,7 +934,7 @@ func (i ConfigResource) createCustomSite(req *restful.Request, resp *restful.Res
scraperConfig.CustomScrapers.VrpornScrapers = scrapers["vrporn"]
fName := filepath.Join(common.AppDir, "scrapers.json")
list, _ := json.MarshalIndent(scraperConfig, "", " ")
ioutil.WriteFile(fName, list, 0644)
os.WriteFile(fName, list, 0644)

resp.WriteHeader(http.StatusOK)
}
4 changes: 2 additions & 2 deletions pkg/api/scenes.go
Original file line number Diff line number Diff line change
Expand Up @@ -676,7 +676,7 @@ func (i SceneResource) deleteSceneCuepoint(req *restful.Request, resp *restful.R
db.Delete(&cuepoint)

var scene models.Scene
err = scene.GetIfExistByPK(uint(sceneId))
_ = scene.GetIfExistByPK(uint(sceneId))
defer db.Close()

resp.WriteHeaderAndEntity(http.StatusOK, scene)
Expand Down Expand Up @@ -739,7 +739,7 @@ func (i SceneResource) selectScript(req *restful.Request, resp *restful.Response
}
}
}
err = scene.GetIfExistByPK(uint(sceneId))
_ = scene.GetIfExistByPK(uint(sceneId))
}
db.Close()

Expand Down
Loading

0 comments on commit 7e61d90

Please sign in to comment.