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>
|
<template>
|
||||||
<tr class="border-t hover:bg-green-100">
|
<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') }}
|
{{ String(chapter.number).padStart(2, '0') }}
|
||||||
</td>
|
</td>
|
||||||
<td class="px-4 py-2 w-full text-left">
|
<td class="px-4 py-2 w-full text-left">
|
||||||
<router-link
|
<router-link
|
||||||
v-if="chapter.isDownloaded"
|
v-if="chapter.isAvailable"
|
||||||
:to="{
|
:to="{
|
||||||
name: 'reader',
|
name: 'reader',
|
||||||
params: {
|
params: {
|
||||||
mangaSlug: mangaSlug,
|
chapterId: chapter.id
|
||||||
chapterNumber: chapter.number,
|
|
||||||
pageNumber: 1
|
|
||||||
}
|
}
|
||||||
}"
|
}"
|
||||||
class="hover:text-green-500">
|
class="text-green-500">
|
||||||
{{ chapter.title || 'Sans titre' }}
|
{{ chapter.title || 'Sans titre' }}
|
||||||
</router-link>
|
</router-link>
|
||||||
<span v-else>{{ chapter.title || 'Sans titre' }}</span>
|
<span v-else>{{ chapter.title || 'Sans titre' }}</span>
|
||||||
</td>
|
</td>
|
||||||
<td class="px-4 py-2 flex justify-end gap-2">
|
<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" />
|
<MagnifyingGlassIcon class="h-5 w-5" />
|
||||||
</button>
|
</button>
|
||||||
<button v-else @click="handleDelete" class="text-gray-500 hover:text-green-500">
|
<button v-else @click="handleDelete" class="text-gray-500 hover:text-green-500">
|
||||||
|
|||||||
@@ -46,14 +46,15 @@
|
|||||||
chapters: []
|
chapters: []
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
volumeMap.get(volumeNumber).chapters.push({
|
volumeMap.get(volumeNumber).chapters.push({
|
||||||
...chapter,
|
...chapter,
|
||||||
isDownloaded: Boolean(chapter.cbzPath)
|
isAvailable: Boolean(chapter.isAvailable)
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
for (const volume of volumeMap.values()) {
|
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;
|
volume.totalChapter = volume.chapters.length;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user