mirror of
https://github.com/ajurna/cbwebreader.git
synced 2026-11-02 10:36:55 +00:00
- Added a new `scan_directory` task to enable folder scans as asynchronous tasks while maintaining compatibility with the immediate backend. - Introduced the `reconcile` function, replacing `generate_directory` for improved separation of concerns between database writes and read operations. - Established a unique constraint on `Directory` (`one_directory_name_per_parent`) to prevent duplicate directories under the same parent. - Added a "Scan" button to the frontend for re-reading folders from disk, along with new task invocation endpoints in the API. - Updated tests across modules to validate the new `scan_directory` task, unique constraints, and database indexing logic. - Improved cleanup logic for stale files, directories, and thumbnails to handle concurrent operations efficiently. - Simplified `scan_comics` management command by removing user dependency and aligning it with the new `reconcile` function. - Enhanced frontend components (`TheComicReader`, `TheComicList`, and others) to include lifecycle method cleanups, prevent memory leaks, and handle task-based scans.
39 lines
799 B
Vue
39 lines
799 B
Vue
<template>
|
|
<the-breadcrumbs :selector="selector" />
|
|
<the-comic-reader :selector="selector" v-if="comic_loaded" :key="selector" />
|
|
</template>
|
|
|
|
<script>
|
|
import TheBreadcrumbs from "@/components/TheBreadcrumbs";
|
|
import TheComicReader from "@/components/TheComicReader";
|
|
import api from "@/api";
|
|
export default {
|
|
name: "ReadView",
|
|
components: {TheComicReader, TheBreadcrumbs},
|
|
props: {
|
|
selector: String
|
|
},
|
|
data () {
|
|
return {
|
|
comic_loaded: false,
|
|
}
|
|
},
|
|
methods: {
|
|
checkComicExists() {
|
|
api.get('/api/read/' + this.selector + '/type/')
|
|
.then(() => {
|
|
this.comic_loaded = true
|
|
})
|
|
.catch((error) => {console.log(error)})
|
|
}
|
|
},
|
|
mounted () {
|
|
this.checkComicExists()
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style scoped>
|
|
|
|
</style>
|