mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Remove hard coded list in extensions
This commit is contained in:
@@ -118,6 +118,7 @@ const directories = {
|
||||
thumbnailsBg: 'thumbnails/bg/',
|
||||
thumbnailsAvatar: 'thumbnails/avatar/',
|
||||
themes: 'public/themes',
|
||||
extensions: 'public/scripts/extensions'
|
||||
};
|
||||
|
||||
// CSRF Protection //
|
||||
@@ -1920,6 +1921,14 @@ app.post('/generate_poe', jsonParser, async (request, response) => {
|
||||
}
|
||||
});
|
||||
|
||||
app.get('/discover_extensions', jsonParser, function (_, response) {
|
||||
const extensions = fs
|
||||
.readdirSync(directories.extensions)
|
||||
.filter(f => fs.statSync(path.join(directories.extensions, f)).isDirectory());
|
||||
|
||||
return response.send(extensions);
|
||||
});
|
||||
|
||||
function getThumbnailFolder(type) {
|
||||
let thumbnailFolder;
|
||||
|
||||
|
Reference in New Issue
Block a user