mirror of
https://github.com/xuthus83/pigallery2.git
synced 2024-11-03 21:04:03 +08:00
Feature/location info (#9)
* Show comma-separated city, state and country in infobox and in gallery mode. All of the values that are non-empty will be shown. * methodcall to isPhoto * Unit test and bugfix for CreationDate (#8) * fixed the DiskManagerWorker test * s (#10) * Unit test and bugfix for CreationDate (#8) * fixed the DiskManagerWorker test --------- Co-authored-by: Patrik J. Braun <bpatrik@users.noreply.github.com> * s (#11) * Unit test and bugfix for CreationDate (#8) * fixed the DiskManagerWorker test --------- Co-authored-by: Patrik J. Braun <bpatrik@users.noreply.github.com> * 9ij (#12) * Unit test and bugfix for CreationDate (#8) * fixed the DiskManagerWorker test --------- Co-authored-by: Patrik J. Braun <bpatrik@users.noreply.github.com> --------- Co-authored-by: Patrik J. Braun <bpatrik@users.noreply.github.com>
This commit is contained in:
parent
a8b35bb76e
commit
e21e67cfc7
@ -134,10 +134,10 @@ export class GalleryPhotoComponent implements IRenderable, OnInit, OnDestroy {
|
|||||||
}
|
}
|
||||||
|
|
||||||
getPositionText(): string {
|
getPositionText(): string {
|
||||||
if (!this.gridMedia || !this.gridMedia.isPhoto()) {
|
if (!this.gridMedia || !this.gridMedia.isPhoto() || !(this.gridMedia.media as PhotoDTO).metadata.positionData) {
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
return (
|
return ( //not much space in the gridview, so we only deliver city, or state or country
|
||||||
(this.gridMedia.media as PhotoDTO).metadata.positionData.city ||
|
(this.gridMedia.media as PhotoDTO).metadata.positionData.city ||
|
||||||
(this.gridMedia.media as PhotoDTO).metadata.positionData.state ||
|
(this.gridMedia.media as PhotoDTO).metadata.positionData.state ||
|
||||||
(this.gridMedia.media as PhotoDTO).metadata.positionData.country || ''
|
(this.gridMedia.media as PhotoDTO).metadata.positionData.country || ''
|
||||||
|
@ -510,11 +510,14 @@ export class ControlsLightboxComponent implements OnDestroy, OnInit, OnChanges {
|
|||||||
case LightBoxTitleTexts.date:
|
case LightBoxTitleTexts.date:
|
||||||
return this.datePipe.transform(m.metadata.creationDate, 'longDate', m.metadata.creationDateOffset);
|
return this.datePipe.transform(m.metadata.creationDate, 'longDate', m.metadata.creationDateOffset);
|
||||||
case LightBoxTitleTexts.location:
|
case LightBoxTitleTexts.location:
|
||||||
return (
|
if (!m.metadata.positionData) {
|
||||||
m.metadata.positionData?.city ||
|
return '';
|
||||||
m.metadata.positionData?.state ||
|
}
|
||||||
m.metadata.positionData?.country || ''
|
return [
|
||||||
).trim();
|
m.metadata.positionData.city,
|
||||||
|
m.metadata.positionData.state,
|
||||||
|
m.metadata.positionData.country
|
||||||
|
].filter(elm => elm).join(', ').trim(); //Filter removes empty elements, join concats the values separated by ', '
|
||||||
case LightBoxTitleTexts.camera:
|
case LightBoxTitleTexts.camera:
|
||||||
return m.metadata.cameraData?.model;
|
return m.metadata.cameraData?.model;
|
||||||
case LightBoxTitleTexts.lens:
|
case LightBoxTitleTexts.lens:
|
||||||
|
@ -183,17 +183,11 @@ export class InfoPanelLightboxComponent implements OnInit, OnChanges {
|
|||||||
if (!(this.media as PhotoDTO).metadata.positionData) {
|
if (!(this.media as PhotoDTO).metadata.positionData) {
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
let str =
|
return [
|
||||||
(this.media as PhotoDTO).metadata.positionData.city ||
|
(this.media as PhotoDTO).metadata.positionData.city,
|
||||||
(this.media as PhotoDTO).metadata.positionData.state ||
|
(this.media as PhotoDTO).metadata.positionData.state,
|
||||||
'';
|
(this.media as PhotoDTO).metadata.positionData.country
|
||||||
|
].filter(elm => elm).join(', ').trim(); //Filter removes empty elements, join concats the values separated by ', '
|
||||||
if (str.length !== 0) {
|
|
||||||
str += ', ';
|
|
||||||
}
|
|
||||||
str += (this.media as PhotoDTO).metadata.positionData.country || '';
|
|
||||||
|
|
||||||
return str;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
close(): void {
|
close(): void {
|
||||||
|
Loading…
Reference in New Issue
Block a user