fix: modal X-Button fixed, xREL debug-endpoint
This commit is contained in:
@@ -309,4 +309,27 @@ router.put('/settings', authenticate, requireAdmin, (req, res) => {
|
||||
res.json({ ok: true });
|
||||
});
|
||||
|
||||
// DEBUG – nach Test entfernen
|
||||
router.get('/debug-xrel2', authenticate, async (req, res) => {
|
||||
const title = req.query.title || 'Thunderbolts';
|
||||
const original = req.query.original || title;
|
||||
const log = {};
|
||||
try {
|
||||
log.step1_query = title;
|
||||
const searchData = await xrelFetch('/search/ext_info.json', { q: title, type: 'movie', limit: 5 });
|
||||
log.step1_results = (searchData.results || []).map(r => ({ id: r.id, title: r.title, type: r.type }));
|
||||
const extInfoId = (searchData.results || []).find(h => h.type === 'movie')?.id;
|
||||
log.ext_info_id = extInfoId || null;
|
||||
if (extInfoId) {
|
||||
const p2p = await xrelFetch('/p2p/releases.json', { ext_info_id: extInfoId, per_page: 5 });
|
||||
log.p2p_total = p2p.total_count;
|
||||
log.p2p_sample = (p2p.list || []).slice(0, 3).map(r => ({ dirname: r.dirname, main_lang: r.main_lang, pub_time: r.pub_time }));
|
||||
const scene = await xrelFetch('/release/ext_info.json', { id: extInfoId, per_page: 5 });
|
||||
log.scene_total = scene.total_count;
|
||||
log.scene_sample = (scene.list || []).slice(0, 3).map(r => ({ dirname: r.dirname, time: r.time }));
|
||||
}
|
||||
} catch (e) { log.error = e.message; }
|
||||
res.json(log);
|
||||
});
|
||||
|
||||
module.exports = router;
|
||||
|
||||
Reference in New Issue
Block a user