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 9, 2023
2 parents 3427c09 + e12f37a commit 951879a
Show file tree
Hide file tree
Showing 9 changed files with 37 additions and 29 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- name: Install Go
uses: actions/setup-go@v4
with:
go-version: 1.19.x
go-version: 1.20.x

- name: Install Node.js
uses: actions/setup-node@v3
Expand Down
2 changes: 1 addition & 1 deletion .gitpod.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ ENV HOME=/home/gitpod
WORKDIR $HOME
USER gitpod

ENV GO_VERSION=1.19.6 \
ENV GO_VERSION=1.20.10 \
GOPATH=$HOME/go-packages \
GOROOT=$HOME/go
RUN export PATH=$(echo "$PATH" | sed -e 's|:/workspace/go/bin||' -e 's|:/home/gitpod/go/bin||' -e 's|:/home/gitpod/go-packages/bin||')
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
GORELEASER_CROSS_VERSION ?= v1.19.6
GORELEASER_CROSS_VERSION ?= v1.20.10

SYSROOT_DIR ?= sysroots
SYSROOT_ARCHIVE ?= sysroots.tar.bz2
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ Ask your questions and suggest features on [Discord](https://discord.gg/wdCHXAG)

Make sure you have following installed:

- Go 1.19
- Go 1.20
- Node.js 12.x
- Yarn 1.17.x
- air (run `go install github.com/cosmtrek/air@latest` outside project directory)
Expand Down
10 changes: 5 additions & 5 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/xbapps/xbvr

go 1.19
go 1.20

require (
github.com/ProtonMail/go-appdir v1.1.0
Expand Down Expand Up @@ -48,16 +48,16 @@ require (
github.com/putdotio/go-putio v1.7.1
github.com/robertkrimen/otto v0.2.1
github.com/robfig/cron/v3 v3.0.1
github.com/rs/cors v1.9.0
github.com/rs/cors v1.10.1
github.com/sirupsen/logrus v1.9.3
github.com/skratchdot/open-golang v0.0.0-20200116055534-eef842397966
github.com/thoas/go-funk v0.9.3
github.com/tidwall/gjson v1.16.0
github.com/tidwall/gjson v1.17.0
github.com/x-cray/logrus-prefixed-formatter v0.5.2
github.com/xo/dburl v0.16.0
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.11.0
golang.org/x/oauth2 v0.13.0
golang.org/x/sys v0.13.0
golang.org/x/text v0.13.0
gopkg.in/gormigrate.v1 v1.6.0
Expand Down
8 changes: 8 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,8 @@ github.com/robfig/cron/v3 v3.0.1/go.mod h1:eQICP3HwyT7UooqI/z+Ov+PtYAWygg1TEWWzG
github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ=
github.com/rs/cors v1.9.0 h1:l9HGsTsHJcvW14Nk7J9KFz8bzeAWXn3CG6bgt7LsrAE=
github.com/rs/cors v1.9.0/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU=
github.com/rs/cors v1.10.1 h1:L0uuZVXIKlI1SShY2nhFfo44TYvDPQ1w4oFkUJNfhyo=
github.com/rs/cors v1.10.1/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU=
github.com/rwcarlsen/goexif v0.0.0-20190401172101-9e8deecbddbd h1:CmH9+J6ZSsIjUK3dcGsnCnO41eRBOnY12zwkn5qVwgc=
github.com/rwcarlsen/goexif v0.0.0-20190401172101-9e8deecbddbd/go.mod h1:hPqNNc0+uJM6H+SuU8sEs5K5IQeKccPqeSjfgcKGgPk=
github.com/saintfish/chardet v0.0.0-20120816061221-3af4cd4741ca h1:NugYot0LIVPxTvN8n+Kvkn6TrbMyxQiuvKdEwFdR9vI=
Expand All @@ -347,6 +349,8 @@ github.com/thoas/go-funk v0.9.3 h1:7+nAEx3kn5ZJcnDm2Bh23N2yOtweO14bi//dvRtgLpw=
github.com/thoas/go-funk v0.9.3/go.mod h1:+IWnUfUmFO1+WVYQWQtIJHeRRdaIyyYglZN7xzUPe4Q=
github.com/tidwall/gjson v1.16.0 h1:SyXa+dsSPpUlcwEDuKuEBJEz5vzTvOea+9rjyYodQFg=
github.com/tidwall/gjson v1.16.0/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk=
github.com/tidwall/gjson v1.17.0 h1:/Jocvlh98kcTfpN2+JzGQWQcqrPQwDrVEMApx/M5ZwM=
github.com/tidwall/gjson v1.17.0/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk=
github.com/tidwall/match v1.1.1 h1:+Ho715JplO36QYgwN9PGYNhgZvoUSc9X2c80KVTi+GA=
github.com/tidwall/match v1.1.1/go.mod h1:eRSPERbgtNPcGhD8UCthc6PmLEQXEWd3PRB5JTxsfmM=
github.com/tidwall/pretty v1.2.0 h1:RWIZEg2iJ8/g6fDDYzMpobmaoGh5OLl4AXtGUGPcqCs=
Expand All @@ -364,6 +368,8 @@ github.com/xi2/xz v0.0.0-20171230120015-48954b6210f8 h1:nIPpBwaJSVYIxUFsDv3M8ofm
github.com/xi2/xz v0.0.0-20171230120015-48954b6210f8/go.mod h1:HUYIGzjTL3rfEspMxjDjgmT5uz5wzYJKVo23qUhYTos=
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/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 Down Expand Up @@ -414,6 +420,8 @@ golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAG
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/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
8 changes: 8 additions & 0 deletions pkg/models/model_external_reference.go
Original file line number Diff line number Diff line change
Expand Up @@ -859,6 +859,10 @@ func (scrapeRules ActorScraperConfig) buildGenericActorScraperRules() {
})
scrapeRules.GenericActorScrapingConfig["realjamvr scrape"] = siteDetails

// use the site rules just setup for realjamvr, just need to update the Domain to use
siteDetails.Domain = "porncornvr.com"
scrapeRules.GenericActorScrapingConfig["porncornvr scrape"] = siteDetails

siteDetails = GenericScraperRuleSet{}
siteDetails.Domain = "povr.com"
siteDetails.SiteRules = append(siteDetails.SiteRules, GenericActorScraperRule{XbvrField: "image_url", Selector: `script[type="application/ld+json"]`, PostProcessing: []PostProcessing{{Function: "jsonString", Params: []string{"image"}}}})
Expand Down Expand Up @@ -1045,6 +1049,7 @@ func (scrapeRules ActorScraperConfig) getSiteUrlMatchingRules() {

var sites []Site

// if the scene_url in xbvr and stash typically matches, then no special rules required
scrapeRules.StashSceneMatching["allvrporn-vrporn"] = StashSiteConfig{StashId: "44fd483b-85eb-4b22-b7f2-c92c1a50923a"}
scrapeRules.StashSceneMatching["bvr"] = StashSiteConfig{StashId: "1ffbd972-7d69-4ccb-b7da-c6342a9c3d70"}
scrapeRules.StashSceneMatching["cuties-vr"] = StashSiteConfig{StashId: "1e5240a8-29b3-41ed-ae28-fc9231eac449"}
Expand Down Expand Up @@ -1077,8 +1082,11 @@ func (scrapeRules ActorScraperConfig) getSiteUrlMatchingRules() {
scrapeRules.StashSceneMatching["vrsolos"] = StashSiteConfig{StashId: "b2d048da-9180-4e43-b41a-bdb4d265c8ec"}
scrapeRules.StashSceneMatching["vrspy"] = StashSiteConfig{StashId: "513001ef-dff4-476d-840d-e22ef27e81ed"}
scrapeRules.StashSceneMatching["wankitnowvr"] = StashSiteConfig{StashId: "acb1ed8f-4967-4c5a-b16a-7025bdeb75c5"}
scrapeRules.StashSceneMatching["porncornvr"] = StashSiteConfig{StashId: "9ecb1d29-64e8-4336-9bd2-5dda53341e29"}

scrapeRules.StashSceneMatching["wetvr"] = StashSiteConfig{StashId: "981887d6-da48-4dfc-88d1-7ed13a2754f2"}

// setup special rules to match scenes in xbvr and stashdb, rather than assuming scene_urls match
scrapeRules.StashSceneMatching["wankzvr"] = StashSiteConfig{
StashId: "b04bca51-15ea-45ab-80f6-7b002fd4a02d",
Rules: []SceneMatchRule{{XbvrField: "scene_id", XbvrMatch: `-\d+$`, XbvrMatchResultPosition: 0, StashRule: `(povr|wankzvr).com\/(.*)(-\d*?)\/?$`, StashMatchResultPosition: 3}},
Expand Down
5 changes: 5 additions & 0 deletions pkg/scrape/scrape.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ func createCollector(domains ...string) *colly.Collector {
colly.UserAgent(UserAgent),
)

// Set error handler
c.OnError(func(r *colly.Response, err error) {
log.Errorf("Error visiting %s %s", r.Request.URL, err)
})

c = createCallbacks(c)
return c
}
Expand Down
27 changes: 7 additions & 20 deletions ui/src/views/scenes/EditScene.vue
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,9 @@ export default {
}
try {
scene.files = JSON.parse(scene.filenames_arr)
if (scene.files == null) {
scene.files = []
}
} catch {
scene.files = []
}
Expand Down Expand Up @@ -207,27 +210,11 @@ export default {
this.scene.filenames_arr = JSON.stringify(this.scene.files)
this.scene.duration = String(this.scene.duration) // force to a string, if no change the UI sends an int, otherwise a string, nust be constant
ky.post(`/api/scene/edit/${this.scene.id}`, { json: { ...this.scene } })
this.scene.cast = this.scene.castArray.map(a => {
const find = this.scene.cast.find(o => o.name === a)
if (find) return find
return {
name: a,
count: 0
}
})
this.scene.tags = this.scene.tagsArray.map(t => {
const find = this.scene.tags.find(o => o.name === t)
if (find) return find
return {
name: t,
count: 0
}
})
ky.post(`/api/scene/edit/${this.scene.id}`, { json: { ...this.scene } }).json().then(data => {
this.$store.commit('sceneList/updateScene', data)
this.$store.commit('overlay/showDetails', { scene: data })
})
this.$store.commit('sceneList/updateScene', this.scene)
this.changesMade = false
this.close()
Expand Down

0 comments on commit 951879a

Please sign in to comment.