1
0
mirror of https://github.com/bpatrik/pigallery2.git synced 2025-12-13 23:56:56 +02:00

implementing mysql search and instant search

This commit is contained in:
Braun Patrik
2016-12-28 12:30:26 +01:00
parent 3ad2f6612f
commit d993a3275b
17 changed files with 139 additions and 52 deletions

View File

@@ -1,7 +1,7 @@
import {IGalleryManager} from "../interfaces/IGalleryManager";
import {DirectoryDTO} from "../../../common/entities/DirectoryDTO";
import * as path from "path";
import {DirectoryEnitity} from "./enitites/DirectoryEntity";
import {DirectoryEntity} from "./enitites/DirectoryEntity";
import {MySQLConnection} from "./MySQLConnection";
import {DiskManager} from "../DiskManger";
import {PhotoEntity} from "./enitites/PhotoEntity";
@@ -18,7 +18,7 @@ export class GalleryManager implements IGalleryManager {
MySQLConnection.getConnection().then(async connection => {
let dir = await connection
.getRepository(DirectoryEnitity)
.getRepository(DirectoryEntity)
.createQueryBuilder("directory_entity")
.where("directory_entity.name = :name AND directory_entity.path = :path", {
name: directoryName,
@@ -54,7 +54,7 @@ export class GalleryManager implements IGalleryManager {
DiskManager.scanDirectory(relativeDirectoryName, (err, scannedDirectory) => {
MySQLConnection.getConnection().then(async connection => {
let directoryRepository = connection.getRepository(DirectoryEnitity);
let directoryRepository = connection.getRepository(DirectoryEntity);
let photosRepository = connection.getRepository(PhotoEntity);
let parentDir = await directoryRepository.persist(scannedDirectory);