Skip to content

Commit f32d85f

Browse files
authored
Merge pull request #284 from SchneeHertz/development
Development
2 parents 841c685 + b3dace9 commit f32d85f

File tree

4 files changed

+31
-6
lines changed

4 files changed

+31
-6
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file. Dates are d
44

55
Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
66

7+
#### [v1.6.10](https://github.com/SchneeHertz/exhentai-manga-manager/compare/v1.6.9...v1.6.10)
8+
9+
> 28 June 2025
10+
11+
- fix tray icon miss [`#261`](https://github.com/SchneeHertz/exhentai-manga-manager/pull/261)
12+
713
#### [v1.6.9](https://github.com/SchneeHertz/exhentai-manga-manager/compare/v1.6.8...v1.6.9)
814

915
> 28 June 2025

index.js

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ const fetch = require('node-fetch')
1414
const { HttpsProxyAgent } = require('https-proxy-agent')
1515
const windowStateKeeper = require('electron-window-state')
1616
const express = require('express')
17+
const { globSync } = require('glob')
1718

1819
const { prepareMangaModel, prepareMetadataModel } = require('./modules/database')
1920
const { prepareTemplate } = require('./modules/prepare_menu.js')
@@ -674,16 +675,34 @@ ipcMain.handle('open-local-book', async (event, filepath) => {
674675

675676
ipcMain.handle('delete-local-book', async (event, filepath) => {
676677
if (filepath.startsWith(setting.library)) {
677-
await Manga.destroy({ where: { filepath: filepath } })
678678
try {
679-
try {
679+
const stats = await fs.promises.stat(filepath)
680+
if (stats.isDirectory()) {
681+
const imageFiles = globSync('*.@(jpg|jpeg|png|webp|avif|gif)', {
682+
cwd: filepath,
683+
nocase: true,
684+
absolute: true
685+
})
686+
687+
for (const imageFile of imageFiles) {
688+
try {
689+
await shell.trashItem(imageFile)
690+
} catch {
691+
await fs.promises.rm(imageFile, { force: true })
692+
}
693+
}
694+
695+
const remainingFiles = await fs.promises.readdir(filepath)
696+
if (remainingFiles.length === 0) {
697+
await shell.trashItem(filepath)
698+
}
699+
} else {
680700
await shell.trashItem(filepath)
681-
} catch {
682-
await fs.promises.rm(filepath, { recursive: true, force: true })
683701
}
684702
} catch (e) {
685703
sendMessageToWebContents(`Delete ${filepath} failed because ${e}`)
686704
}
705+
await Manga.destroy({ where: { filepath: filepath } })
687706
}
688707
})
689708

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "exhentai-manga-manager",
33
"private": true,
4-
"version": "1.6.10",
4+
"version": "1.6.11",
55
"author": "SchneeHertz",
66
"description": "Tag-based management, reading manga downloaded from ExHentai",
77
"repository": {

src/components/Setting.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<template>
22
<el-dialog v-model="dialogVisibleSetting"
3-
width="54em"
3+
width="55em"
44
:modal="false"
55
append-to-body
66
top="60px"

0 commit comments

Comments
 (0)