Compare commits

..
4 Commits
Author SHA1 Message Date
MasutaYunikon d0c876b885 Merge pull request #19 from Masutayunikon/release-please--branches--main
chore(main): release 1.8.0
2026-03-13 00:26:18 +01:00
MasutaYunikon ce0bf1b8ab chore(main): release 1.8.0 2026-03-13 00:25:54 +01:00
MasutaYunikon 014c7bbbc3 Merge remote-tracking branch 'origin/main' 2026-03-13 00:25:34 +01:00
MasutaYunikon f3bcc68104 feat: cache images 2026-03-13 00:25:24 +01:00
3 changed files with 18 additions and 16 deletions

No files matched your search

+7
View File
@@ -1,5 +1,12 @@
# Changelog
## [1.8.0](https://github.com/Masutayunikon/FanKarr/compare/v1.7.3...v1.8.0) (2026-03-12)
### Features
* cache images ([da460de](https://github.com/Masutayunikon/FanKarr/commit/da460de60c4eec6851ea58ce0ae646a1208f6018))
## [1.7.3](https://github.com/Masutayunikon/FanKarr/compare/v1.7.2...v1.7.3) (2026-03-12)
+9
View File
@@ -61,6 +61,8 @@ export const useSeriesStore = defineStore('series', () => {
const loadingDetail = ref(false)
const error = ref<string | null>(null)
const _imageCache = new Set<string>()
async function fetchSeries() {
loadingSeries.value = true
error.value = null
@@ -69,6 +71,13 @@ export const useSeriesStore = defineStore('series', () => {
if (!res.ok) throw new Error(`Erreur ${res.status}`)
const data = await res.json()
series.value = data.series
// Précache des posters en arrière-plan
for (const s of data.series as Serie[]) {
if (s.poster_image && !_imageCache.has(s.poster_image)) {
_imageCache.add(s.poster_image)
new Image().src = s.poster_image
}
}
} catch (err) {
error.value = err instanceof Error ? err.message : 'Erreur inconnue'
} finally {
+2 -16
View File
@@ -276,23 +276,10 @@ async function fetchOrganizeNotifs() {
}
// ── Cache images ───────────────────────────────────────────────
const imageCache = new Set<string>()
function precacheImages(series: any[]) {
for (const s of series) {
if (s.poster_image && !imageCache.has(s.poster_image)) {
imageCache.add(s.poster_image)
const img = new Image()
img.src = s.poster_image
}
}
}
// Géré directement dans le store series.ts
onMounted(async () => {
if (store.series.length === 0) {
await store.fetchSeries()
precacheImages(store.series)
}
if (store.series.length === 0) await store.fetchSeries()
fetchActiveDownloads()
fetchOrganizeNotifs()
dlInterval = setInterval(() => {
@@ -304,7 +291,6 @@ onMounted(async () => {
// Refresh au retour sur le catalogue (après update ou scan)
onActivated(async () => {
await store.fetchSeries()
precacheImages(store.series)
fetchActiveDownloads()
})