Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit037a1b4

Browse files
authored
feat: add Has Image Filter
* Update RescrapeButton.vueUpdated the Rescrape Scene function to work with scenes that have scrape_id and belong to a configured scraper. By toggling it's needs_update and running that scraper.It can be useful in case of single scenes without images.I've had to add a small delay (200ms) as it was not triggering the forceUpdate when making the API call, even when checking if this.item.needs_update was true.* Replaced github.com/cosmtrek/air with github.com/air-verse/airThe repo github.com/cosmtrek/air doesn't exist anymore. When running Gitpod, it suggests using github.com/air-verse/air instead.* Replaced github.com/cosmtrek/air with github.com/air-verse/airThe repo github.com/cosmtrek/air doesn't exist anymore. When running Gitpod, it suggests using github.com/air-verse/air instead.* Added the missing Has Image case
1 parent80c7a82 commit037a1b4

File tree

4 files changed

+44
-33
lines changed

4 files changed

+44
-33
lines changed

‎.gitpod.dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ RUN export PATH=$(echo "$PATH" | sed -e 's|:/workspace/go/bin||' -e 's|:/home/gi
1111
ENV PATH=$GOROOT/bin:$GOPATH/bin:$PATH
1212

1313
RUN go install -v \
14-
github.com/cosmtrek/air@latest && \
14+
github.com/air-verse/air@latest && \
1515
sudo rm -rf $GOPATH/src && \
1616
sudo rm -rf $GOPATH/pkg
1717
# user Go packages

‎.gitpod.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ image:
22
file:.gitpod.dockerfile
33
tasks:
44
-name:Continuous Build
5-
command:yarn config set ignore-engines true && yarn global add concurrently && go install github.com/cosmtrek/air@latest && cd /workspace/xbvr && go generate && go get && yarn && yarn dev
5+
command:yarn config set ignore-engines true && yarn global add concurrently && go install github.com/air-verse/air@latest && cd /workspace/xbvr && go generate && go get && yarn && yarn dev
66
ports:
77
-port:9999
88
onOpen:open-preview

‎pkg/models/model_scene.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -885,6 +885,8 @@ func queryScenes(db *gorm.DB, r RequestSceneList) (*gorm.DB, *gorm.DB) {
885885
where=`scenes.scene_id like "povr-%"`
886886
case"SLR Scraper":
887887
where=`scenes.scene_id like "slr-%"`
888+
case"Has Image":
889+
where="cover_url not in ('','http://localhost/dont_cause_errors')"
888890
case"VRPHub Scraper":
889891
where=`scenes.scene_id like "vrphub-%"`
890892
case"VRPorn Scraper":

‎ui/src/components/RescrapeButton.vue

Lines changed: 40 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<template>
22
<aclass="button is-dark is-outlined is-small"
3-
@click="rescrapeSingleScene()"
4-
:title="'Rescrapescene'">
3+
@click="rescrapeScene()"
4+
:title="'RescrapeScene'">
55
<b-iconpack="mdi"icon="web-refresh"size="is-small"/>
66
</a>
77
</template>
@@ -12,44 +12,53 @@ export default {
1212
name:'RescrapeButton',
1313
props: { item:Object },
1414
methods: {
15-
asyncrescrapeSingleScene () {
15+
delay(ms) {
16+
returnnewPromise(resolve=>setTimeout(resolve, ms));
17+
},
18+
asyncrescrapeScene () {
1619
let site=""
1720
18-
if (this.item.scene_url.toLowerCase().includes("dmm.co.jp")) {
19-
ky.post('/api/task/scrape-javr', { json: { s:"r18d", q:this.item.scene_id } })
21+
this.$store.commit('sceneList/toggleSceneList', {scene_id:this.item.scene_id, list:'needs_update'})
22+
if (this.item.scraper_id&&this.item.needs_update) {
23+
awaitthis.delay(200);
24+
ky.get(`/api/task/scrape?site=${this.item.scraper_id}`)
2025
}else {
26+
if (this.item.scene_url.toLowerCase().includes("dmm.co.jp")) {
27+
ky.post('/api/task/scrape-javr', { json: { s:"r18d", q:this.item.scene_id } })
28+
}else {
2129
22-
constsites=awaitky.get('/api/options/sites').json()
23-
console.info(sites)
30+
constsites=awaitky.get('/api/options/sites').json()
31+
console.info(sites)
2432
25-
for (constelementof sites) {
26-
if (this.item.scene_url.toLowerCase().includes(element.id)) {
27-
site=element.id
33+
for (constelementof sites) {
34+
if (this.item.scene_url.toLowerCase().includes(element.id)) {
35+
site=element.id
36+
}
2837
}
29-
}
3038
31-
if (this.item.scene_url.toLowerCase().includes("sexlikereal.com")) {
32-
site="slr-single_scene"
33-
}
34-
if (this.item.scene_url.toLowerCase().includes("czechvrnetwork.com")) {
35-
site="czechvr-single_scene"
36-
}
37-
if (this.item.scene_url.toLowerCase().includes("povr.com")) {
38-
site="povr-single_scene"
39-
}
40-
if (this.item.scene_url.toLowerCase().includes("vrporn.com")) {
41-
site="vrporn-single_scene"
42-
}
43-
if (this.item.scene_url.toLowerCase().includes("vrphub.com")) {
44-
site="vrphub-single_scene"
39+
if (this.item.scene_url.toLowerCase().includes("sexlikereal.com")) {
40+
site="slr-single_scene"
41+
}
42+
if (this.item.scene_url.toLowerCase().includes("czechvrnetwork.com")) {
43+
site="czechvr-single_scene"
44+
}
45+
if (this.item.scene_url.toLowerCase().includes("povr.com")) {
46+
site="povr-single_scene"
47+
}
48+
if (this.item.scene_url.toLowerCase().includes("vrporn.com")) {
49+
site="vrporn-single_scene"
50+
}
51+
if (this.item.scene_url.toLowerCase().includes("vrphub.com")) {
52+
site="vrphub-single_scene"
53+
}
54+
if (site=="") {
55+
this.$buefy.toast.open({message:`No scrapers exist for this domain`, type:'is-danger', duration:5000})
56+
return
57+
}
58+
ky.post(`/api/task/singlescrape`, {timeout:false, json: { site: site, sceneurl:this.item.scene_url, additionalinfo:[] }})
4559
}
46-
if (site=="") {
47-
this.$buefy.toast.open({message:`No scrapers exist for this domain`, type:'is-danger', duration:5000})
48-
return
49-
}
50-
ky.post(`/api/task/singlescrape`, {timeout:false, json: { site: site, sceneurl:this.item.scene_url, additionalinfo:[] }})
5160
}
5261
}
5362
}
5463
}
55-
</script>
64+
</script>

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp