Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions src/components/SeriesActionsMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
<q-item clickable @click="promptResetSeries" v-close-popup>
<q-item-section no-wrap>Reset Metadata</q-item-section>
</q-item>
<q-item clickable @click="clearSeriesCache" v-close-popup>
<q-item-section no-wrap>Clear Cache</q-item-section>
</q-item>
</q-menu>

<q-dialog v-model="loading" maximized transition-duration="0">
Expand Down Expand Up @@ -110,6 +113,16 @@ async function autoIdentify() {
}
loading.value = false
}

async function clearSeriesCache() {
loading.value = true
try {
await metadataService.clearSeriesCache(libraryId(), seriesId())
} catch (e) {
errorNotification(e, $q)
}
loading.value = false
}
</script>

<style scoped lang="scss">
Expand Down
14 changes: 14 additions & 0 deletions src/services/komf-metadata.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,20 @@ export default class KomfMetadataService {
}
}

async clearSeriesCache(libraryId: string, seriesId: string) {
try {
await this.http.post(
`${this.settings.komfUrl}/${this.settings.mediaServer}/cache/library/${libraryId}/series/${seriesId}/clear`
)
} catch (e) {
let msg = 'Failed to clear series cache'
if (axios.isAxiosError(e)) {
msg += `: ${e.message}`
}
throw new Error(msg)
}
}

async resetSeries(libraryId: string, seriesId: string) {
try {
await this.http.post(
Expand Down