From 1a37b832be441da4f1b31269734d59583568e734 Mon Sep 17 00:00:00 2001 From: "Patrik J. Braun" Date: Mon, 26 Nov 2018 00:26:29 +0100 Subject: [PATCH] adding GPX support --- README.md | 2 +- backend/middlewares/GalleryMWs.ts | 7 +- backend/model/sql/GalleryManager.ts | 32 + backend/model/sql/SQLConnection.ts | 3 + backend/model/sql/SearchManager.ts | 6 +- backend/model/sql/enitites/DirectoryEntity.ts | 5 + backend/model/sql/enitites/FileEntity.ts | 17 + backend/model/sql/enitites/MediaEntity.ts | 3 +- backend/model/threading/DiskMangerWorker.ts | 26 +- backend/routes/GalleryRouter.ts | 32 +- common/DataStructureVersion.ts | 2 +- common/entities/DirectoryDTO.ts | 12 +- common/entities/FileDTO.ts | 11 + common/entities/MediaDTO.ts | 3 +- common/entities/SearchResultDTO.ts | 8 +- demo/images/RK_gpx _2015-06-12_0727.gpx | 2781 +++++++++++++++++ demo/images/RK_gpx _2015-06-15_0739.gpx | 550 ++++ frontend/app/app.module.ts | 2 + frontend/app/gallery/gallery.component.html | 6 +- .../lightbox.map.gallery.component.html | 15 + .../lightbox.map.gallery.component.ts | 26 +- .../gallery/map/map.gallery.component.html | 2 +- .../app/gallery/map/map.gallery.component.ts | 4 +- frontend/app/gallery/map/map.service.ts | 34 + frontend/app/model/network/network.service.ts | 26 +- test/backend/unit/model/sql/GalleryManager.ts | 10 +- test/backend/unit/model/sql/SearchManager.ts | 16 +- test/backend/unit/model/sql/TestHelper.ts | 12 + 28 files changed, 3610 insertions(+), 43 deletions(-) create mode 100644 backend/model/sql/enitites/FileEntity.ts create mode 100644 common/entities/FileDTO.ts create mode 100644 demo/images/RK_gpx _2015-06-12_0727.gpx create mode 100644 demo/images/RK_gpx _2015-06-15_0739.gpx create mode 100644 frontend/app/gallery/map/map.service.ts diff --git a/README.md b/README.md index 46061c8..8a3e0bc 100644 --- a/README.md +++ b/README.md @@ -120,7 +120,7 @@ apt-get install build-essential libkrb5-dev gcc g++ * gesture support (swipe left, right, up) * Client side caching (directories and search results) * Rendering **photos** with GPS coordinates **on google map** - * .gpx file support - `future plan` + * .gpx file support * **Two modes: SQL database and no-database mode** * both modes supports * user management diff --git a/backend/middlewares/GalleryMWs.ts b/backend/middlewares/GalleryMWs.ts index 2835520..5ae1eb4 100644 --- a/backend/middlewares/GalleryMWs.ts +++ b/backend/middlewares/GalleryMWs.ts @@ -151,12 +151,11 @@ export class GalleryMWs { return next(); } - public static loadMedia(req: Request, res: Response, next: NextFunction) { - if (!(req.params.mediaPath)) { + public static loadFile(req: Request, res: Response, next: NextFunction) { + if (!(req.params.filePath)) { return next(); } - - const fullMediaPath = path.join(ProjectPath.ImageFolder, req.params.mediaPath); + const fullMediaPath = path.join(ProjectPath.ImageFolder, req.params.filePath); // check if thumbnail already exist if (fs.existsSync(fullMediaPath) === false) { diff --git a/backend/model/sql/GalleryManager.ts b/backend/model/sql/GalleryManager.ts index 8e944c9..fd7f5d7 100644 --- a/backend/model/sql/GalleryManager.ts +++ b/backend/model/sql/GalleryManager.ts @@ -17,6 +17,8 @@ import {Brackets, Connection} from 'typeorm'; import {MediaEntity} from './enitites/MediaEntity'; import {MediaDTO} from '../../../common/entities/MediaDTO'; import {VideoEntity} from './enitites/VideoEntity'; +import {FileEntity} from './enitites/FileEntity'; +import {FileDTO} from '../../../common/entities/FileDTO'; export class GalleryManager implements IGalleryManager, ISQLGalleryManager { @@ -30,6 +32,7 @@ export class GalleryManager implements IGalleryManager, ISQLGalleryManager { }) .leftJoinAndSelect('directory.directories', 'directories') .leftJoinAndSelect('directory.media', 'media') + .leftJoinAndSelect('directory.metaFile', 'metaFile') .getOne(); } @@ -202,6 +205,7 @@ export class GalleryManager implements IGalleryManager, ISQLGalleryManager { // saving to db const directoryRepository = connection.getRepository(DirectoryEntity); const mediaRepository = connection.getRepository(MediaEntity); + const fileRepository = connection.getRepository(FileEntity); let currentDir: DirectoryEntity = await directoryRepository.createQueryBuilder('directory') @@ -299,6 +303,34 @@ export class GalleryManager implements IGalleryManager, ISQLGalleryManager { } await this.saveMedia(connection, mediaToSave); await mediaRepository.remove(indexedMedia); + + // save files + const indexedMetaFiles = await fileRepository.createQueryBuilder('file') + .where('file.directory = :dir', { + dir: currentDir.id + }).getMany(); + + + const metaFilesToSave = []; + for (let i = 0; i < scannedDirectory.metaFile.length; i++) { + let metaFile: FileDTO = null; + for (let j = 0; j < indexedMetaFiles.length; j++) { + if (indexedMetaFiles[j].name === scannedDirectory.metaFile[i].name) { + metaFile = indexedMetaFiles[j]; + indexedMetaFiles.splice(j, 1); + break; + } + } + if (metaFile == null) { //not in DB yet + scannedDirectory.metaFile[i].directory = null; + metaFile = Utils.clone(scannedDirectory.metaFile[i]); + scannedDirectory.metaFile[i].directory = scannedDirectory; + metaFile.directory = currentDir; + metaFilesToSave.push(metaFile); + } + } + await fileRepository.save(metaFilesToSave); + // await fileRepository.remove(indexedMetaFiles); } protected async saveMedia(connection: Connection, mediaList: MediaDTO[]): Promise { diff --git a/backend/model/sql/SQLConnection.ts b/backend/model/sql/SQLConnection.ts index ceeae65..8808ac0 100644 --- a/backend/model/sql/SQLConnection.ts +++ b/backend/model/sql/SQLConnection.ts @@ -14,6 +14,7 @@ import {Logger} from '../../Logger'; import {MediaEntity} from './enitites/MediaEntity'; import {VideoEntity} from './enitites/VideoEntity'; import {DataStructureVersion} from '../../../common/DataStructureVersion'; +import {FileEntity} from './enitites/FileEntity'; export class SQLConnection { @@ -32,6 +33,7 @@ export class SQLConnection { options.name = 'main'; options.entities = [ UserEntity, + FileEntity, MediaEntity, PhotoEntity, VideoEntity, @@ -57,6 +59,7 @@ export class SQLConnection { options.name = 'test'; options.entities = [ UserEntity, + FileEntity, MediaEntity, PhotoEntity, VideoEntity, diff --git a/backend/model/sql/SearchManager.ts b/backend/model/sql/SearchManager.ts index 019b488..b32b69a 100644 --- a/backend/model/sql/SearchManager.ts +++ b/backend/model/sql/SearchManager.ts @@ -93,11 +93,12 @@ export class SearchManager implements ISearchManager { async search(text: string, searchType: SearchTypes): Promise { const connection = await SQLConnection.getConnection(); - const result: SearchResultDTO = { + const result: SearchResultDTO = { searchText: text, searchType: searchType, directories: [], media: [], + metaFile: [], resultOverflow: false }; @@ -157,11 +158,12 @@ export class SearchManager implements ISearchManager { async instantSearch(text: string): Promise { const connection = await SQLConnection.getConnection(); - const result: SearchResultDTO = { + const result: SearchResultDTO = { searchText: text, // searchType:undefined, not adding this directories: [], media: [], + metaFile: [], resultOverflow: false }; diff --git a/backend/model/sql/enitites/DirectoryEntity.ts b/backend/model/sql/enitites/DirectoryEntity.ts index 29e8d95..70bd20d 100644 --- a/backend/model/sql/enitites/DirectoryEntity.ts +++ b/backend/model/sql/enitites/DirectoryEntity.ts @@ -1,6 +1,7 @@ import {Column, Entity, ManyToOne, OneToMany, PrimaryGeneratedColumn} from 'typeorm'; import {DirectoryDTO} from '../../../../common/entities/DirectoryDTO'; import {MediaEntity} from './MediaEntity'; +import {FileEntity} from './FileEntity'; @Entity() export class DirectoryEntity implements DirectoryDTO { @@ -37,4 +38,8 @@ export class DirectoryEntity implements DirectoryDTO { @OneToMany(type => MediaEntity, media => media.directory) public media: MediaEntity[]; + + @OneToMany(type => FileEntity, file => file.directory) + public metaFile: FileEntity[]; + } diff --git a/backend/model/sql/enitites/FileEntity.ts b/backend/model/sql/enitites/FileEntity.ts new file mode 100644 index 0000000..d23ba93 --- /dev/null +++ b/backend/model/sql/enitites/FileEntity.ts @@ -0,0 +1,17 @@ +import {Column, Entity, ManyToOne, PrimaryGeneratedColumn} from 'typeorm'; +import {DirectoryEntity} from './DirectoryEntity'; +import {FileDTO} from '../../../../common/entities/FileDTO'; + + +@Entity() +export class FileEntity implements FileDTO { + + @PrimaryGeneratedColumn() + id: number; + + @Column('text') + name: string; + + @ManyToOne(type => DirectoryEntity, directory => directory.metaFile, {onDelete: 'CASCADE'}) + directory: DirectoryEntity; +} diff --git a/backend/model/sql/enitites/MediaEntity.ts b/backend/model/sql/enitites/MediaEntity.ts index 13cdcfb..6fa85d8 100644 --- a/backend/model/sql/enitites/MediaEntity.ts +++ b/backend/model/sql/enitites/MediaEntity.ts @@ -3,6 +3,7 @@ import {DirectoryEntity} from './DirectoryEntity'; import {MediaDimension, MediaDTO, MediaMetadata} from '../../../../common/entities/MediaDTO'; import {OrientationTypes} from 'ts-exif-parser'; import {CameraMetadataEntity, PositionMetaDataEntity} from './PhotoEntity'; +import {FileEntity} from './FileEntity'; export class MediaDimensionEntity implements MediaDimension { @@ -49,7 +50,7 @@ export class MediaMetadataEntity implements MediaMetadata { // TODO: fix inheritance once its working in typeorm @Entity() @TableInheritance({column: {type: 'varchar', name: 'type'}}) -export abstract class MediaEntity implements MediaDTO { +export abstract class MediaEntity implements MediaDTO { @PrimaryGeneratedColumn() id: number; diff --git a/backend/model/threading/DiskMangerWorker.ts b/backend/model/threading/DiskMangerWorker.ts index e329e43..ea6fb52 100644 --- a/backend/model/threading/DiskMangerWorker.ts +++ b/backend/model/threading/DiskMangerWorker.ts @@ -11,6 +11,7 @@ import {Config} from '../../../common/config/private/Config'; import {VideoDTO, VideoMetadata} from '../../../common/entities/VideoDTO'; import {MediaDimension} from '../../../common/entities/MediaDTO'; import {FFmpegFactory} from '../FFmpegFactory'; +import {FileDTO} from '../../../common/entities/FileDTO'; const LOG_TAG = '[DiskManagerTask]'; @@ -45,6 +46,15 @@ export class DiskMangerWorker { return extensions.indexOf(extension) !== -1; } + private static isMetaFile(fullPath: string) { + const extensions = [ + '.gpx' + ]; + + const extension = path.extname(fullPath).toLowerCase(); + return extensions.indexOf(extension) !== -1; + } + public static scanDirectory(relativeDirectoryName: string, maxPhotos: number = null, photosOnly: boolean = false): Promise { return new Promise((resolve, reject) => { const directoryName = path.basename(relativeDirectoryName); @@ -52,14 +62,17 @@ export class DiskMangerWorker { const absoluteDirectoryName = path.join(ProjectPath.ImageFolder, relativeDirectoryName); const stat = fs.statSync(path.join(ProjectPath.ImageFolder, relativeDirectoryName)); - const directory = { + const directory: DirectoryDTO = { + id: null, + parent: null, name: directoryName, path: directoryParent, lastModified: Math.max(stat.ctime.getTime(), stat.mtime.getTime()), lastScanned: Date.now(), directories: [], isPartial: false, - media: [] + media: [], + metaFile: [] }; fs.readdir(absoluteDirectoryName, async (err, list: string[]) => { if (err) { @@ -95,9 +108,12 @@ export class DiskMangerWorker { metadata: await DiskMangerWorker.loadVideoMetadata(fullFilePath) }); - if (maxPhotos != null && directory.media.length > maxPhotos) { - break; - } + } else if (DiskMangerWorker.isMetaFile(fullFilePath)) { + directory.metaFile.push({ + name: file, + directory: null, + }); + } } diff --git a/backend/routes/GalleryRouter.ts b/backend/routes/GalleryRouter.ts index e79fc8b..3e668fd 100644 --- a/backend/routes/GalleryRouter.ts +++ b/backend/routes/GalleryRouter.ts @@ -13,6 +13,7 @@ export class GalleryRouter { this.addGetVideoThumbnail(app); this.addGetImage(app); this.addGetVideo(app); + this.addGetMetaFile(app); this.addRandom(app); this.addDirectoryList(app); @@ -34,19 +35,28 @@ export class GalleryRouter { private static addGetImage(app) { - app.get(['/api/gallery/content/:mediaPath(*\.(jpg|bmp|png|gif|jpeg))'], + app.get(['/api/gallery/content/:filePath(*\.(jpg|bmp|png|gif|jpeg))'], AuthenticationMWs.authenticate, // TODO: authorize path - GalleryMWs.loadMedia, + GalleryMWs.loadFile, RenderingMWs.renderFile ); } private static addGetVideo(app) { - app.get(['/api/gallery/content/:mediaPath(*\.(mp4|ogg|ogv|webm))'], + app.get(['/api/gallery/content/:filePath(*\.(mp4|ogg|ogv|webm))'], AuthenticationMWs.authenticate, // TODO: authorize path - GalleryMWs.loadMedia, + GalleryMWs.loadFile, + RenderingMWs.renderFile + ); + } + + private static addGetMetaFile(app) { + app.get(['/api/gallery/content/:filePath(*\.(gpx))'], + AuthenticationMWs.authenticate, + // TODO: authorize path + GalleryMWs.loadFile, RenderingMWs.renderFile ); } @@ -57,36 +67,36 @@ export class GalleryRouter { AuthenticationMWs.authorise(UserRoles.Guest), // TODO: authorize path GalleryMWs.getRandomImage, - GalleryMWs.loadMedia, + GalleryMWs.loadFile, RenderingMWs.renderFile ); } private static addGetImageThumbnail(app) { - app.get('/api/gallery/content/:mediaPath(*\.(jpg|bmp|png|gif|jpeg))/thumbnail/:size?', + app.get('/api/gallery/content/:filePath(*\.(jpg|bmp|png|gif|jpeg))/thumbnail/:size?', AuthenticationMWs.authenticate, // TODO: authorize path - GalleryMWs.loadMedia, + GalleryMWs.loadFile, ThumbnailGeneratorMWs.generateThumbnailFactory(ThumbnailSourceType.Image), RenderingMWs.renderFile ); } private static addGetVideoThumbnail(app) { - app.get('/api/gallery/content/:mediaPath(*\.(mp4|ogg|ogv|webm))/thumbnail/:size?', + app.get('/api/gallery/content/:filePath(*\.(mp4|ogg|ogv|webm))/thumbnail/:size?', AuthenticationMWs.authenticate, // TODO: authorize path - GalleryMWs.loadMedia, + GalleryMWs.loadFile, ThumbnailGeneratorMWs.generateThumbnailFactory(ThumbnailSourceType.Video), RenderingMWs.renderFile ); } private static addGetImageIcon(app) { - app.get('/api/gallery/content/:mediaPath(*\.(jpg|bmp|png|gif|jpeg))/icon', + app.get('/api/gallery/content/:filePath(*\.(jpg|bmp|png|gif|jpeg))/icon', AuthenticationMWs.authenticate, // TODO: authorize path - GalleryMWs.loadMedia, + GalleryMWs.loadFile, ThumbnailGeneratorMWs.generateIconFactory(ThumbnailSourceType.Image), RenderingMWs.renderFile ); diff --git a/common/DataStructureVersion.ts b/common/DataStructureVersion.ts index d951029..a30c528 100644 --- a/common/DataStructureVersion.ts +++ b/common/DataStructureVersion.ts @@ -1 +1 @@ -export const DataStructureVersion = 2; +export const DataStructureVersion = 3; diff --git a/common/entities/DirectoryDTO.ts b/common/entities/DirectoryDTO.ts index 8a7a0ac..6a5129c 100644 --- a/common/entities/DirectoryDTO.ts +++ b/common/entities/DirectoryDTO.ts @@ -1,5 +1,6 @@ import {MediaDTO} from './MediaDTO'; import {PhotoDTO} from './PhotoDTO'; +import {FileDTO} from './FileDTO'; export interface DirectoryDTO { id: number; @@ -11,6 +12,7 @@ export interface DirectoryDTO { parent: DirectoryDTO; directories: Array; media: MediaDTO[]; + metaFile: FileDTO[]; } export module DirectoryDTO { @@ -18,7 +20,9 @@ export module DirectoryDTO { dir.media.forEach((media: MediaDTO) => { media.directory = dir; }); - + dir.metaFile.forEach((file: FileDTO) => { + file.directory = dir; + }); dir.directories.forEach((directory: DirectoryDTO) => { addReferences(directory); directory.parent = dir; @@ -29,7 +33,11 @@ export module DirectoryDTO { dir.media.forEach((media: MediaDTO) => { media.directory = null; }); - + if (dir.metaFile) { + dir.metaFile.forEach((file: FileDTO) => { + file.directory = null; + }); + } if (dir.directories) { dir.directories.forEach((directory: DirectoryDTO) => { removeReferences(directory); diff --git a/common/entities/FileDTO.ts b/common/entities/FileDTO.ts new file mode 100644 index 0000000..5ea23fd --- /dev/null +++ b/common/entities/FileDTO.ts @@ -0,0 +1,11 @@ +import {DirectoryDTO} from './DirectoryDTO'; +import {PhotoDTO} from './PhotoDTO'; +import {OrientationTypes} from 'ts-exif-parser'; +import {VideoDTO} from './VideoDTO'; + +export interface FileDTO { + id: number; + name: string; + directory: DirectoryDTO; +} + diff --git a/common/entities/MediaDTO.ts b/common/entities/MediaDTO.ts index 9d092f7..67c56f3 100644 --- a/common/entities/MediaDTO.ts +++ b/common/entities/MediaDTO.ts @@ -2,8 +2,9 @@ import {DirectoryDTO} from './DirectoryDTO'; import {PhotoDTO} from './PhotoDTO'; import {OrientationTypes} from 'ts-exif-parser'; import {VideoDTO} from './VideoDTO'; +import {FileDTO} from './FileDTO'; -export interface MediaDTO { +export interface MediaDTO extends FileDTO{ id: number; name: string; directory: DirectoryDTO; diff --git a/common/entities/SearchResultDTO.ts b/common/entities/SearchResultDTO.ts index 9b4eb0e..60aa8b2 100644 --- a/common/entities/SearchResultDTO.ts +++ b/common/entities/SearchResultDTO.ts @@ -1,11 +1,13 @@ import {DirectoryDTO} from './DirectoryDTO'; import {PhotoDTO} from './PhotoDTO'; import {SearchTypes} from './AutoCompleteItem'; +import {FileDTO} from './FileDTO'; export interface SearchResultDTO { searchText: string; - searchType: SearchTypes; - directories: Array; - media: Array; + searchType?: SearchTypes; + directories: DirectoryDTO[]; + media: PhotoDTO[]; + metaFile: FileDTO[]; resultOverflow: boolean; } diff --git a/demo/images/RK_gpx _2015-06-12_0727.gpx b/demo/images/RK_gpx _2015-06-12_0727.gpx new file mode 100644 index 0000000..2f32952 --- /dev/null +++ b/demo/images/RK_gpx _2015-06-12_0727.gpx @@ -0,0 +1,2781 @@ + + + + + + +1238.0 +1238.0 +1238.0 +1239.1 +1240.0 +1240.2 +1240.5 +1240.9 +1241.3 +1241.6 +1242.0 +1243.0 +1244.0 +1245.0 +1245.1 +1245.2 +1245.7 +1246.3 +1246.8 +1247.4 +1247.9 +1248.5 +1248.4 +1248.3 +1248.2 +1248.1 +1248.0 +1248.0 +1248.0 +1248.0 +1248.0 +1248.6 +1249.3 +1249.9 +1250.5 +1251.2 +1251.8 +1252.5 +1253.1 +1253.7 +1254.4 +1255.0 +1256.4 +1257.7 +1259.1 +1260.5 +1261.8 +1262.6 +1263.5 +1264.3 +1265.1 +1265.9 +1267.2 +1267.1 +1267.0 +1266.9 +1266.8 +1266.7 +1267.2 +1267.6 +1268.1 +1268.5 +1269.0 +1271.1 +1273.2 +1275.3 +1277.4 +1279.5 +1281.5 +1283.6 +1285.7 +1287.8 +1291.7 +1295.6 +1297.5 +1299.3 +1301.1 +1302.9 +1304.7 +1306.5 +1308.4 +1319.0 +1329.6 +1338.5 +1347.3 +1356.1 +1364.9 +1373.7 +1371.9 +1370.1 +1378.9 +1387.7 +1387.7 +1387.7 +1387.7 +1387.7 +1387.7 +1387.7 +1387.7 +1398.4 +1409.0 +1409.0 +1409.0 +1409.0 +1409.0 +1409.0 +1399.1 +1389.2 +1379.3 +1369.4 +1369.4 +1369.4 +1369.4 +1369.4 +1369.4 +1369.4 +1369.4 +1379.3 +1389.2 +1399.1 +1409.0 +1409.0 +1409.0 +1409.0 +1409.0 +1409.0 +1409.0 +1409.0 +1409.0 +1409.0 +1409.0 +1409.0 +1409.0 +1409.0 +1409.0 +1409.0 +1409.0 +1409.0 +1409.0 +1409.0 +1409.0 +1409.0 +1409.0 +1409.0 +1409.0 +1409.0 +1409.0 +1409.0 +1409.0 +1409.0 +1409.0 +1409.0 +1409.0 +1409.0 +1409.0 +1409.0 +1409.0 +1407.3 +1405.5 +1403.8 +1402.1 +1400.4 +1398.6 +1396.9 +1395.2 +1393.5 +1393.1 +1392.7 +1394.1 +1395.5 +1396.8 +1398.2 +1399.5 +1402.6 +1405.7 +1408.8 +1411.9 +1413.6 +1415.4 +1417.1 +1420.4 +1423.6 +1426.9 +1430.2 +1431.7 +1433.3 +1434.8 +1436.4 +1438.8 +1441.3 +1443.7 +1444.6 +1445.5 +1446.5 +1447.4 +1452.5 +1457.7 +1462.9 +1468.1 +1472.4 +1476.6 +1480.9 +1479.3 +1477.6 +1479.4 +1481.1 +1478.5 +1476.0 +1473.5 +1470.9 +1468.4 +1465.8 +1463.3 +1463.3 +1466.6 +1466.6 +1466.6 +1466.6 +1466.6 +1466.6 +1466.6 +1466.6 +1466.6 +1466.6 +1470.0 +1470.0 +1470.0 +1470.0 +1478.7 +1487.5 +1496.2 +1504.9 +1513.6 +1522.4 +1531.1 +1539.8 +1548.5 +1557.3 +1566.0 +1566.0 +1566.0 +1566.0 +1566.0 +1566.0 +1566.0 +1566.0 +1566.0 +1566.0 +1566.0 +1566.0 +1566.0 +1566.0 +1567.3 +1568.5 +1568.5 +1568.5 +1568.5 +1569.8 +1571.1 +1572.4 +1573.6 +1574.9 +1576.2 +1576.2 +1574.9 +1576.2 +1577.5 +1578.7 +1578.7 +1578.7 +1578.7 +1578.7 +1578.7 +1578.7 +1578.7 +1580.0 +1580.0 +1580.0 +1580.0 +1580.0 +1580.0 +1580.0 +1580.0 +1580.0 +1580.0 +1580.0 +1578.9 +1577.8 +1576.7 +1575.6 +1574.5 +1573.5 +1572.4 +1571.3 +1570.2 +1569.5 +1568.7 +1569.1 +1569.5 +1569.8 +1570.2 +1570.5 +1570.9 +1570.9 +1570.9 +1570.9 +1570.5 +1568.4 +1566.2 +1564.0 +1561.8 +1559.6 +1557.5 +1555.3 +1553.5 +1551.6 +1549.8 +1548.0 +1548.0 +1548.0 +1548.0 +1548.0 +1548.8 +1549.6 +1550.5 +1551.3 +1552.1 +1552.9 +1553.7 +1554.5 +1555.4 +1557.5 +1559.8 +1561.3 +1562.7 +1564.2 +1565.6 +1567.1 +1568.5 +1570.0 +1571.5 +1572.9 +1573.0 +1573.0 +1576.1 +1579.2 +1582.3 +1585.2 +1588.1 +1591.0 +1593.9 +1596.8 +1599.7 +1602.6 +1605.5 +1605.4 +1602.5 +1599.7 +1597.1 +1595.5 +1594.0 +1592.5 +1590.9 +1589.4 +1587.8 +1586.3 +1584.7 +1585.8 +1587.7 +1589.6 +1590.5 +1591.3 +1592.1 +1592.9 +1593.7 +1594.6 +1595.5 +1598.5 +1601.4 +1603.5 +1605.5 +1607.6 +1609.7 +1611.8 +1613.9 +1616.0 +1618.0 +1620.0 +1620.0 +1620.0 +1621.1 +1622.2 +1623.3 +1623.8 +1624.4 +1624.9 +1625.5 +1626.0 +1626.5 +1627.1 +1627.6 +1627.1 +1626.5 +1626.0 +1626.0 +1627.5 +1629.5 +1631.1 +1632.6 +1634.2 +1635.7 +1637.3 +1638.8 +1640.4 +1641.9 +1643.5 +1643.5 +1645.1 +1647.2 +1649.3 +1651.4 +1653.5 +1655.5 +1657.6 +1659.7 +1662.1 +1665.2 +1668.3 +1669.3 +1671.2 +1673.1 +1675.0 +1676.9 +1678.8 +1680.7 +1682.6 +1684.3 +1685.2 +1686.1 +1687.0 +1687.0 +1687.0 +1687.0 +1688.0 +1689.0 +1690.0 +1691.0 +1692.0 +1693.0 +1694.6 +1696.3 +1697.9 +1699.5 +1701.2 +1701.8 +1703.4 +1704.9 +1706.5 +1708.0 +1709.5 +1710.5 +1711.4 +1712.3 +1713.2 +1714.1 +1715.0 +1715.0 +1715.0 +1715.0 +1715.0 +1715.0 +1715.0 +1715.0 +1715.0 +1715.0 +1715.0 +1715.0 +1715.0 +1715.0 +1715.0 +1715.0 +1715.0 +1715.0 +1715.0 +1731.8 +1748.6 +1765.5 +1782.3 +1799.1 +1815.9 +1832.7 +1849.5 +1866.4 +1883.2 +1900.0 +1900.0 +1900.0 +1900.0 +1900.0 +1900.0 +1900.0 +1900.0 +1900.0 +1900.0 +1900.0 +1900.0 +1900.0 +1900.0 +1900.0 +1900.0 +1900.0 +1900.0 +1900.0 +1900.0 +1892.4 +1884.7 +1877.1 +1869.5 +1861.8 +1854.6 +1847.5 +1840.3 +1833.1 +1825.9 +1818.7 +1819.2 +1819.6 +1820.1 +1820.5 +1821.0 +1821.0 +1821.0 +1821.0 +1821.0 +1821.0 +1821.0 +1821.0 +1821.0 +1821.0 +1821.0 +1821.0 +1821.0 +1821.0 +1821.0 +1821.0 +1821.0 +1821.0 +1821.0 +1822.5 +1822.5 +1822.5 +1822.5 +1822.5 +1822.5 +1822.5 +1822.5 +1822.5 +1822.1 +1821.6 +1819.6 +1819.2 +1818.7 +1818.3 +1817.8 +1818.6 +1819.5 +1819.5 +1819.5 +1819.9 +1820.4 +1820.8 +1821.3 +1821.7 +1822.2 +1822.6 +1821.5 +1820.5 +1820.2 +1819.9 +1819.6 +1819.4 +1819.1 +1818.8 +1820.3 +1820.0 +1819.7 +1819.7 +1820.0 +1820.3 +1820.5 +1820.8 +1821.1 +1821.4 +1821.6 +1820.2 +1820.5 +1820.7 +1821.8 +1822.6 +1822.2 +1821.7 +1821.3 +1820.8 +1820.4 +1819.9 +1819.5 +1819.5 +1819.5 +1818.6 +1817.8 +1818.3 +1818.7 +1819.2 +1819.6 +1820.1 +1820.5 +1821.0 +1822.7 +1824.5 +1826.6 +1828.2 +1830.4 +1832.5 +1834.7 +1836.9 +1839.1 +1841.3 +1843.5 +1843.9 +1844.4 +1844.4 +1845.0 +1845.0 +1847.3 +1849.5 +1851.8 +1854.1 +1856.4 +1858.6 +1860.9 +1863.2 +1865.5 +1867.7 +1870.0 +1870.0 +1870.0 +1870.0 +1870.0 +1873.3 +1876.5 +1878.4 +1880.2 +1882.0 +1883.8 +1885.6 +1887.5 +1889.3 +1891.1 +1892.9 +1891.5 +1891.9 +1892.2 +1892.5 +1892.7 +1893.0 +1893.3 +1893.5 +1893.8 +1894.1 +1894.4 +1894.6 +1893.0 +1891.9 +1890.8 +1890.5 +1890.3 +1890.0 +1889.7 +1889.5 +1889.2 +1888.9 +1888.6 +1887.5 +1887.4 +1887.3 +1886.4 +1885.5 +1884.5 +1883.6 +1882.1 +1880.5 +1879.0 +1877.5 +1876.8 +1876.2 +1875.5 +1874.9 +1874.3 +1873.6 +1873.0 +1873.0 +1873.0 +1873.0 +1874.5 +1875.9 +1877.4 +1878.2 +1879.0 +1879.8 +1880.6 +1881.5 +1882.3 +1883.1 +1883.9 +1883.3 +1882.4 +1881.5 +1881.2 +1880.9 +1880.6 +1880.4 +1880.1 +1879.8 +1879.8 +1879.8 +1879.8 +1880.1 +1880.4 +1880.6 +1880.9 +1881.2 +1881.5 +1881.7 +1881.7 +1881.5 +1881.2 +1880.9 +1880.6 +1880.5 +1880.5 +1880.4 +1880.3 +1880.2 +1880.1 +1880.3 +1880.4 +1880.5 +1880.5 +1880.6 +1880.5 +1880.5 +1880.4 +1880.2 +1880.0 +1879.5 +1879.1 +1878.7 +1878.4 +1878.0 +1877.6 +1877.3 +1876.9 +1876.5 +1876.3 +1876.0 +1876.0 +1876.0 +1876.0 +1876.0 +1876.0 +1876.0 +1876.0 +1876.0 +1876.0 +1876.0 +1876.4 +1876.7 +1877.1 +1877.2 +1877.3 +1877.4 +1877.5 +1877.5 +1877.6 +1877.7 +1877.8 +1877.5 +1877.5 +1877.5 +1877.8 +1878.1 +1878.4 +1878.6 +1878.9 +1879.2 +1879.8 +1880.5 +1881.1 +1881.5 +1882.7 +1884.0 +1885.3 +1886.5 +1887.8 +1889.1 +1889.9 +1890.4 +1890.8 +1891.3 +1891.7 +1891.3 +1890.8 +1890.4 +1889.9 +1891.5 +1893.0 +1895.0 +1897.0 +1900.5 +1904.1 +1907.6 +1911.2 +1914.7 +1918.3 +1921.8 +1923.4 +1924.9 +1926.5 +1929.6 +1931.3 +1932.9 +1934.5 +1936.2 +1937.8 +1939.5 +1941.1 +1942.7 +1944.4 +1947.5 +1949.1 +1950.6 +1952.2 +1953.6 +1955.1 +1956.5 +1958.0 +1959.5 +1961.1 +1962.6 +1962.6 +1963.9 +1965.2 +1966.5 +1967.8 +1969.2 +1970.5 +1971.9 +1973.2 +1974.5 +1975.7 +1977.9 +1978.8 +1979.7 +1980.6 +1981.5 +1982.5 +1983.4 +1984.3 +1985.0 +1985.7 +1986.5 +1986.3 +1986.1 +1986.8 +1987.5 +1988.3 +1989.0 +1989.4 +1989.7 +1990.3 +1990.8 +1991.4 +1991.9 +1992.5 +1992.1 +1991.5 +1990.8 +1990.2 +1989.9 +1989.6 +1989.4 +1989.1 +1988.8 +1989.2 +1989.5 +1989.9 +1990.5 +1991.2 +1991.8 +1992.5 +1993.1 +1995.9 +1998.7 +2001.5 +2003.7 +2005.9 +2008.1 +2010.3 +2012.5 +2014.6 +2016.8 +2019.4 +2021.7 +2024.5 +2027.2 +2029.9 +2032.6 +2035.4 +2038.1 +2040.8 +2043.5 +2046.3 +2048.5 +2048.8 +2048.8 +2048.8 +2048.8 +2048.8 +2048.8 +2048.8 +2048.8 +2048.8 +2048.8 +2048.5 +2048.3 +2047.9 +2050.4 +2052.8 +2055.3 +2057.7 +2060.2 +2062.6 +2065.1 +2067.5 +2070.4 +2073.2 +2076.0 +2075.9 +2075.8 +2075.7 +2075.6 +2075.5 +2075.5 +2075.4 +2075.3 +2075.2 +2078.2 +2081.2 +2084.3 +2087.4 +2090.5 +2093.5 +2096.6 +2099.7 +2102.8 +2105.9 +2109.0 +2109.0 +2109.0 +2109.0 +2109.0 +2109.0 +2111.4 +2113.2 +2115.5 +2117.9 +2120.3 +2122.6 +2125.0 +2127.4 +2129.7 +2132.1 +2134.5 +2134.5 +2135.0 +2135.0 +2136.2 +2137.4 +2138.5 +2139.7 +2140.9 +2142.1 +2143.3 +2144.5 +2145.6 +2146.8 +2147.5 +2147.1 +2146.6 +2147.5 +2148.5 +2149.4 +2150.3 +2151.2 +2152.1 +2153.0 +2153.9 +2155.3 +2156.6 +2158.0 +2158.0 +2158.0 +2158.0 +2158.0 +2159.5 +2161.1 +2162.6 +2164.2 +2165.7 +2167.3 +2168.8 +2170.0 +2171.2 +2172.4 +2173.9 +2173.9 +2173.5 +2175.5 +2177.5 +2179.5 +2181.5 +2183.5 +2185.9 +2188.3 +2190.6 +2192.6 +2197.1 +2201.9 +2204.4 +2206.8 +2209.3 +2212.3 +2215.3 +2218.3 +2221.3 +2224.3 +2227.3 +2227.8 +2228.4 +2228.9 +2229.5 +2230.0 +2230.0 +2230.0 +2230.0 +2230.0 +2230.0 +2230.0 +2229.5 +2228.9 +2230.7 +2232.5 +2234.4 +2236.2 +2238.0 +2239.8 +2241.6 +2243.5 +2246.1 +2249.3 +2252.5 +2253.3 +2254.1 +2254.9 +2255.7 +2256.9 +2258.1 +2258.9 +2259.7 +2259.7 +2259.7 +2259.7 +2261.6 +2263.5 +2265.5 +2267.4 +2268.9 +2270.5 +2272.4 +2274.3 +2276.2 +2278.1 +2280.0 +2280.0 +2280.2 +2280.4 +2280.5 +2280.7 +2281.9 +2283.1 +2284.3 +2285.5 +2286.6 +2287.8 +2289.0 +2290.0 +2291.0 +2292.2 +2293.4 +2293.5 +2293.7 +2293.9 +2294.1 +2295.1 +2297.3 +2299.5 +2301.6 +2303.8 +2305.8 +2307.8 +2309.8 +2311.8 +2314.6 +2317.5 +2319.5 +2320.3 +2321.1 +2321.9 +2322.7 +2323.5 +2325.5 +2327.5 +2329.5 +2330.7 +2331.9 +2333.1 +2334.3 +2336.9 +2339.5 +2342.2 +2344.8 +2346.3 +2347.7 +2346.7 +2345.7 +2344.7 +2343.7 +2342.7 +2340.3 +2337.5 +2338.1 +2338.7 +2339.4 +2340.0 +2343.1 +2346.2 +2349.3 +2351.5 +2354.6 +2357.7 +2361.2 +2361.2 +2361.2 +2361.2 +2361.2 +2361.2 +2361.2 +2362.5 +2364.7 +2366.1 +2367.5 +2368.8 +2370.2 +2371.5 +2372.9 +2374.3 +2375.6 +2377.0 +2377.0 +2377.0 +2377.0 +2377.0 +2377.0 +2376.5 +2375.9 +2377.2 +2378.5 +2379.7 +2381.0 +2382.3 +2383.5 +2384.8 +2386.1 +2387.4 +2389.5 +2391.5 +2391.8 +2392.1 +2392.4 +2392.6 +2392.9 +2393.2 +2393.5 +2393.7 +2394.0 +2394.0 +2394.0 +2394.0 +2394.0 +2394.0 +2393.5 +2393.8 +2394.1 +2394.4 +2394.6 +2394.8 +2395.0 +2395.2 +2395.4 +2396.3 +2397.2 +2398.4 +2398.8 +2399.3 +2399.7 +2400.2 +2400.7 +2402.0 +2403.3 +2404.5 +2405.1 +2405.6 +2406.4 +2407.1 +2407.8 +2408.5 +2409.3 +2409.3 +2408.5 +2407.8 +2407.1 +2408.5 +2410.0 +2411.5 +2412.9 +2414.4 +2415.8 +2417.3 +2419.5 +2421.6 +2423.4 +2425.1 +2424.6 +2424.2 +2409.6 +2395.1 +2380.5 +2366.0 +2351.5 +2336.9 +2322.4 +2308.3 +2294.2 +2280.1 +2266.0 +2266.0 +2266.0 +2266.0 +2266.0 +2266.0 +2266.0 +2266.0 +2266.0 +2266.0 +2266.0 +2266.0 +2266.0 +2266.0 +2266.0 +2266.0 +2266.0 +2266.0 +2266.0 +2266.0 +2266.0 +2266.0 +2272.5 +2279.1 +2288.3 +2297.5 +2306.6 +2315.8 +2325.0 +2334.2 +2343.4 +2352.5 +2361.1 +2363.1 +2365.1 +2364.5 +2363.8 +2363.2 +2362.5 +2361.9 +2352.7 +2343.5 +2334.4 +2325.8 +2317.3 +2308.7 +2300.2 +2291.6 +2274.4 +2257.1 +2239.8 +2231.1 +2231.1 +2231.1 +2231.1 +2231.1 +2231.1 +2231.1 +2231.1 +2239.8 +2239.8 +2239.8 +2239.8 +2231.1 +2222.4 +2213.6 +2213.6 +2204.9 +2196.2 +2187.5 +2178.7 +2178.7 +2178.7 +2178.7 +2178.7 +2178.7 +2187.5 +2187.5 +2196.2 +2204.9 +2213.6 +2230.9 +2248.2 +2265.5 +2282.7 +2300.0 +2317.3 +2325.8 +2335.0 +2344.2 +2353.4 +2362.5 +2363.2 +2363.8 +2364.5 +2365.1 +2363.1 +2361.1 +2359.1 +2349.9 +2340.7 +2331.5 +2322.4 +2313.2 +2304.0 +2294.8 +2285.6 +2279.1 +2272.5 +2266.0 +2266.0 +2266.0 +2266.0 +2266.0 +2266.0 +2266.0 +2266.0 +2266.0 +2266.0 +2266.0 +2266.0 +2266.0 +2266.0 +2266.0 +2266.0 +2266.0 +2266.0 +2266.0 +2266.0 +2266.0 +2266.0 +2280.1 +2294.2 +2308.3 +2322.4 +2336.5 +2351.0 +2365.5 +2380.1 +2394.6 +2409.2 +2423.7 +2424.2 +2424.6 +2425.1 +2425.5 +2426.0 +2426.0 +2426.0 +2426.0 +2426.0 +2424.8 +2423.6 +2422.2 +2420.7 +2419.3 +2417.8 +2416.4 +2414.9 +2413.5 +2412.0 +2410.5 +2410.3 +2410.0 +2409.3 +2408.5 +2407.8 +2407.1 +2406.4 +2405.6 +2405.1 +2403.9 +2402.7 +2401.5 +2400.4 +2399.9 +2399.5 +2399.0 +2398.5 +2397.4 +2396.2 +2394.8 +2394.5 +2394.3 +2394.0 +2393.7 +2393.5 +2393.2 +2392.9 +2392.6 +2393.1 +2393.5 +2394.0 +2394.0 +2394.0 +2394.0 +2393.7 +2393.5 +2393.2 +2392.9 +2392.6 +2392.4 +2392.1 +2391.8 +2389.7 +2387.6 +2386.1 +2384.8 +2383.5 +2382.3 +2381.0 +2379.7 +2378.5 +2377.2 +2375.9 +2376.5 +2377.0 +2377.0 +2377.0 +2377.0 +2377.0 +2377.0 +2375.6 +2374.3 +2372.9 +2371.5 +2370.2 +2368.8 +2367.5 +2366.1 +2364.7 +2363.4 +2362.0 +2362.0 +2362.0 +2362.0 +2361.4 +2358.3 +2355.2 +2352.1 +2349.0 +2345.9 +2342.8 +2339.7 +2336.6 +2333.1 +2329.5 +2326.6 +2326.2 +2325.7 +2325.3 +2324.8 +2323.6 +2322.5 +2321.3 +2320.1 +2319.4 +2318.6 +2317.9 +2317.2 +2315.6 +2314.1 +2312.5 +2312.7 +2312.9 +2313.1 +2313.3 +2313.5 +2313.6 +2312.6 +2311.6 +2311.5 +2311.3 +2311.1 +2309.9 +2308.7 +2307.0 +2305.3 +2303.5 +2301.8 +2301.3 +2300.7 +2300.2 +2299.6 +2298.6 +2297.6 +2296.6 +2295.2 +2293.7 +2292.3 +2290.8 +2289.4 +2287.9 +2286.5 +2284.8 +2283.6 +2282.5 +2281.3 +2281.1 +2280.9 +2280.7 +2280.5 +2280.4 +2278.3 +2276.2 +2274.3 +2272.4 +2270.5 +2268.5 +2266.6 +2264.7 +2262.8 +2260.1 +2257.4 +2256.5 +2255.7 +2254.9 +2254.1 +2253.3 +2252.5 +2251.6 +2250.8 +2248.2 +2246.4 +2244.5 +2242.7 +2240.9 +2239.1 +2237.3 +2235.5 +2233.6 +2231.8 +2229.5 +2228.9 +2228.4 +2227.8 +2227.3 +2226.7 +2226.2 +2223.2 +2220.2 +2217.2 +2214.2 +2211.7 +2209.3 +2206.9 +2204.5 +2202.1 +2197.6 +2193.2 +2191.2 +2189.2 +2187.2 +2185.2 +2183.2 +2181.2 +2179.1 +2177.1 +2173.5 +2171.9 +2170.4 +2168.8 +2167.3 +2165.7 +2164.2 +2162.6 +2161.1 +2159.5 +2158.0 +2156.6 +2155.7 +2154.8 +2153.9 +2153.0 +2152.1 +2151.2 +2150.3 +2149.4 +2148.0 +2147.1 +2147.5 +2147.5 +2147.5 +2146.4 +2145.2 +2144.0 +2142.8 +2141.6 +2140.5 +2139.7 +2138.5 +2137.4 +2136.2 +2135.0 +2135.0 +2135.0 +2135.0 +2135.0 +2135.0 +2132.6 +2130.3 +2127.9 +2125.5 +2122.7 +2119.9 +2117.1 +2114.7 +2112.4 +2110.0 +2107.6 +2107.6 +2107.6 +2107.6 +2107.6 +2108.1 +2108.5 +2105.9 +2102.8 +2099.7 +2096.6 +2093.5 +2090.5 +2087.4 +2084.4 +2081.4 +2078.4 +2075.4 +2075.5 +2075.5 +2075.6 +2075.7 +2075.8 +2075.9 +2076.0 +2076.0 +2076.0 +2076.0 +2076.0 +2073.2 +2070.4 +2067.5 +2065.1 +2062.6 +2060.2 +2057.7 +2055.3 +2052.8 +2050.4 +2047.9 +2048.3 +2048.6 +2049.0 +2049.0 +2049.0 +2049.0 +2049.0 +2046.6 +2043.9 +2041.2 +2038.5 +2035.7 +2033.0 +2030.3 +2027.5 +2024.8 +2022.1 +2019.4 +2019.0 +2019.0 +2019.0 +2019.0 +2019.0 +2018.1 +2017.2 +2016.3 +2015.4 +2014.5 +2013.5 +2012.6 +2011.7 +2010.4 +2009.0 +2007.6 +2007.2 +2006.7 +2006.3 +2005.8 +2005.4 +2004.5 +2003.7 +2002.9 +2002.5 +2002.2 +2001.8 +2001.0 +2000.2 +1999.4 +1998.5 +1997.7 +1997.0 +1996.3 +1995.5 +1994.8 +1994.1 +1993.4 +1993.1 +1992.2 +1991.3 +1990.4 +1989.5 +1988.8 +1988.2 +1987.5 +1986.9 +1986.3 +1985.6 +1985.0 +1984.3 +1983.5 +1982.8 +1982.1 +1981.4 +1980.6 +1980.0 +1979.4 +1978.7 +1978.1 +1977.5 +1977.5 +1977.6 +1976.4 +1975.1 +1973.8 +1972.5 +1971.2 +1969.8 +1968.5 +1967.1 +1965.7 +1964.4 +1961.5 +1959.9 +1958.4 +1956.8 +1955.3 +1953.7 +1952.2 +1950.6 +1949.1 +1947.5 +1944.4 +1942.7 +1941.1 +1939.5 +1937.8 +1936.2 +1934.5 +1932.9 +1931.3 +1929.6 +1926.5 +1924.9 +1923.4 +1921.8 +1920.3 +1920.3 +1917.2 +1914.1 +1910.5 +1907.0 +1903.5 +1901.5 +1899.5 +1897.5 +1895.5 +1893.5 +1889.9 +1889.5 +1889.5 +1889.9 +1890.4 +1890.8 +1891.3 +1891.7 +1891.3 +1890.8 +1890.4 +1889.9 +1889.5 +1888.5 +1887.6 +1886.7 +1885.5 +1884.2 +1882.9 +1882.7 +1882.5 +1882.4 +1882.8 +1883.3 +1883.7 +1884.2 +1884.6 +1884.8 +1884.8 +1884.8 +1884.6 +1884.5 +1884.3 +1883.5 +1882.6 +1881.8 +1880.7 +1879.6 +1879.2 +1878.9 +1878.6 +1878.4 +1878.1 +1877.8 +1877.8 +1877.8 +1877.8 +1878.1 +1878.0 +1877.9 +1877.8 +1877.7 +1877.6 +1877.5 +1877.5 +1877.1 +1876.7 +1876.4 +1876.0 +1876.0 +1876.0 +1876.0 +1876.0 +1876.0 +1876.0 +1876.0 +1876.0 +1876.0 +1876.0 +1876.0 +1876.0 +1876.2 +1876.5 +1876.9 +1877.3 +1877.6 +1878.0 +1878.4 +1878.7 +1879.1 +1879.5 +1879.8 +1880.0 +1879.9 +1879.8 +1879.7 +1879.6 +1879.5 +1879.5 +1879.4 +1879.3 +1879.2 +1879.1 +1879.0 +1879.3 +1879.5 +1879.8 +1880.1 +1880.4 +1880.6 +1880.2 +1879.7 +1879.3 +1878.8 +1878.8 +1878.5 +1878.3 +1878.0 +1877.7 +1877.5 +1877.2 +1877.6 +1878.1 +1878.8 +1879.5 +1879.8 +1880.1 +1880.4 +1880.6 +1880.9 +1881.3 +1880.7 +1880.2 +1879.6 +1878.8 +1878.0 +1877.2 +1876.4 +1875.5 +1874.7 +1873.9 +1873.0 +1873.0 +1873.0 +1873.0 +1873.0 +1873.0 +1873.6 +1874.3 +1874.9 +1875.5 +1876.2 +1876.8 +1877.5 +1878.1 +1878.7 +1880.3 +1881.8 +1882.7 +1883.6 +1884.5 +1885.5 +1885.5 +1885.6 +1885.7 +1885.8 +1885.9 +1886.2 +1886.5 +1886.7 +1887.0 +1887.3 +1887.5 +1888.6 +1889.7 +1890.8 +1891.9 +1892.7 +1892.5 +1892.2 +1891.9 +1891.6 +1891.4 +1891.1 +1890.8 +1890.5 +1890.3 +1890.0 +1890.0 +1891.5 +1889.6 +1887.8 +1886.0 +1884.2 +1882.4 +1880.5 +1878.7 +1876.9 +1875.1 +1873.3 +1870.0 +1870.0 +1870.0 +1870.0 +1870.0 +1870.0 +1867.8 +1865.6 +1863.4 +1861.1 +1858.8 +1856.5 +1854.3 +1852.0 +1849.7 +1847.5 +1845.2 +1845.1 +1845.0 +1845.0 +1845.0 +1845.0 +1844.5 +1844.1 +1843.6 +1841.5 +1839.3 +1837.1 +1834.9 +1832.7 +1830.5 +1828.4 +1826.2 +1824.5 +1822.7 +1821.0 +1821.0 +1821.0 +1820.5 +1820.1 +1819.6 +1819.2 +1818.7 +1819.5 +1820.4 +1821.2 +1822.0 +1822.0 +1822.0 +1822.5 +1822.9 +1823.4 +1823.8 +1824.3 +1823.5 +1822.6 +1821.8 +1820.7 +1822.2 +1823.6 +1825.1 +1826.5 +1828.0 +1829.5 +1830.9 +1832.4 +1833.8 +1835.3 +1837.0 +1837.0 +1837.0 +1837.8 +1837.6 +1837.5 +1837.3 +1837.1 +1836.9 +1836.7 +1836.5 +1836.4 +1836.2 +1836.0 +1835.0 +1833.0 +1833.0 +1833.0 +1833.0 +1833.0 +1833.0 +1833.0 +1833.0 +1833.0 +1833.0 +1832.4 +1833.7 +1833.1 +1832.5 +1831.8 +1831.2 +1830.5 +1829.9 +1829.3 +1828.6 +1828.0 +1823.9 +1828.8 +1833.7 +1838.6 +1843.5 +1848.5 +1853.4 +1858.3 +1862.7 +1867.2 +1871.6 +1880.2 +1879.7 +1879.3 +1878.8 +1878.4 +1876.8 +1875.3 +1873.7 +1872.6 +1871.5 +1870.5 +1869.4 +1868.3 +1867.2 +1867.2 +1867.2 +1868.3 +1869.4 +1863.4 +1857.4 +1851.4 +1845.4 +1839.4 +1833.2 +1827.0 +1819.7 +1812.5 +1805.2 +1797.9 +1797.7 +1797.0 +1796.3 +1795.5 +1794.8 +1794.3 +1793.7 +1793.2 +1792.6 +1792.1 +1791.5 +1791.0 +1791.0 +1791.0 +1791.0 +1791.0 +1791.0 +1791.0 +1791.5 +1792.1 +1792.6 +1793.2 +1793.7 +1794.3 +1794.8 +1789.5 +1790.0 +1790.5 +1785.2 +1779.3 +1773.2 +1767.1 +1766.5 +1766.0 +1765.5 +1764.9 +1770.3 +1769.7 +1769.2 +1774.5 +1780.2 +1786.0 +1791.8 +1792.1 +1792.4 +1792.6 +1786.8 +1787.1 +1782.5 +1777.8 +1773.2 +1768.3 +1763.4 +1758.5 +1753.5 +1748.6 +1743.7 +1746.0 +1742.2 +1743.3 +1744.4 +1745.5 +1746.5 +1747.6 +1748.7 +1749.8 +1752.1 +1754.4 +1750.4 +1746.4 +1742.4 +1738.4 +1734.4 +1730.4 +1726.4 +1722.4 +1718.4 +1713.2 +1708.0 +1708.0 +1707.7 +1707.5 +1707.2 +1706.9 +1706.9 +1706.9 +1706.9 +1706.9 +1706.9 +1706.9 +1706.9 +1707.2 +1707.5 +1708.7 +1706.2 +1703.4 +1704.4 +1705.4 +1702.5 +1699.7 +1696.9 +1694.1 +1691.3 +1688.5 +1683.4 +1683.4 +1683.4 +1679.5 +1675.7 +1675.7 +1675.7 +1675.7 +1675.7 +1674.5 +1673.2 +1673.2 +1671.9 +1670.6 +1669.4 +1668.1 +1666.8 +1665.5 +1664.3 +1649.5 +1647.1 +1644.7 +1646.0 +1647.3 +1648.5 +1649.8 +1651.1 +1652.4 +1653.6 +1654.9 +1669.7 +1669.7 +1669.7 +1666.1 +1662.5 +1658.8 +1655.2 +1651.5 +1647.9 +1644.3 +1640.6 +1637.0 +1644.6 +1644.6 +1644.6 +1644.6 +1644.6 +1644.6 +1644.6 +1644.6 +1652.3 +1659.9 +1655.7 +1673.9 +1699.7 +1725.5 +1751.4 +1751.4 +1777.2 +1803.0 +1828.8 +1847.0 +1835.2 +1835.2 +1835.2 +1835.2 +1805.2 +1775.2 +1771.0 +1741.0 +1708.2 +1675.4 +1642.5 +1639.7 +1636.9 +1604.1 +1571.3 +1568.5 +1565.6 +1562.8 +1560.0 +1557.9 +1555.8 +1553.7 +1551.6 +1549.5 +1547.5 +1548.5 +1549.5 +1550.5 +1551.5 +1552.5 +1555.5 +1556.7 +1557.9 +1559.1 +1560.3 +1561.5 +1559.5 +1553.6 +1547.7 +1541.8 +1538.7 +1535.6 +1534.5 +1533.3 +1532.1 +1530.9 +1529.7 +1528.5 +1531.4 +1530.6 +1529.9 +1526.4 +1522.8 +1519.3 +1518.0 +1516.7 +1513.2 +1509.6 +1506.1 +1502.5 +1502.5 +1502.5 +1502.5 +1502.5 +1502.5 +1500.3 +1498.0 +1498.0 +1494.1 +1490.2 +1486.3 +1482.4 +1481.5 +1480.5 +1479.6 +1478.7 +1477.8 +1473.9 +1470.0 +1470.0 +1470.0 +1470.0 +1470.0 +1467.0 +1464.0 +1461.0 +1455.1 +1449.2 +1446.3 +1446.3 +1446.3 +1446.3 +1446.3 +1446.3 +1446.3 +1446.3 +1446.3 +1449.2 +1452.1 +1452.2 +1449.4 +1446.5 +1443.7 +1440.9 +1440.9 +1440.9 +1440.9 +1440.9 +1440.9 +1440.9 +1440.8 +1440.7 +1440.6 +1440.5 +1440.5 +1437.5 +1434.6 +1430.1 +1427.3 +1424.5 +1421.6 +1421.7 +1421.8 +1421.9 +1422.0 +1422.1 +1422.2 +1422.3 +1424.0 +1421.6 +1421.6 +1421.6 +1421.6 +1421.6 +1421.6 +1421.6 +1419.9 +1418.2 +1416.5 +1414.7 +1415.4 +1413.6 +1411.9 +1410.2 +1407.1 +1404.0 +1400.9 +1399.5 +1398.2 +1396.8 +1395.5 +1394.1 +1392.7 +1391.4 +1391.7 +1393.5 +1395.2 +1396.9 +1398.6 +1400.4 +1402.1 +1403.8 +1405.5 +1407.3 +1409.0 +1409.0 +1409.0 +1409.0 +1409.0 +1409.0 +1409.0 +1409.0 +1409.0 +1409.0 +1409.0 +1409.0 +1409.0 +1409.0 +1409.0 +1409.0 +1409.0 +1409.0 +1409.0 +1409.0 +1409.0 +1409.0 +1409.0 +1409.0 +1409.0 +1409.0 +1399.1 +1389.2 +1379.3 +1369.4 +1359.5 +1349.5 +1349.5 +1349.5 +1349.5 +1349.5 +1349.5 +1359.5 +1369.4 +1379.3 +1389.2 +1399.1 +1409.0 +1409.0 +1409.0 +1409.0 +1409.0 +1409.0 +1409.0 +1409.0 +1409.0 +1409.0 +1409.0 +1409.0 +1400.2 +1391.4 +1382.5 +1373.7 +1364.9 +1356.1 +1347.3 +1338.5 +1329.6 +1319.0 +1308.4 +1308.4 +1305.9 +1303.5 +1301.0 +1298.5 +1296.1 +1293.6 +1291.2 +1288.7 +1288.1 +1287.5 +1283.6 +1282.3 +1280.9 +1279.5 +1278.2 +1276.8 +1275.5 +1274.1 +1272.7 +1270.0 +1267.3 +1265.9 +1264.5 +1263.2 +1261.8 +1260.5 +1259.1 +1257.7 +1256.4 +1254.4 +1253.7 +1253.1 +1252.5 +1251.8 +1251.2 +1250.5 +1249.9 +1249.3 +1248.6 +1248.1 +1248.2 +1248.3 +1248.4 +1248.5 +1248.5 +1248.6 +1248.7 +1248.8 +1248.9 +1249.0 +1248.0 +1247.0 +1246.0 +1245.0 +1244.0 +1243.0 +1242.0 +1241.0 +1240.0 +1239.0 +1237.9 +1237.8 +1237.7 +1237.6 +1237.5 +1237.5 +1237.4 +1237.3 +1237.2 +1237.1 +1237.0 +1237.0 +1237.0 +1237.0 +1237.0 +1237.0 +1238.4 +1239.7 +1241.1 +1242.5 +1243.8 +1245.2 +1246.5 +1248.2 +1249.8 +1251.5 +1253.1 +1253.4 +1253.6 +1253.9 +1254.2 +1254.3 +1254.4 +1254.5 +1254.3 +1254.1 +1253.9 +1253.7 +1253.5 +1253.4 +1253.2 +1252.8 +1252.6 +1252.5 +1252.3 +1252.1 +1251.9 +1251.7 +1251.5 +1251.4 +1251.2 +1250.6 +1250.3 +1249.9 +1249.5 +1249.2 +1248.8 +1248.5 +1248.1 +1248.0 +1247.9 +1248.0 +1248.5 +1248.9 +1249.4 +1249.8 +1250.3 +1250.7 +1251.2 +1251.6 +1251.8 +1251.6 +1251.3 +1250.9 +1250.5 +1250.2 +1249.8 +1249.5 +1249.1 +1248.5 +1247.8 +1246.8 +1246.2 +1245.5 +1244.9 +1244.3 +1243.6 +1243.0 +1242.7 +1242.5 +1242.5 +1242.5 +1242.8 +1243.2 +1243.5 +1244.1 +1244.6 +1245.2 +1245.7 +1245.9 +1246.1 +1246.3 +1246.5 +1246.6 +1246.8 +1246.5 +1246.1 +1245.6 +1245.2 +1244.7 +1244.3 +1243.8 +1243.4 +1242.9 +1242.5 +1242.0 +1242.2 +1242.4 +1242.5 +1242.7 +1242.9 +1243.1 +1243.3 +1243.5 +1243.6 +1243.7 +1243.8 +1243.7 +1243.9 +1244.1 +1244.3 +1244.3 +1244.3 +1244.4 +1244.4 +1244.5 + + + diff --git a/demo/images/RK_gpx _2015-06-15_0739.gpx b/demo/images/RK_gpx _2015-06-15_0739.gpx new file mode 100644 index 0000000..05e4710 --- /dev/null +++ b/demo/images/RK_gpx _2015-06-15_0739.gpx @@ -0,0 +1,550 @@ + + + + + + +2494.0 +2495.1 +2496.0 +2496.1 +2496.2 +2496.3 +2496.5 +2496.8 +2497.1 +2497.4 +2497.6 +2497.9 +2497.5 +2496.8 +2496.6 +2496.5 +2496.3 +2496.1 +2495.9 +2495.7 +2495.5 +2495.4 +2495.2 +2495.0 +2495.0 +2493.3 +2491.8 +2490.4 +2488.9 +2487.5 +2486.0 +2486.2 +2486.4 +2486.8 +2487.3 +2487.7 +2489.9 +2491.8 +2493.7 +2495.6 +2497.5 +2499.5 +2499.6 +2499.8 +2499.7 +2499.6 +2499.5 +2499.5 +2499.4 +2499.3 +2499.0 +2498.7 +2498.5 +2498.5 +2498.5 +2498.5 +2498.5 +2498.5 +2498.5 +2498.5 +2498.5 +2498.7 +2499.0 +2499.3 +2499.4 +2499.5 +2499.5 +2499.6 +2499.7 +2499.8 +2499.9 +2500.0 +2500.0 +2499.8 +2499.6 +2499.5 +2499.3 +2499.1 +2498.9 +2498.7 +2498.5 +2498.4 +2497.1 +2495.8 +2494.7 +2493.6 +2496.3 +2498.9 +2501.5 +2504.2 +2506.8 +2509.5 +2512.1 +2515.2 +2518.3 +2521.4 +2524.5 +2523.8 +2523.2 +2522.5 +2521.9 +2521.3 +2520.6 +2520.0 +2518.8 +2517.6 +2516.5 +2515.3 +2516.2 +2517.1 +2518.0 +2518.9 +2519.8 +2520.7 +2521.6 +2523.7 +2525.8 +2527.9 +2529.8 +2529.6 +2529.5 +2529.3 +2529.1 +2528.9 +2528.7 +2528.5 +2528.4 +2528.2 +2528.7 +2529.5 +2530.2 +2530.9 +2531.6 +2532.4 +2533.1 +2533.8 +2534.5 +2535.3 +2534.9 +2533.8 +2532.7 +2531.6 +2530.5 +2529.5 +2529.5 +2529.6 +2529.7 +2529.8 +2529.9 +2531.1 +2532.3 +2533.5 +2535.1 +2536.7 +2538.4 +2538.8 +2539.3 +2539.7 +2540.2 +2540.6 +2541.1 +2541.5 +2542.0 +2542.0 +2543.2 +2543.2 +2543.2 +2543.2 +2543.2 +2543.2 +2543.2 +2543.2 +2544.7 +2546.3 +2547.8 +2548.2 +2549.7 +2551.3 +2552.8 +2554.4 +2555.9 +2555.7 +2555.5 +2553.8 +2553.9 +2554.0 +2554.1 +2554.2 +2554.3 +2554.4 +2554.5 +2554.5 +2556.4 +2558.2 +2560.0 +2559.3 +2557.8 +2556.4 +2554.9 +2553.5 +2552.0 +2550.5 +2549.1 +2547.6 +2546.2 +2545.2 +2544.9 +2545.4 +2545.8 +2546.3 +2546.7 +2547.2 +2547.6 +2548.1 +2546.5 +2545.0 +2543.0 +2541.0 +2539.0 +2537.0 +2535.0 +2533.0 +2531.0 +2529.0 +2527.0 +2525.2 +2523.4 +2521.5 +2519.7 +2517.9 +2517.3 +2516.6 +2516.0 +2515.4 +2512.5 +2511.9 +2511.9 +2511.9 +2511.9 +2511.9 +2510.9 +2509.7 +2508.5 +2507.4 +2506.2 +2506.2 +2504.0 +2503.0 +2502.0 +2501.0 +2500.0 +2500.0 +2499.0 +2498.0 +2497.0 +2496.0 +2496.0 +2496.0 +2496.0 +2496.0 +2496.0 +2496.0 +2496.0 +2496.0 +2496.0 +2496.0 +2496.0 +2496.0 +2496.2 +2496.4 +2496.5 +2496.7 +2496.9 +2497.1 +2497.3 +2497.5 +2497.6 +2497.8 +2498.0 +2498.0 +2498.0 +2498.0 +2499.4 +2500.7 +2502.1 +2502.1 +2502.1 +2502.1 +2502.1 +2502.1 +2502.1 +2502.1 +2502.1 +2500.7 +2499.4 +2498.0 +2498.0 +2498.0 +2497.8 +2497.6 +2497.5 +2497.3 +2497.1 +2496.9 +2496.7 +2496.5 +2496.4 +2496.2 +2496.0 +2496.0 +2496.0 +2496.0 +2496.0 +2496.0 +2496.0 +2496.0 +2496.0 +2496.0 +2498.2 +2500.4 +2502.5 +2503.5 +2504.5 +2505.5 +2506.5 +2507.5 +2508.5 +2511.4 +2514.2 +2514.8 +2515.5 +2516.1 +2517.9 +2519.7 +2521.5 +2523.4 +2525.2 +2527.0 +2529.0 +2531.0 +2533.0 +2535.0 +2537.0 +2539.0 +2541.0 +2543.0 +2544.5 +2546.1 +2547.6 +2547.2 +2546.7 +2546.3 +2545.8 +2545.4 +2544.9 +2545.2 +2545.5 +2546.2 +2547.6 +2549.1 +2550.5 +2552.0 +2553.5 +2554.9 +2556.4 +2557.8 +2558.5 +2559.3 +2560.0 +2558.2 +2558.1 +2558.0 +2557.9 +2557.8 +2557.7 +2557.6 +2557.5 +2557.5 +2557.4 +2557.3 +2559.0 +2557.5 +2555.9 +2554.4 +2552.8 +2551.3 +2550.9 +2550.5 +2550.2 +2548.6 +2547.1 +2545.5 +2545.5 +2545.5 +2545.5 +2545.5 +2545.5 +2544.4 +2542.7 +2541.1 +2540.6 +2540.2 +2539.7 +2539.3 +2538.8 +2537.2 +2535.5 +2533.9 +2532.3 +2531.1 +2529.9 +2528.7 +2527.5 +2526.4 +2525.2 +2524.0 +2524.0 +2525.1 +2526.2 +2527.3 +2528.4 +2529.5 +2530.5 +2531.6 +2532.7 +2533.8 +2534.2 +2534.5 +2533.8 +2533.1 +2532.4 +2531.6 +2530.9 +2530.2 +2529.5 +2528.7 +2528.2 +2528.4 +2528.5 +2528.7 +2528.9 +2529.1 +2529.3 +2529.5 +2529.6 +2527.7 +2525.8 +2523.7 +2521.6 +2520.7 +2519.8 +2518.9 +2518.0 +2517.1 +2516.2 +2515.3 +2516.5 +2517.6 +2518.8 +2520.0 +2520.6 +2521.3 +2521.9 +2522.5 +2523.2 +2523.8 +2520.7 +2517.6 +2514.5 +2511.5 +2508.4 +2505.7 +2503.1 +2500.5 +2497.8 +2495.2 +2492.5 +2493.6 +2494.7 +2495.8 +2497.1 +2498.4 +2498.5 +2498.7 +2498.9 +2498.8 +2498.7 +2498.6 +2498.5 +2498.5 +2498.4 +2498.1 +2497.8 +2497.5 +2497.3 +2496.8 +2496.6 +2496.5 +2496.3 +2496.1 +2495.9 +2495.7 +2495.5 +2495.4 +2495.4 +2495.4 +2495.5 +2495.7 +2495.9 +2496.1 +2496.3 +2496.5 +2496.6 +2497.3 +2497.9 +2498.4 +2498.1 +2497.8 +2497.5 +2497.3 +2497.0 +2496.7 +2496.5 +2496.2 +2495.5 +2494.9 +2494.3 +2494.4 +2494.5 +2494.5 +2494.6 +2494.7 +2494.8 +2494.9 +2495.0 + + + diff --git a/frontend/app/app.module.ts b/frontend/app/app.module.ts index 70b2e5b..9cd5e68 100644 --- a/frontend/app/app.module.ts +++ b/frontend/app/app.module.ts @@ -75,6 +75,7 @@ import {RandomPhotoSettingsComponent} from './settings/random-photo/random-photo import {FixOrientationPipe} from './gallery/FixOrientationPipe'; import {VideoSettingsComponent} from './settings/video/video.settings.component'; import {DurationPipe} from './pipes/DurationPipe'; +import {MapService} from './gallery/map/map.service'; @Injectable() export class GoogleMapsConfig { @@ -183,6 +184,7 @@ export function translationsFactory(locale: string) { UserService, GalleryCacheService, GalleryService, + MapService, AuthenticationService, ThumbnailLoaderService, ThumbnailManagerService, diff --git a/frontend/app/gallery/gallery.component.html b/frontend/app/gallery/gallery.component.html index 01353dd..820fa7b 100644 --- a/frontend/app/gallery/gallery.component.html +++ b/frontend/app/gallery/gallery.component.html @@ -35,7 +35,8 @@ [directory]="directory"> + [photos]="_galleryService.content.value.directory.media" + [metaFiles]="_galleryService.content.value.directory.metaFile"> @@ -60,7 +61,8 @@ + [photos]="_galleryService.content.value.searchResult.media" + [metaFiles]="_galleryService.content.value.searchResult.metaFile">
+ + + + + + ; + @Input() photos: PhotoDTO[]; + @Input() gpxFiles: FileDTO[]; private startPosition = null; public lightboxDimension: Dimension = {top: 0, left: 0, width: 0, height: 0}; public mapDimension: Dimension = {top: 0, left: 0, width: 0, height: 0}; @@ -26,6 +32,7 @@ export class GalleryMapLightboxComponent implements OnChanges, AfterViewInit { public controllersVisible = false; public opacity = 1.0; mapPhotos: MapPhoto[] = []; + paths: MapPath[][] = []; mapCenter = {latitude: 0, longitude: 0}; @ViewChild('root') elementRef: ElementRef; @@ -35,6 +42,7 @@ export class GalleryMapLightboxComponent implements OnChanges, AfterViewInit { constructor(public fullScreenService: FullScreenService, private thumbnailService: ThumbnailManagerService, + private mapService: MapService, private mapsAPILoader: MapsAPILoader) { } @@ -139,6 +147,22 @@ export class GalleryMapLightboxComponent implements OnChanges, AfterViewInit { return obj; }); + if (this.gpxFiles) { + this.loadGPXFiles().catch(console.error); + } + + } + + private async loadGPXFiles(): Promise { + this.paths = []; + for (let i = 0; i < this.gpxFiles.length; i++) { + const file = this.gpxFiles[i]; + const path = await this.mapService.getMapPath(file); + if (file !== this.gpxFiles[i]) { // check race condition + return; + } + this.paths.push(path); + } } diff --git a/frontend/app/gallery/map/map.gallery.component.html b/frontend/app/gallery/map/map.gallery.component.html index d86f04e..25ad157 100644 --- a/frontend/app/gallery/map/map.gallery.component.html +++ b/frontend/app/gallery/map/map.gallery.component.html @@ -1,5 +1,5 @@ - +
; + @Input() photos: PhotoDTO[]; + @Input() metaFiles: FileDTO[]; @ViewChild(GalleryMapLightboxComponent) mapLightbox: GalleryMapLightboxComponent; mapPhotos: Array<{ latitude: number, longitude: number }> = []; diff --git a/frontend/app/gallery/map/map.service.ts b/frontend/app/gallery/map/map.service.ts new file mode 100644 index 0000000..8ba6f4a --- /dev/null +++ b/frontend/app/gallery/map/map.service.ts @@ -0,0 +1,34 @@ +import {Injectable} from '@angular/core'; +import {NetworkService} from '../../model/network/network.service'; +import {FileDTO} from '../../../../common/entities/FileDTO'; +import {Utils} from '../../../../common/Utils'; + +@Injectable() +export class MapService { + + + constructor(private networkService: NetworkService) { + } + + + public async getMapPath(file: FileDTO): Promise { + const filePath = Utils.concatUrls(file.directory.path, file.directory.name, file.name); + const gpx = await this.networkService.getXML('/gallery/content/' + filePath); + const elements = gpx.getElementsByTagName('trkpt'); + const points: MapPath[] = []; + for (let i = 0; i < elements.length; i++) { + points.push({ + latitude: parseFloat(elements[i].getAttribute('lat')), + longitude: parseFloat(elements[i].getAttribute('lon')) + }); + } + return points; + } + +} + + +export interface MapPath { + latitude: number; + longitude: number; +} diff --git a/frontend/app/model/network/network.service.ts b/frontend/app/model/network/network.service.ts index b2ef98c..9ffdd34 100644 --- a/frontend/app/model/network/network.service.ts +++ b/frontend/app/model/network/network.service.ts @@ -1,5 +1,5 @@ import {Injectable} from '@angular/core'; -import {HttpClient} from '@angular/common/http'; +import {HttpClient, HttpHeaders} from '@angular/common/http'; import {Message} from '../../../../common/entities/Message'; import {SlimLoadingBarService} from 'ng2-slim-loading-bar'; import 'rxjs/Rx'; @@ -33,6 +33,30 @@ export class NetworkService { return url; } + public getXML(url: string): Promise { + + this.slimLoadingBarService.visible = true; + this.slimLoadingBarService.start(() => { + this.slimLoadingBarService.visible = false; + }); + + const process = (res: string): Document => { + this.slimLoadingBarService.complete(); + const parser = new DOMParser(); + return parser.parseFromString(res, 'text/xml'); + }; + + const err = (error) => { + this.slimLoadingBarService.complete(); + return this.handleError(error); + }; + + return this._http.get(this._apiBaseUrl + url, {responseType: 'text'}) + .toPromise() + .then(process) + .catch(err); + } + public postJson(url: string, data: any = {}): Promise { return this.callJson('post', url, data); } diff --git a/test/backend/unit/model/sql/GalleryManager.ts b/test/backend/unit/model/sql/GalleryManager.ts index 050bbea..ed41e40 100644 --- a/test/backend/unit/model/sql/GalleryManager.ts +++ b/test/backend/unit/model/sql/GalleryManager.ts @@ -11,6 +11,7 @@ import {Connection} from 'typeorm'; import {DirectoryEntity} from '../../../../../backend/model/sql/enitites/DirectoryEntity'; import {Utils} from '../../../../../common/Utils'; import {MediaDTO} from '../../../../../common/entities/MediaDTO'; +import {FileDTO} from '../../../../../common/entities/FileDTO'; class GalleryManagerTest extends GalleryManager { @@ -71,9 +72,12 @@ describe('GalleryManager', () => { delete dir.id; dir.media.forEach((media: MediaDTO) => { delete media.id; - }); - + if (dir.metaFile) { + dir.metaFile.forEach((file: FileDTO) => { + delete file.id; + }); + } if (dir.directories) { dir.directories.forEach((directory: DirectoryDTO) => { removeIds(directory); @@ -87,6 +91,7 @@ describe('GalleryManager', () => { const parent = TestHelper.getRandomizedDirectoryEntry(); const p1 = TestHelper.getRandomizedPhotoEntry(parent, 'Photo1'); const p2 = TestHelper.getRandomizedPhotoEntry(parent, 'Photo2'); + const gpx = TestHelper.getRandomizedGPXEntry(parent, 'GPX1'); const subDir = TestHelper.getRandomizedDirectoryEntry(parent, 'subDir'); const sp1 = TestHelper.getRandomizedPhotoEntry(subDir, 'subPhoto1'); const sp2 = TestHelper.getRandomizedPhotoEntry(subDir, 'subPhoto2'); @@ -103,6 +108,7 @@ describe('GalleryManager', () => { removeIds(selected); subDir.isPartial = true; delete subDir.directories; + delete subDir.metaFile; expect(Utils.clone(selected)).to.deep.equal(Utils.clone(parent)); }); diff --git a/test/backend/unit/model/sql/SearchManager.ts b/test/backend/unit/model/sql/SearchManager.ts index 4be5efb..2e55739 100644 --- a/test/backend/unit/model/sql/SearchManager.ts +++ b/test/backend/unit/model/sql/SearchManager.ts @@ -15,8 +15,6 @@ import {SearchManager} from '../../../../../backend/model/sql/SearchManager'; import {AutoCompleteItem, SearchTypes} from '../../../../../common/entities/AutoCompleteItem'; import {SearchResultDTO} from '../../../../../common/entities/SearchResultDTO'; import {DirectoryEntity} from '../../../../../backend/model/sql/enitites/DirectoryEntity'; -import {MediaDimensionEntity} from '../../../../../backend/model/sql/enitites/MediaEntity'; -import {OrientationTypes} from 'ts-exif-parser'; import {Utils} from '../../../../../common/Utils'; import {TestHelper} from './TestHelper'; import {VideoEntity} from '../../../../../backend/model/sql/enitites/VideoEntity'; @@ -116,7 +114,8 @@ describe('SearchManager', () => { searchText: 'sw', searchType: null, directories: [], - media: [p, p2,v], + media: [p, p2, v], + metaFile: [], resultOverflow: false })); @@ -125,6 +124,7 @@ describe('SearchManager', () => { searchType: SearchTypes.position, directories: [], media: [p], + metaFile: [], resultOverflow: false })); @@ -133,6 +133,7 @@ describe('SearchManager', () => { searchType: SearchTypes.keyword, directories: [], media: [p2], + metaFile: [], resultOverflow: false })); @@ -141,6 +142,7 @@ describe('SearchManager', () => { searchType: SearchTypes.keyword, directories: [], media: [p2], + metaFile: [], resultOverflow: false })); @@ -149,6 +151,7 @@ describe('SearchManager', () => { searchType: SearchTypes.keyword, directories: [dir], media: [p, p2], + metaFile: [], resultOverflow: false })); }); @@ -160,7 +163,8 @@ describe('SearchManager', () => { expect(Utils.clone(await sm.instantSearch('sw'))).to.deep.equal(Utils.clone({ searchText: 'sw', directories: [], - media: [p, p2,v], + media: [p, p2, v], + metaFile: [], resultOverflow: false })); @@ -168,6 +172,7 @@ describe('SearchManager', () => { searchText: 'Tatooine', directories: [], media: [p], + metaFile: [], resultOverflow: false })); @@ -175,6 +180,7 @@ describe('SearchManager', () => { searchText: 'ortm', directories: [], media: [p2], + metaFile: [], resultOverflow: false })); @@ -182,6 +188,7 @@ describe('SearchManager', () => { searchText: 'ortm', directories: [], media: [p2], + metaFile: [], resultOverflow: false })); @@ -189,6 +196,7 @@ describe('SearchManager', () => { searchText: 'wa', directories: [dir], media: [p, p2], + metaFile: [], resultOverflow: false })); }); diff --git a/test/backend/unit/model/sql/TestHelper.ts b/test/backend/unit/model/sql/TestHelper.ts index 8258934..3dbea4c 100644 --- a/test/backend/unit/model/sql/TestHelper.ts +++ b/test/backend/unit/model/sql/TestHelper.ts @@ -10,6 +10,7 @@ import {OrientationTypes} from 'ts-exif-parser'; import {DirectoryEntity} from '../../../../../backend/model/sql/enitites/DirectoryEntity'; import {Utils} from '../../../../../common/Utils'; import {VideoEntity, VideoMetadataEntity} from '../../../../../backend/model/sql/enitites/VideoEntity'; +import {FileEntity} from '../../../../../backend/model/sql/enitites/FileEntity'; export class TestHelper { @@ -126,6 +127,7 @@ export class TestHelper { parent.directories.push(dir); } dir.directories = []; + dir.metaFile = []; dir.media = []; dir.lastModified = Date.now(); dir.lastScanned = null; @@ -133,6 +135,16 @@ export class TestHelper { return dir; } + + public static getRandomizedGPXEntry(dir: DirectoryEntity, forceStr = null): FileEntity { + const d = new FileEntity(); + d.name = forceStr + '_' + Math.random().toString(36).substring(7) + '.gpx'; + d.directory = dir; + + dir.metaFile.push(d); + return d; + } + public static getRandomizedPhotoEntry(dir: DirectoryEntity, forceStr = null) {