1
0
mirror of https://github.com/xuthus83/pigallery2.git synced 2024-11-03 21:04:03 +08:00

Add direct link to photo #683

This commit is contained in:
Patrik J. Braun 2023-08-02 23:22:05 +02:00
parent f3231d5ab2
commit 6f1c42f3d4

View File

@ -8,6 +8,7 @@ import {ProjectPath} from '../../ProjectPath';
import * as path from 'path';
import {PhotoMetadata} from '../../../common/entities/PhotoDTO';
import {Utils} from '../../../common/Utils';
import {QueryParams} from '../../../common/QueryParams';
export class EmailMediaMessenger {
transporter: Transporter;
@ -58,7 +59,8 @@ export class EmailMediaMessenger {
let htmlMiddle = '';
for (let i = 0; i < media.length; ++i) {
const thPath = await this.getThumbnail(media[i]);
const linkUrl = Utils.concatUrls(Config.Server.publicUrl, '/gallery/',encodeURIComponent(path.join(media[i].directory.path, media[i].directory.name)));
const linkUrl = Utils.concatUrls(Config.Server.publicUrl, '/gallery/', encodeURIComponent(path.join(media[i].directory.path, media[i].directory.name))) +
'?' + QueryParams.gallery.photo + '=' + encodeURIComponent(media[i].name);
const location = (media[i].metadata as PhotoMetadata).positionData?.country ?
(media[i].metadata as PhotoMetadata).positionData?.country :
((media[i].metadata as PhotoMetadata).positionData?.city ?