feat: mise à jour de la gestion de la disponibilité des chapitres dans les composants MangaChapter et MangaDetails, remplaçant isDownloaded par isAvailable pour une meilleure clarté

This commit is contained in:
ext.jeremy.guillot@maxicoffee.domains
2025-03-28 15:36:34 +01:00
parent 2f73d3d42d
commit 54b5641947
2 changed files with 8 additions and 9 deletions

View File

@@ -1,26 +1,24 @@
<template>
<tr class="border-t hover:bg-green-100">
<td class="px-4 py-2" :class="{ 'text-green-500': chapter.isDownloaded }">
<td class="px-4 py-2" :class="{ 'text-green-500': chapter.isAvailable }">
{{ String(chapter.number).padStart(2, '0') }}
</td>
<td class="px-4 py-2 w-full text-left">
<router-link
v-if="chapter.isDownloaded"
v-if="chapter.isAvailable"
:to="{
name: 'reader',
params: {
mangaSlug: mangaSlug,
chapterNumber: chapter.number,
pageNumber: 1
chapterId: chapter.id
}
}"
class="hover:text-green-500">
class="text-green-500">
{{ chapter.title || 'Sans titre' }}
</router-link>
<span v-else>{{ chapter.title || 'Sans titre' }}</span>
</td>
<td class="px-4 py-2 flex justify-end gap-2">
<button v-if="!chapter.isDownloaded" @click="handleSearch" class="text-gray-500 hover:text-green-500">
<button v-if="!chapter.isAvailable" @click="handleSearch" class="text-gray-500 hover:text-green-500">
<MagnifyingGlassIcon class="h-5 w-5" />
</button>
<button v-else @click="handleDelete" class="text-gray-500 hover:text-green-500">

View File

@@ -46,14 +46,15 @@
chapters: []
});
}
volumeMap.get(volumeNumber).chapters.push({
...chapter,
isDownloaded: Boolean(chapter.cbzPath)
isAvailable: Boolean(chapter.isAvailable)
});
});
for (const volume of volumeMap.values()) {
volume.downloadedChapter = volume.chapters.filter(c => c.isDownloaded).length;
volume.downloadedChapter = volume.chapters.filter(c => c.isAvailable).length;
volume.totalChapter = volume.chapters.length;
}