From 62dd45b374cb2383152e98c6d3d68b637bbbf15b Mon Sep 17 00:00:00 2001 From: SchneeHertz <39257008+SchneeHertz@users.noreply.github.com> Date: Tue, 30 Jul 2024 22:03:33 +0800 Subject: [PATCH 01/32] Update CHANGELOG.md --- CHANGELOG.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8520671..8be6d7d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,16 @@ All notable changes to this project will be documented in this file. Dates are d Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). +#### [v1.6.0](https://github.com/SchneeHertz/exhentai-manga-manager/compare/v1.5.17...v1.6.0) + +> 26 July 2024 + +- Development [`#154`](https://github.com/SchneeHertz/exhentai-manga-manager/pull/154) +- Development [`#153`](https://github.com/SchneeHertz/exhentai-manga-manager/pull/153) +- add opds server [`6133e1b`](https://github.com/SchneeHertz/exhentai-manga-manager/commit/6133e1b2ae2de44cca29712d9401ddbb52131a55) +- remove g6 [`399b6d7`](https://github.com/SchneeHertz/exhentai-manga-manager/commit/399b6d7d2b6df467e48ab1f029e07c9ef927a52d) +- update manga server [`d52daf7`](https://github.com/SchneeHertz/exhentai-manga-manager/commit/d52daf7b0918317094200faa749441bd1256d1b8) + #### [v1.5.17](https://github.com/SchneeHertz/exhentai-manga-manager/compare/v1.5.16...v1.5.17) > 29 June 2024 From 3acc03de2431078d3f676ba4537c4fa2a7e088b5 Mon Sep 17 00:00:00 2001 From: SchneeHertz <39257008+SchneeHertz@users.noreply.github.com> Date: Wed, 31 Jul 2024 01:16:59 +0800 Subject: [PATCH 02/32] default insert empty page when doubleview --- src/components/InternalViewer.vue | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/components/InternalViewer.vue b/src/components/InternalViewer.vue index da63ffe..e341bed 100644 --- a/src/components/InternalViewer.vue +++ b/src/components/InternalViewer.vue @@ -185,8 +185,8 @@ const imageStyleType = ref('scroll') const imageStyleFit = ref('window') const viewerReadingProgress = ref([]) const currentImageId = ref('') -const insertEmptyPage = ref(false) -const insertEmptyPageIndex = ref(1) +const insertEmptyPage = ref(true) +const insertEmptyPageIndex = ref(0) const viewerImageList = ref([]) const viewerImageListDouble = computed(() => { if (imageStyleType.value === 'double') { @@ -245,8 +245,8 @@ const viewManga = (book, viewerHeight = '100%') => { viewerImageList.value = [] receiveThumbnailList.value = [] currentImageIndex.value = 0 - insertEmptyPage.value = false - insertEmptyPageIndex.value = 1 + insertEmptyPage.value = true + insertEmptyPageIndex.value = 0 emit('selectBook', book) const loading = ElLoading.service({ lock: true, From bd8306e30bc11665fed6772e3872bf620b565fb1 Mon Sep 17 00:00:00 2001 From: SchneeHertz <39257008+SchneeHertz@users.noreply.github.com> Date: Thu, 8 Aug 2024 16:53:54 +0800 Subject: [PATCH 03/32] add bookcard lazy render --- src/App.vue | 80 ++++++++++++++++++++++++++++++----------------------- src/main.js | 15 ++++++++++ 2 files changed, 60 insertions(+), 35 deletions(-) diff --git a/src/App.vue b/src/App.vue index 70ef422..05d56e6 100644 --- a/src/App.vue +++ b/src/App.vue @@ -111,48 +111,54 @@ class="book-card" v-if="!book.isCollection && !book.collectionHide && (sortValue === 'hidden' || !book.hiddenBook) && !book.folderHide" :tabindex="index + 1" + v-lazy:[index]="loadBookCardContent" > -

{{getDisplayTitle(book)}}

- - ZH - {{book.pageCount}}|{{book.filecount}}P - {{ book.pageCount }}P - - - {{$t('m.re')}} - {{$t('m.ad')}} - - {{book.status}} - +
- {{$t('m.collection')}} -

{{book.title}}

- - - +
@@ -607,6 +613,7 @@ export default defineComponent({ expandNodes: [], progress: 0, randomTags: [], + visibilityMap: {}, // collection selectCollection: undefined, selectCollectionObject: {list:[]}, @@ -1658,6 +1665,9 @@ export default defineComponent({ scrollMainPageTop () { document.getElementsByClassName('book-card-area')[0].scrollTop = 0 }, + loadBookCardContent (index) { + this.visibilityMap[index] = true + }, // folder tree diff --git a/src/main.js b/src/main.js index 073eb64..f1bdaf3 100644 --- a/src/main.js +++ b/src/main.js @@ -30,4 +30,19 @@ app.use(createI18n({ legacy: false, messages })) + +app.directive('lazy', { + mounted(el, binding) { + const observer = new IntersectionObserver((entries, observer) => { + entries.forEach(entry => { + if (entry.isIntersecting) { + binding.value(binding.arg) + observer.unobserve(el) + } + }) + }) + observer.observe(el) + } +}) + app.mount('#app') \ No newline at end of file From 04adb5fb2c514ac405b2f0ee151985f2c53a63d3 Mon Sep 17 00:00:00 2001 From: SchneeHertz <39257008+SchneeHertz@users.noreply.github.com> Date: Thu, 8 Aug 2024 18:52:47 +0800 Subject: [PATCH 04/32] Revert "add bookcard lazy render" This reverts commit bd8306e30bc11665fed6772e3872bf620b565fb1. --- src/App.vue | 80 +++++++++++++++++++++++------------------------------ src/main.js | 15 ---------- 2 files changed, 35 insertions(+), 60 deletions(-) diff --git a/src/App.vue b/src/App.vue index 05d56e6..70ef422 100644 --- a/src/App.vue +++ b/src/App.vue @@ -111,54 +111,48 @@ class="book-card" v-if="!book.isCollection && !book.collectionHide && (sortValue === 'hidden' || !book.hiddenBook) && !book.folderHide" :tabindex="index + 1" - v-lazy:[index]="loadBookCardContent" > - +

{{getDisplayTitle(book)}}

+ + ZH + {{book.pageCount}}|{{book.filecount}}P + {{ book.pageCount }}P + + + {{$t('m.re')}} + {{$t('m.ad')}} + + {{book.status}} +
- + {{$t('m.collection')}} +

{{book.title}}

+ + +
@@ -613,7 +607,6 @@ export default defineComponent({ expandNodes: [], progress: 0, randomTags: [], - visibilityMap: {}, // collection selectCollection: undefined, selectCollectionObject: {list:[]}, @@ -1665,9 +1658,6 @@ export default defineComponent({ scrollMainPageTop () { document.getElementsByClassName('book-card-area')[0].scrollTop = 0 }, - loadBookCardContent (index) { - this.visibilityMap[index] = true - }, // folder tree diff --git a/src/main.js b/src/main.js index f1bdaf3..073eb64 100644 --- a/src/main.js +++ b/src/main.js @@ -30,19 +30,4 @@ app.use(createI18n({ legacy: false, messages })) - -app.directive('lazy', { - mounted(el, binding) { - const observer = new IntersectionObserver((entries, observer) => { - entries.forEach(entry => { - if (entry.isIntersecting) { - binding.value(binding.arg) - observer.unobserve(el) - } - }) - }) - observer.observe(el) - } -}) - app.mount('#app') \ No newline at end of file From e3bb021df78467a27a4f5d456cb993d5593b6ad3 Mon Sep 17 00:00:00 2001 From: SchneeHertz <39257008+SchneeHertz@users.noreply.github.com> Date: Thu, 8 Aug 2024 18:59:52 +0800 Subject: [PATCH 05/32] Reapply "add bookcard lazy render" This reverts commit 04adb5fb2c514ac405b2f0ee151985f2c53a63d3. --- src/App.vue | 80 ++++++++++++++++++++++++++++++----------------------- src/main.js | 15 ++++++++++ 2 files changed, 60 insertions(+), 35 deletions(-) diff --git a/src/App.vue b/src/App.vue index 70ef422..05d56e6 100644 --- a/src/App.vue +++ b/src/App.vue @@ -111,48 +111,54 @@ class="book-card" v-if="!book.isCollection && !book.collectionHide && (sortValue === 'hidden' || !book.hiddenBook) && !book.folderHide" :tabindex="index + 1" + v-lazy:[index]="loadBookCardContent" > -

{{getDisplayTitle(book)}}

- - ZH - {{book.pageCount}}|{{book.filecount}}P - {{ book.pageCount }}P - - - {{$t('m.re')}} - {{$t('m.ad')}} - - {{book.status}} - +
- {{$t('m.collection')}} -

{{book.title}}

- - - +
@@ -607,6 +613,7 @@ export default defineComponent({ expandNodes: [], progress: 0, randomTags: [], + visibilityMap: {}, // collection selectCollection: undefined, selectCollectionObject: {list:[]}, @@ -1658,6 +1665,9 @@ export default defineComponent({ scrollMainPageTop () { document.getElementsByClassName('book-card-area')[0].scrollTop = 0 }, + loadBookCardContent (index) { + this.visibilityMap[index] = true + }, // folder tree diff --git a/src/main.js b/src/main.js index 073eb64..f1bdaf3 100644 --- a/src/main.js +++ b/src/main.js @@ -30,4 +30,19 @@ app.use(createI18n({ legacy: false, messages })) + +app.directive('lazy', { + mounted(el, binding) { + const observer = new IntersectionObserver((entries, observer) => { + entries.forEach(entry => { + if (entry.isIntersecting) { + binding.value(binding.arg) + observer.unobserve(el) + } + }) + }) + observer.observe(el) + } +}) + app.mount('#app') \ No newline at end of file From 619ab00c9cea46b3b06784363dd61847c0f4ebaa Mon Sep 17 00:00:00 2001 From: SchneeHertz <39257008+SchneeHertz@users.noreply.github.com> Date: Thu, 8 Aug 2024 19:25:03 +0800 Subject: [PATCH 06/32] Revert "Reapply "add bookcard lazy render"" This reverts commit e3bb021df78467a27a4f5d456cb993d5593b6ad3. --- src/App.vue | 80 +++++++++++++++++++++++------------------------------ src/main.js | 15 ---------- 2 files changed, 35 insertions(+), 60 deletions(-) diff --git a/src/App.vue b/src/App.vue index 05d56e6..70ef422 100644 --- a/src/App.vue +++ b/src/App.vue @@ -111,54 +111,48 @@ class="book-card" v-if="!book.isCollection && !book.collectionHide && (sortValue === 'hidden' || !book.hiddenBook) && !book.folderHide" :tabindex="index + 1" - v-lazy:[index]="loadBookCardContent" > - +

{{getDisplayTitle(book)}}

+ + ZH + {{book.pageCount}}|{{book.filecount}}P + {{ book.pageCount }}P + + + {{$t('m.re')}} + {{$t('m.ad')}} + + {{book.status}} +
- + {{$t('m.collection')}} +

{{book.title}}

+ + +
@@ -613,7 +607,6 @@ export default defineComponent({ expandNodes: [], progress: 0, randomTags: [], - visibilityMap: {}, // collection selectCollection: undefined, selectCollectionObject: {list:[]}, @@ -1665,9 +1658,6 @@ export default defineComponent({ scrollMainPageTop () { document.getElementsByClassName('book-card-area')[0].scrollTop = 0 }, - loadBookCardContent (index) { - this.visibilityMap[index] = true - }, // folder tree diff --git a/src/main.js b/src/main.js index f1bdaf3..073eb64 100644 --- a/src/main.js +++ b/src/main.js @@ -30,19 +30,4 @@ app.use(createI18n({ legacy: false, messages })) - -app.directive('lazy', { - mounted(el, binding) { - const observer = new IntersectionObserver((entries, observer) => { - entries.forEach(entry => { - if (entry.isIntersecting) { - binding.value(binding.arg) - observer.unobserve(el) - } - }) - }) - observer.observe(el) - } -}) - app.mount('#app') \ No newline at end of file From 0a67130e1f806fd49395cc4bf233fe74d2fd72e1 Mon Sep 17 00:00:00 2001 From: SchneeHertz <39257008+SchneeHertz@users.noreply.github.com> Date: Thu, 8 Aug 2024 16:53:54 +0800 Subject: [PATCH 07/32] add bookcard lazy render Revert "add bookcard lazy render" This reverts commit bd8306e30bc11665fed6772e3872bf620b565fb1. Reapply "add bookcard lazy render" This reverts commit 04adb5fb2c514ac405b2f0ee151985f2c53a63d3. Revert "Reapply "add bookcard lazy render"" This reverts commit e3bb021df78467a27a4f5d456cb993d5593b6ad3. update bookcard lazy render --- src/App.vue | 80 ++++++++++++++++++++++++++++++----------------------- src/main.js | 35 +++++++++++++++++++++++ 2 files changed, 80 insertions(+), 35 deletions(-) diff --git a/src/App.vue b/src/App.vue index 70ef422..1d0a738 100644 --- a/src/App.vue +++ b/src/App.vue @@ -111,48 +111,54 @@ class="book-card" v-if="!book.isCollection && !book.collectionHide && (sortValue === 'hidden' || !book.hiddenBook) && !book.folderHide" :tabindex="index + 1" + v-lazy:[book.id]="loadBookCardContent" > -

{{getDisplayTitle(book)}}

- - ZH - {{book.pageCount}}|{{book.filecount}}P - {{ book.pageCount }}P - - - {{$t('m.re')}} - {{$t('m.ad')}} - - {{book.status}} - +
- {{$t('m.collection')}} -

{{book.title}}

- - - +
@@ -607,6 +613,7 @@ export default defineComponent({ expandNodes: [], progress: 0, randomTags: [], + visibilityMap: {}, // collection selectCollection: undefined, selectCollectionObject: {list:[]}, @@ -1658,6 +1665,9 @@ export default defineComponent({ scrollMainPageTop () { document.getElementsByClassName('book-card-area')[0].scrollTop = 0 }, + loadBookCardContent (id) { + this.visibilityMap[id] = true + }, // folder tree diff --git a/src/main.js b/src/main.js index 073eb64..d506974 100644 --- a/src/main.js +++ b/src/main.js @@ -30,4 +30,39 @@ app.use(createI18n({ legacy: false, messages })) + +// 创建一个共享的 IntersectionObserver 实例 +const observer = new IntersectionObserver((entries) => { + entries.forEach(entry => { + if (entry.isIntersecting) { + const el = entry.target + const callback = el._lazyCallback + const arg = el._lazyArg + + if (callback && typeof callback === 'function') { + callback(arg) + } + observer.unobserve(el) + } + }) +}) + +app.directive('lazy', { + mounted(el, binding) { + // 将回调和参数存储在元素上,以便在观察者中访问 + el._lazyCallback = binding.value + el._lazyArg = binding.arg + + // 添加元素到 IntersectionObserver 中 + observer.observe(el) + }, + unmounted(el) { + // 取消观察元素并清理 + observer.unobserve(el) + delete el._lazyCallback + delete el._lazyArg + } +}) + + app.mount('#app') \ No newline at end of file From 4b5b490aee10e751d3c521abb6105c52ba924747 Mon Sep 17 00:00:00 2001 From: SchneeHertz <39257008+SchneeHertz@users.noreply.github.com> Date: Fri, 9 Aug 2024 09:46:41 +0800 Subject: [PATCH 08/32] minor edit --- src/App.vue | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/App.vue b/src/App.vue index 1d0a738..e9e2add 100644 --- a/src/App.vue +++ b/src/App.vue @@ -1647,6 +1647,9 @@ export default defineComponent({ isChineseTranslatedManga (book) { return _.includes(book?.tags?.language, 'chinese') ? true : false }, + loadBookCardContent (id) { + this.visibilityMap[id] = true + }, // home page chunkList () { this.currentPage = 1 @@ -1665,9 +1668,6 @@ export default defineComponent({ scrollMainPageTop () { document.getElementsByClassName('book-card-area')[0].scrollTop = 0 }, - loadBookCardContent (id) { - this.visibilityMap[id] = true - }, // folder tree From e092c8a0e57ec99d60c29d5fdd9925075e27bf38 Mon Sep 17 00:00:00 2001 From: SchneeHertz <39257008+SchneeHertz@users.noreply.github.com> Date: Fri, 9 Aug 2024 14:04:32 +0800 Subject: [PATCH 09/32] add collectTag --- src/App.vue | 86 +++++++++++++++++++++++-------- src/components/Setting.vue | 102 ++++++++++++++++++++++++++++++++++++- src/locales/en-US.json | 5 +- src/locales/zh-CN.json | 5 +- src/locales/zh-TW.json | 5 +- 5 files changed, 177 insertions(+), 26 deletions(-) diff --git a/src/App.vue b/src/App.vue index e9e2add..46e7242 100644 --- a/src/App.vue +++ b/src/App.vue @@ -133,17 +133,27 @@ :color="book.mark ? '#E6A23C' : '#666666'" class="book-card-mark" @click="switchMark(book)" > - - {{$t('m.re')}} - {{$t('m.ad')}} - - {{book.status}} - +
+ {{tag.letter}}:{{resolvedTranslation[tag.tag]?.name || tag.tag}} +
+
+ + {{$t('m.re')}} + {{$t('m.ad')}} + + {{book.status}} + +
{ return _.map(b.tags, (tags, cat) => { return _.map(tags, tag => `${cat}##${tag}`) @@ -742,18 +754,33 @@ export default defineComponent({ return uniqedTagArray.map(combinedTag => { let tagArray = _.split(combinedTag, '##') let letter = this.cat2letter[tagArray[0]] ? this.cat2letter[tagArray[0]] : tagArray[0] - let labelHeader = tagArray[0] - let labelTail = tagArray[1] - if (this.setting.showTranslation) { - labelHeader = tagArray[0] === 'group' ? '团队' : this.resolvedTranslation[tagArray[0]]?.name || tagArray[0] - labelTail = this.resolvedTranslation[tagArray[1]]?.name || tagArray[1] - } return { - label: `${labelHeader}:${labelTail} || ${letter}:"${tagArray[1]}"$`, - value: `${letter}:"${tagArray[1]}"$` + id: `${tagArray[0]}:${tagArray[1]}`, + letter, + cat: tagArray[0], + tag: tagArray[1], } }) }, + tagListForSelect () { + if (this.setting.showTranslation) { + return this.tagListRaw.map(({letter, cat, tag}) => { + let labelHeader = cat === 'group' ? '团队' : this.resolvedTranslation[cat]?.name || cat + let labelTail = this.resolvedTranslation[tag]?.name || tag + return { + label: `${labelHeader}:${labelTail} || ${letter}:"${tag}"$`, + value: `${letter}:"${tag}"$` + } + }) + } else { + return this.tagListRaw.map(({letter, cat, tag}) => { + return { + label: `${cat}:${tag} || ${letter}:"${tag}"$`, + value: `${letter}:"${tag}"$` + } + }) + } + }, tag2cat () { let temp = {} let tagArray = _(this.bookList.map(b=>{ @@ -1650,6 +1677,14 @@ export default defineComponent({ loadBookCardContent (id) { this.visibilityMap[id] = true }, + filterCollectTag (tagObject) { + if (this.setting.showCollectTag) { + const collectTag = this.setting.collectTag || [] + return collectTag.filter(tag => tagObject[tag.cat] && tagObject[tag.cat].includes(tag.tag)) + } else { + return [] + } + }, // home page chunkList () { this.currentPage = 1 @@ -2573,11 +2608,20 @@ body .book-card display: inline-block width: 220px - height: 367px + min-height: 367px + padding-bottom: 4px border: solid 1px var(--el-border-color) border-radius: 4px margin: 6px 6px position: relative + .collect-tag + overflow-x: hidden + margin: 0 10px + text-align: left + .book-collect-tag + cursor: pointer + margin-right: 4px + margin-bottom: 4px .book-collection-tag position: absolute right: 1px diff --git a/src/components/Setting.vue b/src/components/Setting.vue index 7f02c48..3839fbe 100644 --- a/src/components/Setting.vue +++ b/src/components/Setting.vue @@ -134,6 +134,40 @@ + + + + + {{tag.letter}}:{{resolvedTranslation[tag.tag]?.name || tag.tag}} + + + + + + + + + + + + {{$t('m.addTag')}} + + + + + + + + @@ -379,7 +413,7 @@