Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/pr/1453' into impatient
Browse files Browse the repository at this point in the history
  • Loading branch information
vt-idiot committed Oct 30, 2023
2 parents 393066a + ffdf892 commit 5bbbc63
Show file tree
Hide file tree
Showing 7 changed files with 42 additions and 5 deletions.
2 changes: 2 additions & 0 deletions pkg/api/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ type RequestSaveOptionsWeb struct {
ShowSubtitlesFile bool `json:"showSubtitlesFile"`
SceneTrailerlist bool `json:"sceneTrailerlist"`
UpdateCheck bool `json:"updateCheck"`
IsAvailOpacity int `json:"isAvailOpacity"`
}

type RequestSaveOptionsAdvanced struct {
Expand Down Expand Up @@ -380,6 +381,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.UpdateCheck = r.UpdateCheck
config.Config.Web.IsAvailOpacity = r.IsAvailOpacity
config.SaveConfig()

resp.WriteHeaderAndEntity(http.StatusOK, r)
Expand Down
1 change: 1 addition & 0 deletions pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ type ObjectConfig struct {
ShowSubtitlesFile bool `default:"true" json:"showSubtitlesFile"`
SceneTrailerlist bool `default:"true" json:"sceneTrailerlist"`
UpdateCheck bool `default:"true" json:"updateCheck"`
IsAvailOpacity int `default:"40" json:"isAvailOpacity"`
} `json:"web"`
Advanced struct {
ShowInternalSceneId bool `default:"false" json:"showInternalSceneId"`
Expand Down
1 change: 1 addition & 0 deletions pkg/config/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ type ObjectState struct {
ShowSubtitlesFile bool `json:"showSubtitlesFile"`
SceneTrailerlist bool `json:"sceneTrailerlist"`
UpdateCheck bool `json:"updateCheck"`
IsAvailOpacity int `json:"isAvailOpacity"`
} `json:"web"`
DLNA struct {
Running bool `json:"running"`
Expand Down
5 changes: 4 additions & 1 deletion ui/src/store/optionsWeb.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ const state = {
showHspFile: true,
showSubtitlesFile: true,
sceneTrailerlist: true,
updateCheck: true
updateCheck: true,
isAvailOpacity: 40,
}
}

Expand All @@ -40,6 +41,7 @@ const actions = {
state.web.showSubtitlesFile = data.config.web.showSubtitlesFile
state.web.sceneTrailerlist = data.config.web.sceneTrailerlist
state.web.updateCheck = data.config.web.updateCheck
state.web.isAvailOpacity = data.config.web.isAvailOpacity
state.loading = false
})
},
Expand All @@ -61,6 +63,7 @@ const actions = {
state.web.showSubtitlesFile = data.showSubtitlesFile
state.web.sceneTrailerlist = data.sceneTrailerlist
state.web.updateCheck = data.updateCheck
state.web.isAvailOpacity = data.isAvailOpacity
state.loading = false
})
}
Expand Down
8 changes: 7 additions & 1 deletion ui/src/views/actors/ActorCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<div class="card is-shadowless">
<div class="card-image">
<div class="bbox"
v-bind:style="{backgroundImage: `url(${getImageURL(actor.image_url)})`, backgroundSize: 'contain', backgroundPosition: 'center', backgroundRepeat: 'no-repeat', opacity:isAvailable(actor) ? 1.0 : 0.4}"
v-bind:style="{backgroundImage: `url(${getImageURL(actor.image_url)})`, backgroundSize: 'contain', backgroundPosition: 'center', backgroundRepeat: 'no-repeat', opacity:isAvailable(actor) ? 1.0 : isAvailOpactiy}"
@click="showDetails(actor)"
@mouseover="preview = true"
@mouseleave="preview = false">
Expand Down Expand Up @@ -69,6 +69,12 @@ export default {
}
},
computed: {
isAvailOpactiy () {
if (this.$store.state.optionsWeb.web.isAvailOpacity == undefined) {
return .4
}
return this.$store.state.optionsWeb.web.isAvailOpacity / 100
},
},
methods: {
getImageURL (u) {
Expand Down
20 changes: 19 additions & 1 deletion ui/src/views/options/sections/InterfaceWeb.vue
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,13 @@
show subtitles File button
</b-switch>
</b-field>
<b-field label="Opacity of unavailable scenes">
<div class="columns">
<div class="column is-two-thirds">
<b-slider :min="0" :max="100" :step="10" :tooltip="false" v-model="isAvailOpacity" opacity:isAvailOpacity></b-slider>
</div>
</div>
</b-field>

<b-field label="Automatically Check for Updates">
<b-switch v-model="updateCheck">
Expand Down Expand Up @@ -208,9 +215,20 @@ export default {
this.$store.state.optionsWeb.web.showSubtitlesFile = value
}
},
isAvailOpacity: {
get () {
if (this.$store.state.optionsWeb.web.isAvailOpacity == undefined) {
return 40
}
return this.$store.state.optionsWeb.web.isAvailOpacity
},
set (value) {
this.$store.state.optionsWeb.web.isAvailOpacity = value
}
},
isLoading: function () {
return this.$store.state.optionsWeb.loading
}
}
}
}
</script>
Expand Down
10 changes: 8 additions & 2 deletions ui/src/views/scenes/SceneCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<div class="card is-shadowless">
<div class="card-image">
<div class="bbox"
v-bind:style="{backgroundImage: `url(${getImageURL(item.cover_url)})`, backgroundSize: 'contain', backgroundPosition: 'center', backgroundRepeat: 'no-repeat', opacity:item.is_available ? 1.0 : 0.4}"
v-bind:style="{backgroundImage: `url(${getImageURL(item.cover_url)})`, backgroundSize: 'contain', backgroundPosition: 'center', backgroundRepeat: 'no-repeat', opacity:item.is_available ? 1.0 : this.isAvailOpactiy}"
@click="showDetails(item)"
@mouseover="preview = true"
@mouseleave="preview = false">
Expand Down Expand Up @@ -129,7 +129,13 @@ export default {
}
})
return count
}
},
isAvailOpactiy () {
if (this.$store.state.optionsWeb.web.isAvailOpacity == undefined) {
return .4
}
return this.$store.state.optionsWeb.web.isAvailOpacity / 100
},
},
methods: {
getImageURL (u) {
Expand Down

0 comments on commit 5bbbc63

Please sign in to comment.