Skip to content

Commit

Permalink
Fixed automatic filename and update time in media entities
Browse files Browse the repository at this point in the history
  • Loading branch information
mrzapp committed Feb 22, 2021
1 parent bf778b8 commit d769b7b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "hashbrown-cms",
"repository": "https://github.com/HashBrownCMS/hashbrown-cms.git",
"version": "1.4.1",
"version": "1.4.2",
"description": "A free and open-source headless CMS",
"main": "hashbrown.js",
"scripts": {
Expand Down
6 changes: 6 additions & 0 deletions src/Server/Entity/Resource/Media.js
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,12 @@ class Media extends require('Common/Entity/Resource/Media') {
context: context
});
}

let stats = await HashBrown.Service.FileService.stat(file);

resource.filename = filename;
resource.updatedOn = stats.ctime;
break;
}

return resource;
Expand Down

0 comments on commit d769b7b

Please sign in to comment.