Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2ef6d4738a | ||
|
|
65f7d4e109 | ||
|
|
6166c370ef | ||
|
|
ad1cade6bf |
No files matched your search
@@ -1,5 +1,12 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## [3.1.0](https://github.com/Masutayunikon/FanKarr/compare/v3.0.0...v3.1.0) (2026-03-27)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* use original_name and formated_name from scraper to bypass timeout ([1b693fc](https://github.com/Masutayunikon/FanKarr/commit/1b693fc53b9ca3a830c952c3f2c101bf1da7d27e))
|
||||||
|
|
||||||
## [3.0.0](https://github.com/Masutayunikon/FanKarr/compare/v2.4.1...v3.0.0) (2026-03-27)
|
## [3.0.0](https://github.com/Masutayunikon/FanKarr/compare/v2.4.1...v3.0.0) (2026-03-27)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+1
-27
@@ -187,36 +187,10 @@ function normalizeEpisode(ep: any): any {
|
|||||||
return { ...ep, thumb_image: imgProxy(ep.thumb_image ?? ep.thumbnail ?? null, 400) }
|
return { ...ep, thumb_image: imgProxy(ep.thumb_image ?? ep.thumbnail ?? null, 400) }
|
||||||
}
|
}
|
||||||
|
|
||||||
async function enrichSeriesDataWithOriginalFilenames(seriesData: any[]): Promise<any[]> {
|
|
||||||
return Promise.all(seriesData.map(async (sd) => {
|
|
||||||
if (!sd) return sd
|
|
||||||
const [serieApi, enrichedSeasons] = await Promise.all([
|
|
||||||
fankaiGet(`/series/${sd.id}`).catch(() => null),
|
|
||||||
Promise.all((sd.seasons ?? []).map(async (season: any) => {
|
|
||||||
let epsData: any[] = []
|
|
||||||
try {
|
|
||||||
let lastErr: any
|
|
||||||
for (let attempt = 0; attempt < 2; attempt++) {
|
|
||||||
try { const res = await fankaiGet(`/seasons/${season.id}/episodes`); epsData = Array.isArray(res) ? res : (res.episodes ?? []); break }
|
|
||||||
catch (e) { lastErr = e; if (attempt === 0) await new Promise(r => setTimeout(r, 500)) }
|
|
||||||
}
|
|
||||||
if (epsData.length === 0 && lastErr) throw lastErr
|
|
||||||
} catch { return season }
|
|
||||||
const origMap = new Map<number, { original_filename: string; formatted_name: string }>()
|
|
||||||
for (const ep of epsData) {
|
|
||||||
if (ep.id) origMap.set(ep.id, { original_filename: ep.original_filename ?? '', formatted_name: ep.formatted_name ?? '' })
|
|
||||||
}
|
|
||||||
return { ...season, episodes: (season.episodes ?? []).map((ep: any) => ({ ...ep, original_filename: origMap.get(ep.id)?.original_filename ?? null, formatted_name: origMap.get(ep.id)?.formatted_name ?? null })) }
|
|
||||||
}))
|
|
||||||
])
|
|
||||||
return { ...sd, title_for_plex: serieApi?.title_for_plex ?? null, seasons: enrichedSeasons }
|
|
||||||
}))
|
|
||||||
}
|
|
||||||
|
|
||||||
async function loadEnrichedSeriesData(): Promise<any[]> {
|
async function loadEnrichedSeriesData(): Promise<any[]> {
|
||||||
const ids = await readAvailable()
|
const ids = await readAvailable()
|
||||||
const allSd = await Promise.all(ids.map(id => readSerieData(id)))
|
const allSd = await Promise.all(ids.map(id => readSerieData(id)))
|
||||||
return enrichSeriesDataWithOriginalFilenames(allSd.filter(Boolean))
|
return allSd.filter(Boolean)
|
||||||
}
|
}
|
||||||
|
|
||||||
function computeSerieDownloadState(serieData: any | null, organized: Record<string, Record<string, string>>, activeTorrents: Set<string>): 'none' | 'downloading' | 'partial' | 'complete' {
|
function computeSerieDownloadState(serieData: any | null, organized: Record<string, Record<string, string>>, activeTorrents: Set<string>): 'none' | 'downloading' | 'partial' | 'complete' {
|
||||||
|
|||||||
Reference in new issue
Block a user