Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[chore] blur nsfw models received from modelsaber #493

Merged
merged 4 commits into from
Jun 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions assets/jsons/bs-versions.json
Original file line number Diff line number Diff line change
Expand Up @@ -680,7 +680,7 @@
"ReleaseImg": "https://clan.akamai.steamstatic.com/images/32055887/ae11d195bbe41a0f244d7b4d055a0ab89f88e5bb.png",
"ReleaseDate": "1702309893",
"year": "2023",
"recommended": true
"recommended": true
},
{
"BSVersion": "1.34.5",
Expand All @@ -700,7 +700,7 @@
"ReleaseDate": "1708091473",
"year": "2024"
},
{
{
"BSVersion": "1.35.0",
"BSManifest": "1490986193481243578",
"OculusBinaryId": "6720809361352119",
Expand All @@ -709,7 +709,7 @@
"ReleaseDate": "1709831174",
"year": "2024"
},
{
{
"BSVersion": "1.36.0",
"BSManifest": "8533509040167838423",
"OculusBinaryId": "6863072637125790",
Expand All @@ -718,7 +718,7 @@
"ReleaseDate": "1712681263",
"year": "2024"
},
{
{
"BSVersion": "1.36.2",
"BSManifest": "4832237377879752064",
"OculusBinaryId": "6983660338400352",
Expand All @@ -727,7 +727,7 @@
"ReleaseDate": "1715008020",
"year": "2024"
},
{
{
"BSVersion": "1.37.0",
"BSManifest": "7270690075584855288",
"OculusBinaryId": "7062062833893435",
Expand All @@ -736,4 +736,4 @@
"ReleaseDate": "1717513346",
"year": "2024"
}
]
]
2 changes: 1 addition & 1 deletion src/main/services/bs-launcher/abstract-launcher.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { BSLocalVersionService } from "../bs-local-version.service";
import { ChildProcessWithoutNullStreams, SpawnOptionsWithoutStdio, spawn } from "child_process";
import path from "path";
import log from "electron-log";
import { sToMs } from "shared/helpers/time.helpers";
import { sToMs } from "../../../shared/helpers/time.helpers";

export abstract class AbstractLauncherService {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,20 @@ function ModelItemElement<T = unknown>(props: Props<T>) {
const [idContentCopied, setIdContentCopied] = useState<string>(null);
const ref = useRef();

const isNsfw = (() => {
const tags = props.tags?.map(tag => tag.toLowerCase()) ?? [];
const name = props.name.toLowerCase() ?? "";
return (
tags.includes("nsfw") ||
tags.includes("18+") ||
name.includes("nsfw") ||
name.includes("18+") ||
name.includes("nude") ||
name.includes("naked") ||
name.includes("lewd")
);
})();

useDoubleClick({
ref,
latency: props.onDoubleClick ? 200 : 0,
Expand Down Expand Up @@ -117,7 +131,7 @@ function ModelItemElement<T = unknown>(props: Props<T>) {
<div className="absolute top-0 left-0 w-full h-full rounded-lg overflow-hidden blur-none bg-black shadow-sm shadow-black">
<div ref={ref} className="contents">
<BsmImage className="absolute top-0 left-0 w-full h-full object-cover brightness-50 scale-[200%] blur-md" image={thumbnailUrl} placeholder={defaultImage} loading="lazy" />
<BsmImage className="absolute top-0 left-1/2 -translate-x-1/2 max-w-[20rem] w-full h-full object-cover" image={thumbnailUrl} placeholder={defaultImage} loading="lazy" />
<BsmImage className="absolute top-0 left-1/2 -translate-x-1/2 max-w-[20rem] w-full h-full object-cover" image={thumbnailUrl} placeholder={defaultImage} loading="lazy" style={isNsfw && {filter: "blur(10px)"}} />
<div className="absolute top-0 right-0 h-full w-0 flex flex-col items-end gap-1 pt-1.5 pr-1.5">
{!props.isDownloading ? (
actionButtons().map((button, index) => (
Expand Down
Loading