Remove the backup prefix from the key

This commit is contained in:
Johannes Zellner
2015-12-30 18:30:41 +01:00
parent ca74b5740a
commit 128a138e74

View File

@@ -51,13 +51,15 @@ function getAllPaged(backupConfig, page, perPage, callback) {
if (error) return callback(error);
var results = data.Contents.map(function (backup) {
var key = backup.Key.slice(backupConfig.prefix.length + 1);
// This depends on the backups.js format of backup names :-(
var version = backup.Key.slice(backup.Key.lastIndexOf('-') + 2, -7);
var version = key.slice(key.lastIndexOf('-') + 2, -7);
return {
creationTime: backup.LastModified,
boxVersion: version,
restoreKey: backup.Key,
restoreKey: key,
dependsOn: [] // FIXME we have no information here
};
});