Browse Source

Fixed: Update notifications when the component has not been installed yet.

Fixed: The updater requests to downgrade components when there is no stable internet connection.
Fixed: Error when deleting photos from "Uncategorized" folder.
Fixed: Possible problems on the "Photos" page when deleting the photos.
Fixed: The portable version save the application files in the AppData folder of the operating system.
Fixed: Multiple instances of DreamTime could be opened causing performance problems.
tags/v1.5.2-early
Ivan Bravo Bravo 3 weeks ago
parent
commit
1ea7224cb4

+ 10
- 1
src/components/Layout/Navbar.vue View File

@@ -7,6 +7,15 @@
class="nav__item nav__item--button">
<img src="~/assets/images/games/sans.png">
</nuxt-link>

<!--
<nuxt-link
v-tooltip="'Bad Dream Minigame 🎮'"
to="/games/baddream"
class="nav__item nav__item--button">
B
</nuxt-link>
-->
</div>

<div class="nav__center">
@@ -14,7 +23,7 @@
<font-awesome-icon icon="upload" />
</nuxt-link>

<nuxt-link v-tooltip="'Photos'" to="/photos" class="nav__item nav__item--link">
<nuxt-link v-tooltip="'My Photos'" to="/photos" class="nav__item nav__item--link">
<font-awesome-icon icon="images" />
</nuxt-link>
</div>

+ 21
- 22
src/components/UI/AppStats.vue View File

@@ -1,35 +1,35 @@
<template>
<div v-if="$dreamtrack.enabled" class="stats">
<div class="box">
<div v-tippy
data-tippy-content="Users like you who are using the application right now!"
data-tippy-placement="bottom"
class="box">
<span class="stats__value">{{ stats | stat('users.realtime') }}</span>
<span v-tippy
data-tippy-content="Users like you who are using the application right now!"
data-tippy-placement="bottom"
class="stats__label">real-time users</span>
<span class="stats__label">real-time users</span>
</div>

<div class="box">
<div v-tippy
data-tippy-content="Number of different users who have used the application."
data-tippy-placement="bottom"
class="box">
<span class="stats__value">{{ stats | stat('users.total') }}</span>
<span v-tippy
data-tippy-content="Number of different users who have used the application."
data-tippy-placement="bottom"
class="stats__label">users</span>
<span class="stats__label">users</span>
</div>

<div class="box">
<div v-tippy
data-tippy-content="Number of times the application has been opened."
data-tippy-placement="bottom"
class="box">
<span class="stats__value">{{ stats | stat('sessions.total') }}</span>
<span v-tippy
data-tippy-content="Number of times the application has been opened."
data-tippy-placement="bottom"
class="stats__label">sessions</span>
<span class="stats__label">sessions</span>
</div>

<div class="box">
<div v-tippy
data-tippy-content="Number of photos that have been nudified."
data-tippy-placement="bottom"
class="box">
<span class="stats__value">{{ stats | stat('events.total.DREAM_COMPLETED') }}</span>
<span v-tippy
data-tippy-content="Number of photos that have been nudified."
data-tippy-placement="bottom"
class="stats__label">nudifications</span>
<span class="stats__label">nudifications</span>
</div>
</div>
</template>
@@ -90,7 +90,7 @@ export default {
}

.box {
@apply mb-0 items-center p-3;
@apply mb-0 items-center px-3 py-6;
}

.stats__value {
@@ -99,6 +99,5 @@ export default {

.stats__label {
@apply text-sm;
cursor: help;
}
</style>

+ 34
- 9
src/electron/src/index.js View File

@@ -30,6 +30,12 @@ if (process.env.NODE_ENV === 'production') {
process.chdir(getPath('exe', '..'))
}

if (process.env.BUILD_PORTABLE) {
// Save Chromium/Electron data in the portable folder.
app.setPath('appData', getAppPath('AppData'))
app.setPath('userData', getAppPath('AppData', 'dreamtime'))
}

class DreamApp {
/**
* @type {BrowserWindow}
@@ -322,16 +328,35 @@ class DreamApp {
return resolve(config.rootDir, 'dist', 'index.html')
}

return `http://localhost:${config.server.port}`
return `http://${config.server.host}:${config.server.port}`
}
}

app.on('ready', async () => {
try {
await DreamApp.start()
} catch (error) {
throw new AppError(error, { title: 'DreamTime failed to start.', level: 'error' })
}
})
const gotTheLock = app.requestSingleInstanceLock()
if (!gotTheLock) {
app.quit()
} else {
app.on('second-instance', () => {
const { window } = DreamApp

DreamApp.boot()
// Someone tried to run a second instance, we should focus our window.
if (window) {
if (window.isMinimized()) {
window.restore()
}

window.focus()
}
})

app.on('ready', async () => {
try {
await DreamApp.start()
} catch (error) {
throw new AppError(error, { title: 'DreamTime failed to start.', level: 'error' })
}
})

DreamApp.boot()
}

+ 9
- 1
src/modules/config/cli-errors.json View File

@@ -45,7 +45,11 @@
},
{
"query": "Image is not 512 x 512",
"message": "Your photo needs to be 512x512 to be nudified. Please use the 'Scale method' option or resize manually before uploading."
"message": "Image error: Your photo needs to be 512x512 to be nudified. Please use the 'Scale method' option or resize manually before uploading."
},
{
"query": "_mask.sameSize(*psrc1)",
"message": "Image error: Your photo needs to be 512x512 to be nudified. Please use the 'Scale method' option or resize manually before uploading."
},
{
"query": "loading Python",
@@ -83,6 +87,10 @@
"query": "Could not find a format to read the specified file",
"message": "Image error: The photo could not be loaded correctly. Please make sure the photo is valid, has not been deleted and is not corrupt."
},
{
"query": "PIL.Image.DecompressionBombError",
"message": "Image error: The photo is too big! Please decrease the photo size with external tools or try a smaller photo."
},
{
"query": "not compiled with CUDA",
"message": "You have installed the CPU-only version of DreamPower. Please reinstall DreamPower to get GPU support."

+ 1
- 1
src/modules/consola/errors.js View File

@@ -88,7 +88,7 @@ export function handleError(error) {

if (process.env.NODE_ENV === 'production') {
if (error.message.includes('Cannot set property') || error.message.includes('Cannot read property')) {
// This is wrong, but for now these are innocent library errors.
// For now these are innocent library errors.
consola.warn(error)
return true
}

+ 5
- 2
src/modules/file.js View File

@@ -1,4 +1,6 @@
import { merge, attempt, isNil } from 'lodash'
import {
merge, attempt, isNil,
} from 'lodash'
import path from 'path'
import slash from 'slash'
import EventEmitter from 'eventemitter3'
@@ -277,7 +279,8 @@ export class File extends EventEmitter {
}

isSamePath(filepath) {
return slash(filepath) === this.path
filepath = slash(filepath)
return filepath.toLowerCase() === this.path.toLowerCase()
}

validateAsPhoto() {

+ 39
- 7
src/modules/photos.js View File

@@ -1,8 +1,11 @@
import {
find, remove, sortBy, reverse,
} from 'lodash'
import { Queue } from '@dreamnet/queue'
import { File } from './file'
import { Consola } from './consola'

const consola = Consola.create('photos')
const { fs } = $provider
const { getModelsPath } = $provider.paths

@@ -12,22 +15,54 @@ class Photos {
*/
files = []

/**
* @type {Queue}
*/
queue

get folder() {
return getModelsPath('Uncategorized')
}

async setup() {
this.queue = new Queue(this.worker.bind(this), {
delay: 10,
})

this.queue.on('finished', () => {
this.sort()
})

fs.chokidar.watch(this.folder, {
disableGlobbing: true,
awaitWriteFinish: true,
}).on('add', (path) => {
this.onAdded(path)
this.queue.add({
event: 'add',
path,
})
}).on('unlink', (path) => {
this.onRemoved(path)
this.queue.add({
event: 'unlink',
path,
})
}).on('error', (error) => {
// This silence errors when deleting files.
consola.warn(error)
})
}

async onAdded(path) {
async worker(task) {
const { event, path } = task

if (event === 'add') {
await this.add(path)
} else {
await this.unlink(path)
}
}

async add(path) {
let file = this.getFile(path)

if (file) {
@@ -36,13 +71,10 @@ class Photos {
file = await File.fromPath(path, { watch: false })
this.files.push(file)
}

this.sort()
}

onRemoved(path) {
unlink(path) {
this.removeFile(path)
this.sort()
}

sort() {

+ 28
- 0
src/modules/projects/community.js View File

@@ -23,6 +23,34 @@ class Community {
},
],
sections: [],
support: [
{
icon: [
'fab',
'patreon',
],
href: 'https://www.patreon.com/dreamnet',
label: 'Patreon',
},
{
icon: 'coffee',
href: 'https://www.buymeacoffee.com/dreamnettech',
label: 'Buy Me A Coffe',
},
{
icon: 'donate',
href: 'https://liberapay.com/dreamnet/',
label: 'LiberaPay',
},
{
icon: [
'fab',
'bitcoin',
],
href: 'https://commerce.coinbase.com/checkout/24a8bcb6-22db-4166-9bea-fb24fe78f1cd',
label: 'Crypto',
},
],
}

get name() {

+ 0
- 9
src/modules/projects/dreampower.js View File

@@ -20,15 +20,6 @@ class DreamPower {
href: 'https://power.dreamnet.tech',
label: 'Website',
},
{
icon: [
'fab',
'patreon',
],
href: 'https://www.patreon.com/dreampower',
label: 'Patreon',
description: 'Help us create a better algorithm and give better results.',
},
],
},
}

+ 2
- 8
src/modules/system/requirements.js View File

@@ -144,13 +144,7 @@ export const requirements = {
const currentVersion = `v${process.env.npm_package_version}`

const minimum = dreamtrack.get(['projects', 'dreamtime', 'releases', currentVersion, 'dreampower', 'minimum'], 'v1.2.8')
const maximum = dreamtrack.get(['projects', 'dreamtime', 'releases', currentVersion, 'dreampower', 'maximum'], 'v1.2.8')

console.log({
version,
minimum,
maximum,
})
const maximum = dreamtrack.get(['projects', 'dreamtime', 'releases', currentVersion, 'dreampower', 'maximum'])

if (compareVersions.compare(version, minimum, '<')) {
return false
@@ -182,7 +176,7 @@ export const requirements = {
const currentVersion = `v${process.env.npm_package_version}`

const minimum = dreamtrack.get(['projects', 'dreamtime', 'releases', currentVersion, 'waifu', 'minimum'], 'v0.1.0')
const maximum = dreamtrack.get(['projects', 'dreamtime', 'releases', currentVersion, 'waifu', 'maximum'], 'v0.1.0')
const maximum = dreamtrack.get(['projects', 'dreamtime', 'releases', currentVersion, 'waifu', 'maximum'])

if (compareVersions.compare(version, minimum, '<')) {
return false

+ 2
- 3
src/modules/updater/base.js View File

@@ -230,9 +230,8 @@ export class BaseUpdater {
if (required) {
dialog.showMessageBoxSync({
type: 'error',
title: 'Connect to Internet.',
message: `There was a problem getting the latest version of the components needed to use DreamTime.
Please make sure you are connected to the Internet just for this time and try again.`,
title: 'Unable to connect to Github.',
message: 'DreamTime requires a stable Internet connection during the first start. Please connect to the Internet or try again in a few minutes.',
})

// Close.

+ 5
- 1
src/modules/updater/dreampower.js View File

@@ -74,7 +74,7 @@ class DreamPowerUpdater extends BaseUpdater {
const currentVersion = `v${process.env.npm_package_version}`

const minimum = dreamtrack.get(['projects', 'dreamtime', 'releases', currentVersion, 'dreampower', 'minimum'], 'v1.2.8')
const maximum = dreamtrack.get(['projects', 'dreamtime', 'releases', currentVersion, 'dreampower', 'maximum'], 'v1.2.8')
const maximum = dreamtrack.get(['projects', 'dreamtime', 'releases', currentVersion, 'dreampower', 'maximum'])

if (!minimum) {
return null
@@ -120,6 +120,10 @@ class DreamPowerUpdater extends BaseUpdater {
*
*/
sendNotification() {
if (!requirements.power.installed) {
return
}

const notification = new Notification(
{
title: `🎉 DreamPower ${this.latestCompatibleVersion}`,

+ 5
- 1
src/modules/updater/waifu.js View File

@@ -54,7 +54,7 @@ class WaifuUpdater extends BaseUpdater {
const currentVersion = `v${process.env.npm_package_version}`

const minimum = dreamtrack.get(['projects', 'dreamtime', 'releases', currentVersion, 'waifu', 'minimum'], 'v0.1.0')
const maximum = dreamtrack.get(['projects', 'dreamtime', 'releases', currentVersion, 'waifu', 'maximum'], 'v0.1.0')
const maximum = dreamtrack.get(['projects', 'dreamtime', 'releases', currentVersion, 'waifu', 'maximum'])

if (!minimum) {
return null
@@ -100,6 +100,10 @@ class WaifuUpdater extends BaseUpdater {
*
*/
sendNotification() {
if (!requirements.waifu.installed) {
return
}

const notification = new Notification(
{
title: `🎉 Waifu2X ${this.latestCompatibleVersion}`,

+ 2
- 2
src/package.json View File

@@ -3,7 +3,7 @@
"private": true,
"displayName": "DreamTime",
"description": "Application that uses artificial intelligence to generate fake nudes.",
"version": "1.5.1",
"version": "1.5.2",
"homepage": "https://time.dreamnet.tech",
"main": "electron/dist/index.js",
"license": "GPL-3.0-only",
@@ -120,7 +120,7 @@
"babel-plugin-transform-inline-environment-variables": "^0.4.3",
"babel-watch": "^7.0.0",
"cross-env": "^7.0.2",
"electron": "9.1.0",
"electron": "9.1.1",
"electron-builder": "^22.6.1",
"env-cmd": "^10.1.0",
"eslint": "^7.0.0",

+ 1
- 1
src/package.min.json View File

@@ -3,7 +3,7 @@
"private": true,
"displayName": "DreamTime",
"description": "Application that uses artificial intelligence to generate fake nudes.",
"version": "1.5.1",
"version": "1.5.2",
"main": "electron/dist/index.js",
"license": "GPL-3.0-only"
}

+ 19
- 6
src/pages/about/supporters.vue View File

@@ -1,5 +1,16 @@
<template>
<div class="project">
<div class="project__buttons buttons">
<a v-for="(item, index) in supportButtons"
:key="index"
v-tooltip="item.label"
class="button"
:href="item.href"
target="_blank">
<span class="icon"><FontAwesomeIcon :icon="item.icon" /></span>
</a>
</div>

<div class="project__content">
<!-- Supporters -->
<div class="box">
@@ -12,12 +23,6 @@
Wonderful people that without them this would not be possible.
</h2>
</div>

<div class="right">
<a class="button" :href="supportURL" target="_blank">
Support us
</a>
</div>
</div>

<div class="box__content">
@@ -77,6 +82,10 @@ export default {
return this.$dreamtrack.get('supporters', [])
},

supportButtons() {
return this.$community.data.support || []
},

supportURL() {
return this.$dreamtrack.get('urls.support.main', 'https://www.patreon.com/dreamnet')
},
@@ -89,6 +98,10 @@ export default {
</script>

<style lang="scss" scoped>
.project__buttons {
@apply mb-6;
}

.project__content {
.title {
@apply text-white text-2xl;

+ 54
- 0
src/pages/games/baddream.vue View File

@@ -0,0 +1,54 @@
<template>
<div class="baddream">
<!-- Menu -->
<portal to="menu">
<section class="menu__items">
<menu-item
label="Hylics 2"
icon="globe"
href="https://mason-lindroth.itch.io/hylics-2" />

<menu-item
label="Buy on Steam"
:icon="['fab', 'steam']"
href="https://store.steampowered.com/app/1286710" />

<menu-item
label="Open in Browser"
icon="external-link-alt" />
</section>
</portal>

<img src="https://img.itch.zone/aW1hZ2UvNjI5NDM0LzMzNTgxNzgucG5n/original/XD%2Fi%2Fa.png">
</div>
</template>

<script>
// import { events, tutorial } from '~/modules'

export default {
layout: 'layout--fullscreen',

mounted() {
this.unlock()
// tutorial.badtime()
},

methods: {
unlock() {
// tutorial.badtime()
// events.emit('achievements.badtime')
},
},
}
</script>

<style lang="scss" scoped>
.baddream {
@apply h-full;

iframe {
@apply border-none w-full h-full;
}
}
</style>

+ 20
- 0
src/pages/games/badtime.vue View File

@@ -1,5 +1,25 @@
<template>
<div class="badtime">
<!-- Menu -->
<portal to="menu">
<section class="menu__items">
<menu-item
label="UNDERTALE"
icon="globe"
href="https://undertale.com/" />

<menu-item
label="Buy on Steam"
:icon="['fab', 'steam']"
href="https://store.steampowered.com/app/391540" />

<menu-item
label="Open in Browser"
icon="external-link-alt"
href="https://badtime.dreamnet.tech" />
</section>
</portal>

<iframe
id="badtime"
src="https://badtime.dreamnet.tech"

+ 392
- 399
src/yarn.lock
File diff suppressed because it is too large
View File


Loading…
Cancel
Save