mirror of
https://github.com/knightcrawler-stremio/knightcrawler.git
synced 2024-12-20 03:29:51 +00:00
[addon] adds configurable support
This commit is contained in:
@@ -35,6 +35,10 @@ function manifest(config = {}) {
|
|||||||
idPrefixes: ['tt', 'kitsu'],
|
idPrefixes: ['tt', 'kitsu'],
|
||||||
background: `https://i.ibb.co/VtSfFP9/t8wVwcg.jpg`,
|
background: `https://i.ibb.co/VtSfFP9/t8wVwcg.jpg`,
|
||||||
logo: `https://i.ibb.co/w4BnkC9/GwxAcDV.png`,
|
logo: `https://i.ibb.co/w4BnkC9/GwxAcDV.png`,
|
||||||
|
behaviorHints: {
|
||||||
|
configurable: true,
|
||||||
|
configurationRequired: false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -16,13 +16,12 @@ const limiter = rateLimit({
|
|||||||
router.use(limiter);
|
router.use(limiter);
|
||||||
|
|
||||||
router.get('/', (_, res) => {
|
router.get('/', (_, res) => {
|
||||||
const landingHTML = landingTemplate(manifest());
|
res.redirect('/configure')
|
||||||
res.setHeader('content-type', 'text/html');
|
res.end();
|
||||||
res.end(landingHTML);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
router.get('/:configuration', (req, res) => {
|
router.get('/:configuration?/configure', (req, res) => {
|
||||||
const configValues = parseConfiguration(req.params.configuration);
|
const configValues = parseConfiguration(req.params.configuration || '');
|
||||||
const landingHTML = landingTemplate(manifest(configValues), configValues);
|
const landingHTML = landingTemplate(manifest(configValues), configValues);
|
||||||
res.setHeader('content-type', 'text/html');
|
res.setHeader('content-type', 'text/html');
|
||||||
res.end(landingHTML);
|
res.end(landingHTML);
|
||||||
|
|||||||
Reference in New Issue
Block a user