mirror of
https://github.com/molstar/molstar.git
synced 2026-06-04 13:30:24 +08:00
Reverting changes to central files that I thought I had to make to get the code to compile on a previous master checkout. The repository compiles without them now.
This commit is contained in:
@@ -49,8 +49,7 @@ async function predictMembraneOrientation(req: express.Request, res: express.Res
|
||||
try {
|
||||
const ctx = { runtime: SyncRuntimeContext, assetManager };
|
||||
|
||||
// Make sure this is a string, taking the first element if it's an array (which can happen if the query parameter is repeated)
|
||||
const entryId = Array.isArray(req.params.id) ? req.params.id[0] : req.params.id;
|
||||
const entryId = req.params.id;
|
||||
const assemblyId = req.query.assemblyId as string ?? '1';
|
||||
const p = parseParams(req);
|
||||
ConsoleLogger.log('predictMembraneOrientation', `${entryId}-${assemblyId} with params: ${JSON.stringify(p)}`);
|
||||
|
||||
@@ -54,7 +54,7 @@ export function createResultWriter(response: express.Response, params: ResultWri
|
||||
|
||||
function mapQuery(app: express.Express, queryName: string, queryDefinition: QueryDefinition) {
|
||||
function createJob(queryParams: any, req: express.Request, res: express.Response) {
|
||||
const entryId = (Array.isArray(req.params.id) ? req.params.id[0] : req.params.id) || '';
|
||||
const entryId = req.params.id;
|
||||
const commonParams = normalizeRestCommonParams(req.query);
|
||||
const resultWriterParams = { encoding: commonParams.encoding!, download: !!commonParams.download, filename: commonParams.filename!, entryId, queryName };
|
||||
const jobId = JobManager.add({
|
||||
@@ -93,9 +93,7 @@ function serveStatic(req: express.Request, res: express.Response) {
|
||||
: req.params.source;
|
||||
|
||||
const id = req.params.id;
|
||||
const stringSource = (Array.isArray(source) ? source[0] : source) || '';
|
||||
const stringId = (Array.isArray(id) ? id[0] : id) || '';
|
||||
const [fn, format] = mapSourceAndIdToFilename(stringSource, stringId);
|
||||
const [fn, format] = mapSourceAndIdToFilename(source, id);
|
||||
const binary = format === 'bcif' || fn.indexOf('.bcif') > 0;
|
||||
|
||||
if (!fn || !fs.existsSync(fn)) {
|
||||
|
||||
@@ -105,7 +105,7 @@ function mapPath(path: string) {
|
||||
}
|
||||
|
||||
app.get(mapPath(`/get/:id`), (req, res) => {
|
||||
const id = (Array.isArray(req.params.id) ? req.params.id[0] : req.params.id) || '';
|
||||
const id: string = req.params.id || '';
|
||||
console.log('Reading', id);
|
||||
if (id.length === 0 || id.indexOf('.') >= 0 || id.indexOf('/') >= 0 || id.indexOf('\\') >= 0) {
|
||||
res.status(404);
|
||||
|
||||
@@ -183,9 +183,7 @@ async function queryBox(req: express.Request, res: express.Response, params: Dat
|
||||
return;
|
||||
}
|
||||
|
||||
const stringSource = (Array.isArray(req.params.source) ? req.params.source[0] : req.params.source) || '';
|
||||
const stringId = (Array.isArray(req.params.id) ? req.params.id[0] : req.params.id) || '';
|
||||
const outputFilename = Api.getOutputFilename(stringSource, stringId, params);
|
||||
const outputFilename = Api.getOutputFilename(req.params.source, req.params.id, params);
|
||||
const response = wrapResponse(outputFilename, res);
|
||||
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user