mirror of
https://github.com/gotson/komga.git
synced 2025-12-22 00:13:30 +01:00
feat(webreader): mark progress while reading
progress will be marked after each page is read progress will be restored when opening a book related to #25
This commit is contained in:
parent
24c994f840
commit
10895a37f5
1 changed files with 9 additions and 3 deletions
|
|
@ -271,15 +271,15 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import SettingsSwitch from '@/components/SettingsSwitch.vue'
|
|
||||||
import SettingsSelect from '@/components/SettingsSelect.vue'
|
import SettingsSelect from '@/components/SettingsSelect.vue'
|
||||||
|
import SettingsSwitch from '@/components/SettingsSwitch.vue'
|
||||||
import ThumbnailExplorerDialog from '@/components/ThumbnailExplorerDialog.vue'
|
import ThumbnailExplorerDialog from '@/components/ThumbnailExplorerDialog.vue'
|
||||||
|
import { getBookTitleCompact } from '@/functions/book-title'
|
||||||
|
|
||||||
import { checkWebpFeature } from '@/functions/check-webp'
|
import { checkWebpFeature } from '@/functions/check-webp'
|
||||||
import { bookPageUrl } from '@/functions/urls'
|
import { bookPageUrl } from '@/functions/urls'
|
||||||
import Vue from 'vue'
|
|
||||||
import { getBookTitleCompact } from '@/functions/book-title'
|
|
||||||
import { ReadingDirection } from '@/types/enum-books'
|
import { ReadingDirection } from '@/types/enum-books'
|
||||||
|
import Vue from 'vue'
|
||||||
|
|
||||||
const cookieFit = 'webreader.fit'
|
const cookieFit = 'webreader.fit'
|
||||||
const cookieReadingDirection = 'webreader.readingDirection'
|
const cookieReadingDirection = 'webreader.readingDirection'
|
||||||
|
|
@ -397,6 +397,7 @@ export default Vue.extend({
|
||||||
currentPage (val) {
|
currentPage (val) {
|
||||||
this.updateRoute()
|
this.updateRoute()
|
||||||
this.goToPage = val
|
this.goToPage = val
|
||||||
|
this.markProgress(val)
|
||||||
},
|
},
|
||||||
async book (val) {
|
async book (val) {
|
||||||
if (this.$_.has(val, 'name')) {
|
if (this.$_.has(val, 'name')) {
|
||||||
|
|
@ -564,6 +565,8 @@ export default Vue.extend({
|
||||||
this.pages = await this.$komgaBooks.getBookPages(bookId)
|
this.pages = await this.$komgaBooks.getBookPages(bookId)
|
||||||
if (page >= 1 && page <= this.pagesCount) {
|
if (page >= 1 && page <= this.pagesCount) {
|
||||||
this.goTo(page)
|
this.goTo(page)
|
||||||
|
} else if (this.book.readProgress?.completed === false) {
|
||||||
|
this.goTo(this.book.readProgress?.page!!)
|
||||||
} else {
|
} else {
|
||||||
this.goToFirst()
|
this.goToFirst()
|
||||||
}
|
}
|
||||||
|
|
@ -696,6 +699,9 @@ export default Vue.extend({
|
||||||
setter(value)
|
setter(value)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
async markProgress (page: number) {
|
||||||
|
this.$komgaBooks.updateReadProgress(this.bookId, { page: page })
|
||||||
|
},
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue