Skip to content

Commit

Permalink
Remove file extension from asset key and title
Browse files Browse the repository at this point in the history
  • Loading branch information
m-mohr committed Jan 30, 2025
1 parent b46b7b2 commit cbc9d27
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/api/worker/batchjob.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ async function createSTAC(storage, job, results) {
];
for(const { filepath, datacube } of results) {
const params = datacube.getOutputFormatParameters();
const filename = path.basename(filepath);
const { name: key } = path.parse(filepath);
const stat = await fse.stat(filepath);
const mediaType = Utils.extensionToMediaType(filepath);
let geotiffImage = null;
Expand All @@ -97,7 +97,7 @@ async function createSTAC(storage, job, results) {
href: path.relative(folder, filepath),
roles: ["data"],
type: mediaType,
title: filename,
title: key,
"file:size": stat.size,
created: stat.birthtime,
updated: stat.mtime
Expand Down Expand Up @@ -168,7 +168,7 @@ async function createSTAC(storage, job, results) {
}

const cube = datacube.toJSON();
assets[filename] = Object.assign(asset, cube, params.metadata);
assets[key] = Object.assign(asset, cube, params.metadata);
}
const item = {
stac_version: packageInfo.stac_version,
Expand Down

0 comments on commit cbc9d27

Please sign in to comment.