mirror of
https://github.com/xuthus83/pigallery2.git
synced 2024-11-03 21:04:03 +08:00
fixing tests
This commit is contained in:
parent
dab32f72f4
commit
e7cb6311a9
@ -17,13 +17,15 @@ const pool = new Pool();
|
|||||||
|
|
||||||
const LOG_TAG = "[DiskManager]";
|
const LOG_TAG = "[DiskManager]";
|
||||||
|
|
||||||
|
interface PoolInput {
|
||||||
|
relativeDirectoryName: string;
|
||||||
|
directoryName: string;
|
||||||
|
directoryParent: string;
|
||||||
|
absoluteDirectoryName: string;
|
||||||
|
}
|
||||||
|
|
||||||
pool.run(
|
pool.run(
|
||||||
(input: {
|
(input: PoolInput, done) => {
|
||||||
relativeDirectoryName: string,
|
|
||||||
directoryName: string,
|
|
||||||
directoryParent: string,
|
|
||||||
absoluteDirectoryName: string
|
|
||||||
}, done) => {
|
|
||||||
const fs = require("fs");
|
const fs = require("fs");
|
||||||
const path = require("path");
|
const path = require("path");
|
||||||
const mime = require("mime");
|
const mime = require("mime");
|
||||||
@ -153,7 +155,6 @@ pool.run(
|
|||||||
promises.push(promise);
|
promises.push(promise);
|
||||||
} else if (isImage(fullFilePath)) {
|
} else if (isImage(fullFilePath)) {
|
||||||
|
|
||||||
|
|
||||||
let promise = loadPhotoMetadata(fullFilePath).then((photoMetadata) => {
|
let promise = loadPhotoMetadata(fullFilePath).then((photoMetadata) => {
|
||||||
directory.photos.push(<PhotoDTO>{
|
directory.photos.push(<PhotoDTO>{
|
||||||
name: file,
|
name: file,
|
||||||
@ -161,8 +162,8 @@ pool.run(
|
|||||||
metadata: photoMetadata
|
metadata: photoMetadata
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
promises.push(promise);
|
promises.push(promise);
|
||||||
|
|
||||||
if (maxPhotos != null && promises.length > maxPhotos) {
|
if (maxPhotos != null && promises.length > maxPhotos) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -224,4 +225,4 @@ export class DiskManager {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -51,6 +51,7 @@ module.exports = function(config) {
|
|||||||
{pattern: 'node_modules/rxjs/**/*.js.map', included: false, watched: false},
|
{pattern: 'node_modules/rxjs/**/*.js.map', included: false, watched: false},
|
||||||
//Other libs
|
//Other libs
|
||||||
{pattern: 'node_modules/ng2-cookies/**/*.js', included: false, watched: false},
|
{pattern: 'node_modules/ng2-cookies/**/*.js', included: false, watched: false},
|
||||||
|
{pattern: 'node_modules/typeconfig/**/*.js', included: false, watched: false},
|
||||||
|
|
||||||
|
|
||||||
// Paths loaded via module imports:
|
// Paths loaded via module imports:
|
||||||
|
Loading…
Reference in New Issue
Block a user