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:
parent
2f73d3d42d
commit
54b5641947
@@ -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">
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user