Skip to content

Commit b801e29

Browse files
authored
Merge pull request #259 from SchneeHertz/development
Development
2 parents f074829 + 59c017b commit b801e29

File tree

15 files changed

+179
-18
lines changed

15 files changed

+179
-18
lines changed

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,15 @@ 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.8](https://github.com/SchneeHertz/exhentai-manga-manager/compare/v1.6.7...v1.6.8)
8+
9+
> 31 May 2025
10+
11+
- Development [`#251`](https://github.com/SchneeHertz/exhentai-manga-manager/pull/251)
12+
- uniq collection for recent read [`d5c136e`](https://github.com/SchneeHertz/exhentai-manga-manager/commit/d5c136e1c22dd1e3724e34bd7dcbca9ed91c3931)
13+
- update package.json [`7c83c07`](https://github.com/SchneeHertz/exhentai-manga-manager/commit/7c83c07e27484d3fe0134ef125612016ebcf2baa)
14+
- remove buymeacoffee [`945ef6d`](https://github.com/SchneeHertz/exhentai-manga-manager/commit/945ef6d9404a81584f793bf4ef6a6495940d709c)
15+
716
#### [v1.6.7](https://github.com/SchneeHertz/exhentai-manga-manager/compare/v1.6.6...v1.6.7)
817

918
> 29 March 2025

README.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,6 @@
7272
- [从ExHentai画廊页面复制元数据](https://sleazyfork.org/zh-CN/scripts/472321)
7373
- [EH高亮本地本子](https://greasyfork.org/zh-CN/scripts/510077)
7474

75-
## TODO
76-
- 根据规则重命名和移动漫画文件
77-
7875
## 贡献
7976
- 请参考[贡献指南](https://github.com/SchneeHertz/exhentai-manga-manager/blob/master/CONTRIBUTING.md)
8077

README_EN.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,6 @@
7171
- [Copy Metadata from ExHentai Gallery Page](https://sleazyfork.org/zh-CN/scripts/472321)
7272
- [Highlight Gallery in Libary](https://greasyfork.org/zh-CN/scripts/510077)
7373

74-
## TODO
75-
- Rename and move manga files according to rules
76-
7774
## Thanks
7875
This project has been helped by many open source projects
7976

README_JA.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,6 @@
7070
- タグ頻度分析
7171
- ローカルエリアネットワークブラウジング
7272

73-
## TODO
74-
- ルールに従ってマンガファイル名変更と移動を行う
75-
7673
## 感謝
7774
このプロジェクトは、多くのオープンソースプロジェクトに助けられています
7875

index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!DOCTYPE html>
2-
<html lang="en" class="dark">
2+
<html lang="en" class="light e-hentai">
33
<head>
44
<meta charset="UTF-8" />
55
<link rel="icon" href="/favicon.ico" />

index.js

Lines changed: 78 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const { app, BrowserWindow, ipcMain, session, dialog, shell, screen, Menu, clipboard, nativeImage } = require('electron')
1+
const { app, BrowserWindow, ipcMain, session, dialog, shell, screen, Menu, clipboard, nativeImage, Tray } = require('electron')
22
const path = require('path')
33
const fs = require('fs')
44
const { brotliDecompress } = require('zlib')
@@ -77,8 +77,55 @@ const sendMessageToWebContents = (message) => {
7777
}
7878

7979
let mainWindow
80+
let tray
8081
let screenWidth
8182
let sendImageLock = false
83+
84+
const createTray = () => {
85+
if (tray) return
86+
const iconPath = path.join(__dirname, 'public/icon.png')
87+
tray = new Tray(iconPath)
88+
tray.setToolTip('exhentai-manga-manager')
89+
tray.on('click', () => {
90+
if (mainWindow) {
91+
if (mainWindow.isVisible() && !mainWindow.isMinimized()) {
92+
mainWindow.minimize()
93+
} else if (mainWindow.isMinimized()) {
94+
mainWindow.restore()
95+
mainWindow.setSkipTaskbar(false)
96+
mainWindow.focus()
97+
} else {
98+
mainWindow.show()
99+
mainWindow.setSkipTaskbar(false)
100+
mainWindow.focus()
101+
}
102+
}
103+
})
104+
const contextMenu = Menu.buildFromTemplate([
105+
{
106+
label: 'show window',
107+
click: () => {
108+
if (mainWindow) {
109+
if (mainWindow.isMinimized()) {
110+
mainWindow.restore()
111+
} else {
112+
mainWindow.show()
113+
}
114+
mainWindow.setSkipTaskbar(false)
115+
mainWindow.focus()
116+
}
117+
}
118+
},
119+
{
120+
label: 'exit',
121+
click: () => {
122+
mainWindow.close()
123+
}
124+
}
125+
])
126+
tray.setContextMenu(contextMenu)
127+
}
128+
82129
const createWindow = () => {
83130
const mainWindowState = windowStateKeeper({
84131
defaultWidth: 1560,
@@ -95,7 +142,6 @@ const createWindow = () => {
95142
},
96143
show: false
97144
})
98-
mainWindowState.manage(win)
99145
if (app.isPackaged) {
100146
win.loadFile('dist/index.html')
101147
} else {
@@ -111,7 +157,33 @@ const createWindow = () => {
111157
win.setTitle(name + ' ' + version)
112158
})
113159
win.once('ready-to-show', () => {
160+
if (setting.minimizeOnStart) {
161+
if (setting.minimizeToTray) {
162+
createTray()
163+
win.hide()
164+
win.setSkipTaskbar(true)
165+
} else {
166+
win.minimize()
167+
}
168+
} else {
169+
win.show()
170+
}
171+
})
172+
win.on('minimize', (event) => {
173+
if (setting.minimizeToTray) {
174+
event.preventDefault()
175+
createTray()
176+
win.hide()
177+
win.setSkipTaskbar(true)
178+
}
179+
})
180+
win.on('restore', () => {
114181
win.show()
182+
win.setSkipTaskbar(false)
183+
})
184+
win.on('show', () => {
185+
win.setSkipTaskbar(false)
186+
mainWindowState.manage(win)
115187
})
116188
return win
117189
}
@@ -768,6 +840,10 @@ ipcMain.handle('save-setting', async (event, receiveSetting) => {
768840
})
769841
}
770842
setting = receiveSetting
843+
if (tray && !setting.minimizeToTray) {
844+
tray.destroy()
845+
tray = null
846+
}
771847
return await fs.promises.writeFile(path.join(STORE_PATH, 'setting.json'), JSON.stringify(setting, null, ' '), { encoding: 'utf-8' })
772848
})
773849

modules/init_folder_setting.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ const prepareSetting = () => {
5555
requireGap: 3000,
5656
thumbnailColumn: 10,
5757
showTranslation: false,
58-
theme: 'dark',
58+
theme: 'light e-hentai',
5959
widthLimit: undefined,
6060
directEnter: 'detail',
6161
language: 'default',

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.8",
4+
"version": "1.6.9",
55
"author": "SchneeHertz",
66
"description": "Tag-based management, reading manga downloaded from ExHentai",
77
"repository": {

src/App.vue

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,22 @@
190190
</div>
191191
</div>
192192
</el-drawer>
193+
<el-dialog v-model="moveFileDialogVisible" :title="$t('m.moveFile')" width="400px">
194+
<el-cascader
195+
v-model="moveFileTargetFolder"
196+
:options="folderTreeData"
197+
:props="{ checkStrictly: true }"
198+
filterable
199+
clearable
200+
style="width: 100%"
201+
:filter-method="filterFolderMethod"
202+
popper-class="book-tag-edit-cascader-popper"
203+
/>
204+
<template #footer>
205+
<el-button @click="moveFileDialogVisible = false">{{$t('c.cancel')}}</el-button>
206+
<el-button type="primary" @click="confirmMoveFile">{{$t('m.move')}}</el-button>
207+
</template>
208+
</el-dialog>
193209
<BookDetailDialog
194210
ref="BookDetailDialogRef"
195211
@open-content-view="openContentView"
@@ -272,6 +288,10 @@ export default defineComponent({
272288
// collection
273289
drawerVisibleCollection: false,
274290
openCollectionTitle: undefined,
291+
// move file
292+
moveFileDialogVisible: false,
293+
moveFileTargetBook: null,
294+
moveFileTargetFolder: null,
275295
}
276296
},
277297
computed: {
@@ -290,6 +310,7 @@ export default defineComponent({
290310
'sortValue',
291311
'editCollectionView',
292312
'editTagView',
313+
'folderTreeData',
293314
'localeFile',
294315
'displayBookCount',
295316
'tagList',
@@ -390,6 +411,7 @@ export default defineComponent({
390411
'saveBook',
391412
'copyTagClipboard',
392413
'pasteTagClipboard',
414+
'filterFolderMethod',
393415
]),
394416
395417
// base function
@@ -1059,6 +1081,12 @@ export default defineComponent({
10591081
this.$refs.BookDetailDialogRef.showFile(book.filepath)
10601082
}
10611083
},
1084+
{
1085+
label: this.$t('m.moveFile'),
1086+
onClick: () => {
1087+
this.handleMoveFile(book)
1088+
}
1089+
},
10621090
{
10631091
label: this.$t('m.deleteFile'),
10641092
onClick: () => {
@@ -1093,6 +1121,30 @@ export default defineComponent({
10931121
})
10941122
},
10951123
1124+
handleMoveFile (book) {
1125+
this.moveFileTargetBook = book
1126+
this.moveFileTargetFolder = null
1127+
this.moveFileDialogVisible = true
1128+
},
1129+
async confirmMoveFile () {
1130+
if (!this.moveFileTargetBook || !this.moveFileTargetFolder) {
1131+
this.printMessage('error', this.$t('c.moveError'))
1132+
return
1133+
}
1134+
try {
1135+
const newFilePath = await ipcRenderer.invoke('move-local-book', this.moveFileTargetBook.filepath, _.cloneDeep(this.moveFileTargetFolder))
1136+
if (newFilePath) {
1137+
this.moveFileTargetBook.filepath = newFilePath
1138+
await this.saveBook(this.moveFileTargetBook)
1139+
}
1140+
} catch (e) {
1141+
console.error(e)
1142+
}
1143+
this.moveFileDialogVisible = false
1144+
this.moveFileTargetBook = null
1145+
this.moveFileTargetFolder = null
1146+
},
1147+
10961148
// collection view function
10971149
async loadCollectionList () {
10981150
this.collectionList = await ipcRenderer.invoke('load-collection-list')
@@ -1277,6 +1329,10 @@ body
12771329
.el-autocomplete-suggestion__wrap, .el-select-dropdown__wrap
12781330
max-height: 490px!important
12791331
1332+
.book-tag-edit-cascader-popper
1333+
.el-cascader-menu__wrap.el-scrollbar__wrap
1334+
height: 340px
1335+
12801336
.pagination-bar
12811337
margin: 4px 0
12821338
justify-content: center

src/components/EditView.vue

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,8 @@
126126
}"
127127
filterable
128128
clearable
129+
:filter-method="filterFolderMethod"
130+
popper-class="book-tag-edit-cascader-popper"
129131
/>
130132
<el-space wrap class="book-tag-edit-buttons">
131133
<el-button type="primary" plain @click="applyMoveFile">{{$t('m.move')}}</el-button>
@@ -171,7 +173,7 @@ const {
171173
visibleChunkDisplayBookListForCollectView,
172174
visibleChunkDisplayBookListForEditTagView,
173175
} = storeToRefs(appStore)
174-
const { getDisplayTitle, saveBook, printMessage } = appStore
176+
const { getDisplayTitle, saveBook, printMessage, filterFolderMethod } = appStore
175177
176178
const { t } = useI18n()
177179
@@ -697,6 +699,8 @@ defineExpose({
697699
.book-tag-edit-operation
698700
.el-select-v2
699701
width: 100%
702+
.el-cascader
703+
width: 100%
700704
.book-tag-edit-buttons
701705
width: 100%
702706
margin-top: 10px

0 commit comments

Comments
 (0)