mirror of
https://github.com/gotson/komga.git
synced 2025-12-21 07:56:57 +01:00
feat(webui): reAnalyze series
This commit is contained in:
parent
e80451ffcc
commit
b9975618a3
2 changed files with 28 additions and 0 deletions
|
|
@ -48,6 +48,19 @@
|
|||
</v-list-item>
|
||||
</v-list>
|
||||
</v-menu>
|
||||
|
||||
<v-menu offset-y>
|
||||
<template v-slot:activator="{ on }">
|
||||
<v-btn icon v-on="on">
|
||||
<v-icon>mdi-dots-vertical</v-icon>
|
||||
</v-btn>
|
||||
</template>
|
||||
<v-list>
|
||||
<v-list-item @click="analyze()">
|
||||
<v-list-item-title>Analyze</v-list-item-title>
|
||||
</v-list-item>
|
||||
</v-list>
|
||||
</v-menu>
|
||||
</v-toolbar>
|
||||
|
||||
<v-container fluid class="px-6">
|
||||
|
|
@ -237,6 +250,9 @@ export default Vue.extend({
|
|||
}
|
||||
this.books.splice(page.number * page.size, page.size, ...page.content)
|
||||
this.pagesState[page.number] = LoadState.Loaded
|
||||
},
|
||||
analyze () {
|
||||
this.$komgaSeries.analyzeSeries(this.series)
|
||||
}
|
||||
}
|
||||
})
|
||||
|
|
|
|||
|
|
@ -89,4 +89,16 @@ export default class KomgaSeriesService {
|
|||
throw new Error(msg)
|
||||
}
|
||||
}
|
||||
|
||||
async analyzeSeries (series: SeriesDto) {
|
||||
try {
|
||||
await this.http.post(`${API_SERIES}/${series.id}/analyze`)
|
||||
} catch (e) {
|
||||
let msg = `An error occurred while trying to analyze series '${series.name}'`
|
||||
if (e.response.data.message) {
|
||||
msg += `: ${e.response.data.message}`
|
||||
}
|
||||
throw new Error(msg)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue