1
0
Fork 0

Service#thumbnail should use path instead of base64

This commit is contained in:
Alan Plum 2016-04-06 18:25:18 +02:00
parent edbe1e966c
commit 5a3e42e289
No known key found for this signature in database
GPG Key ID: 8ED72A9A323B6EFD
1 changed files with 8 additions and 10 deletions

View File

@ -82,18 +82,12 @@ module.exports = class FoxxService {
); );
} }
this.thumbnail = null;
if (this.manifest.thumbnail) { if (this.manifest.thumbnail) {
const thumb = path.resolve(this.root, this.path, this.manifest.thumbnail); const thumb = path.resolve(this.root, this.path, this.manifest.thumbnail);
try { if (fs.exists(thumb)) {
this.thumbnail = fs.read64(thumb); this.thumbnail = thumb;
} catch (e) {
this.thumbnail = null;
console.warnLines(
`Cannot read thumbnail "${thumb}" for app "${data.mount}": ${e.stack}`
);
} }
} else {
this.thumbnail = null;
} }
const range = this.manifest.engines && this.manifest.engines.arangodb; const range = this.manifest.engines && this.manifest.engines.arangodb;
@ -259,7 +253,11 @@ module.exports = class FoxxService {
result.description = this.manifest.description; result.description = this.manifest.description;
} }
if (this.thumbnail) { if (this.thumbnail) {
result.thumbnail = this.thumbnail; try {
result.thumbnail = fs.read64(this.thumbnail);
} catch (e) {
// noop
}
} }
return result; return result;
} }