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 28, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
2 parents f0faa1e + 8b2c1c8 commit c293f7d
Showing 9 changed files with 57 additions and 21 deletions.
10 changes: 5 additions & 5 deletions go.mod
Original file line number Diff line number Diff line change
@@ -55,10 +55,10 @@ require (
github.com/tidwall/gjson v1.17.0
github.com/x-cray/logrus-prefixed-formatter v0.5.2
github.com/xo/dburl v0.18.2
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/crypto v0.16.0
golang.org/x/net v0.19.0
golang.org/x/oauth2 v0.15.0
golang.org/x/sys v0.15.0
golang.org/x/text v0.14.0
gopkg.in/gormigrate.v1 v1.6.0
willnorris.com/go/imageproxy v0.11.3-0.20231113231555-ef50c1f9a64e
@@ -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.14.0 // indirect
golang.org/x/term v0.15.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
10 changes: 10 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
@@ -384,6 +384,8 @@ golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5y
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/crypto v0.16.0 h1:mMMrFzRSCF0GvB7Ne27XVtVAaXLrPmgPC7/v0tkwHaY=
golang.org/x/crypto v0.16.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4=
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=
@@ -418,10 +420,14 @@ golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg=
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/net v0.19.0 h1:zTwKpTd2XuCqf8huc7Fo2iSy+4RHPd10s4KzeTnVr1c=
golang.org/x/net v0.19.0/go.mod h1:CfAk/cbD4CthTvqiEl8NpboMuiuOYsAr/7NOjZJtv1U=
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.14.0 h1:P0Vrf/2538nmC0H+pEQ3MNFRRnVR7RlqyVw+bvm26z0=
golang.org/x/oauth2 v0.14.0/go.mod h1:lAtNWgaWfL4cm7j2OV8TxGi9Qb7ECORx8DktCY74OwM=
golang.org/x/oauth2 v0.15.0 h1:s8pnnxNVzjWyrvYdFUQq5llS1PX2zhPXmccZv99h7uQ=
golang.org/x/oauth2 v0.15.0/go.mod h1:q48ptWNTY5XWf+JNten23lcvHpLJ0ZSxF5ttTHKVCAM=
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=
@@ -450,6 +456,8 @@ golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
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/sys v0.15.0 h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc=
golang.org/x/sys v0.15.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=
@@ -458,6 +466,8 @@ golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo=
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/term v0.15.0 h1:y/Oo/a/q3IXu26lQgl04j/gjuBDOBlx7X6Om1j2CPW4=
golang.org/x/term v0.15.0/go.mod h1:BDl952bC7+uMoWR75FIrCDx79TPU9oHkTZ9yRbYOrX0=
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=
4 changes: 3 additions & 1 deletion pkg/api/options.go
Original file line number Diff line number Diff line change
@@ -56,6 +56,7 @@ type RequestSaveOptionsWeb struct {
ShowSubtitlesFile bool `json:"showSubtitlesFile"`
SceneTrailerlist bool `json:"sceneTrailerlist"`
ShowScriptHeatmap bool `json:"showScriptHeatmap"`
ShowAllHeatmaps bool `json:"showAllHeatmaps"`
UpdateCheck bool `json:"updateCheck"`
IsAvailOpacity int `json:"isAvailOpacity"`
}
@@ -381,6 +382,7 @@ func (i ConfigResource) saveOptionsWeb(req *restful.Request, resp *restful.Respo
config.Config.Web.ShowSubtitlesFile = r.ShowSubtitlesFile
config.Config.Web.SceneTrailerlist = r.SceneTrailerlist
config.Config.Web.ShowScriptHeatmap = r.ShowScriptHeatmap
config.Config.Web.ShowAllHeatmaps = r.ShowAllHeatmaps
config.Config.Web.UpdateCheck = r.UpdateCheck
config.Config.Web.IsAvailOpacity = r.IsAvailOpacity
config.SaveConfig()
@@ -919,7 +921,7 @@ func (i ConfigResource) createCustomSite(req *restful.Request, resp *restful.Res
scraper := config.ScraperConfig{URL: r.Url, Name: r.Name, Company: r.Company, AvatarUrl: r.Avatar}
switch match[3] {
case "povr":
scrapers["povr"] = append(scrapers["povrr"], scraper)
scrapers["povr"] = append(scrapers["povr"], scraper)
case "sexlikereal":
scrapers["slr"] = append(scrapers["slr"], scraper)
case "vrphub":
1 change: 1 addition & 0 deletions pkg/config/config.go
Original file line number Diff line number Diff line change
@@ -42,6 +42,7 @@ type ObjectConfig struct {
ShowSubtitlesFile bool `default:"true" json:"showSubtitlesFile"`
SceneTrailerlist bool `default:"true" json:"sceneTrailerlist"`
ShowScriptHeatmap bool `default:"true" json:"showScriptHeatmap"`
ShowAllHeatmaps bool `default:"false" json:"showAllHeatmaps"`
UpdateCheck bool `default:"true" json:"updateCheck"`
IsAvailOpacity int `default:"40" json:"isAvailOpacity"`
} `json:"web"`
1 change: 1 addition & 0 deletions pkg/config/state.go
Original file line number Diff line number Diff line change
@@ -25,6 +25,7 @@ type ObjectState struct {
ShowSubtitlesFile bool `json:"showSubtitlesFile"`
SceneTrailerlist bool `json:"sceneTrailerlist"`
ShowScriptHeatmap bool `json:"showScriptHeatmap"`
ShowAllHeatmaps bool `json:"showAllHeatmaps"`
UpdateCheck bool `json:"updateCheck"`
IsAvailOpacity int `json:"isAvailOpacity"`
} `json:"web"`
8 changes: 5 additions & 3 deletions pkg/scrape/czechvr.go
Original file line number Diff line number Diff line change
@@ -105,11 +105,13 @@ func CzechVR(wg *sync.WaitGroup, updateSite bool, knownScenes []string, out chan
}

// trailer details
sc.TrailerType = "heresphere"
// extract internal id with (\d+)
var re = regexp.MustCompile(`(?m)https:\/\/www.czechvrnetwork.com\/detail-(\d+)`)
r := re.FindStringSubmatch(sc.HomepageURL)
sc.TrailerSrc = "https://www.czechvrnetwork.com/heresphere/videoID" + r[1]
if len(r) > 0 {
sc.TrailerType = "heresphere"
sc.TrailerSrc = "https://www.czechvrnetwork.com/heresphere/videoID" + r[1]
}

// Filenames
e.ForEach(`div.post div.download a.trailer`, func(id int, e *colly.HTMLElement) {
@@ -155,7 +157,7 @@ func CzechVR(wg *sync.WaitGroup, updateSite bool, knownScenes []string, out chan

siteCollector.OnHTML(`div.postTag`, func(e *colly.HTMLElement) {
sceneURL := ""
e.ForEach(`div.foto a`, func(id int, e *colly.HTMLElement) {
e.ForEach(`div.navez h2 a`, func(id int, e *colly.HTMLElement) {
sceneURL = e.Request.AbsoluteURL(e.Attr("href"))
// If scene exist in database, there's no need to scrape
if !funk.ContainsString(knownScenes, sceneURL) {
3 changes: 3 additions & 0 deletions ui/src/store/optionsWeb.js
Original file line number Diff line number Diff line change
@@ -18,6 +18,7 @@ const state = {
updateCheck: true,
isAvailOpacity: 40,
showScriptHeatmap: false,
showAllHeatmaps: false,
updateCheck: true
}
}
@@ -43,6 +44,7 @@ const actions = {
state.web.showSubtitlesFile = data.config.web.showSubtitlesFile
state.web.sceneTrailerlist = data.config.web.sceneTrailerlist
state.web.showScriptHeatmap = data.config.web.showScriptHeatmap
state.web.showAllHeatmaps = data.config.web.showAllHeatmaps
state.web.updateCheck = data.config.web.updateCheck
state.web.isAvailOpacity = data.config.web.isAvailOpacity
state.loading = false
@@ -66,6 +68,7 @@ const actions = {
state.web.showSubtitlesFile = data.showSubtitlesFile
state.web.sceneTrailerlist = data.sceneTrailerlist
state.web.showScriptHeatmap = data.showScriptHeatmap
state.web.showAllHeatmaps = data.showAllHeatmaps
state.web.updateCheck = data.updateCheck
state.web.isAvailOpacity = data.isAvailOpacity
state.loading = false
13 changes: 13 additions & 0 deletions ui/src/views/options/sections/InterfaceWeb.vue
Original file line number Diff line number Diff line change
@@ -80,6 +80,11 @@
show Script Heatmap
</b-switch>
</b-field>
<b-field v-if="ScriptHeatmap">
<b-switch v-model="AllHeatmaps" type="is-dark">
show All Heatmaps
</b-switch>
</b-field>
<b-field label="Opacity of unavailable scenes">
<div class="columns">
<div class="column is-two-thirds">
@@ -188,6 +193,14 @@ export default {
this.$store.state.optionsWeb.web.showScriptHeatmap = value
}
},
AllHeatmaps: {
get () {
return this.$store.state.optionsWeb.web.showAllHeatmaps
},
set (value) {
this.$store.state.optionsWeb.web.showAllHeatmaps = value
}
},
updateCheck: {
get () {
return this.$store.state.optionsWeb.web.updateCheck
28 changes: 16 additions & 12 deletions ui/src/views/scenes/SceneCard.vue
Original file line number Diff line number Diff line change
@@ -41,9 +41,9 @@
{{item.duration}}m
</b-tag>
</div>
<div v-if="this.$store.state.optionsWeb.web.showScriptHeatmap && (f = getFunscript())" style="padding: 0px 5px 5px">
<div v-if="f.has_heatmap" class="heatmapFunscript">
<img :src="getHeatmapURL(f.id)"/>
<div v-if="this.$store.state.optionsWeb.web.showScriptHeatmap && (files = getFunscripts(this.$store.state.optionsWeb.web.showAllHeatmaps))" style="padding: 0px 5px 5px">
<div v-if="files.length" class="heatmapFunscript">
<img v-for="file in files" :src="getHeatmapURL(file.id)"/>
</div>
</div>
</div>
@@ -168,17 +168,21 @@ export default {
getHeatmapURL (fileId) {
return `/api/dms/heatmap/${fileId}`
},
getFunscript() {
if (this.item.file !== null) {
let script;
if (script = this.item.file.find((a) => a.type === 'script' && a.has_heatmap && a.is_selected_script)) {
return script
}
if (script = this.item.file.find((a) => a.type === 'script' && a.has_heatmap)) {
return script
getFunscripts (showAll) {
if (showAll) {
return this.item.file !== null && this.item.file.filter(a => a.type === 'script' && a.has_heatmap);
} else {
if (this.item.file !== null) {
let script;
if (script = this.item.file.find((a) => a.type === 'script' && a.has_heatmap && a.is_selected_script)) {
return [script]
}
if (script = this.item.file.find((a) => a.type === 'script' && a.has_heatmap)) {
return [script]
}
}
return false;
}
return false;
}
}
}

0 comments on commit c293f7d

Please sign in to comment.