|
@@ -5,7 +5,7 @@
|
|
import { getAssetFilename } from '$lib/utils/asset-utils';
|
|
import { getAssetFilename } from '$lib/utils/asset-utils';
|
|
import { AlbumResponseDto, AssetResponseDto, ThumbnailFormat, api } from '@api';
|
|
import { AlbumResponseDto, AssetResponseDto, ThumbnailFormat, api } from '@api';
|
|
import { DateTime } from 'luxon';
|
|
import { DateTime } from 'luxon';
|
|
- import { createEventDispatcher, onDestroy } from 'svelte';
|
|
|
|
|
|
+ import { createEventDispatcher } from 'svelte';
|
|
import { slide } from 'svelte/transition';
|
|
import { slide } from 'svelte/transition';
|
|
import { asByteUnitString } from '../../utils/byte-units';
|
|
import { asByteUnitString } from '../../utils/byte-units';
|
|
import ImageThumbnail from '../assets/thumbnail/image-thumbnail.svelte';
|
|
import ImageThumbnail from '../assets/thumbnail/image-thumbnail.svelte';
|
|
@@ -22,10 +22,10 @@
|
|
} from '@mdi/js';
|
|
} from '@mdi/js';
|
|
import Icon from '$lib/components/elements/icon.svelte';
|
|
import Icon from '$lib/components/elements/icon.svelte';
|
|
import Map from '../shared-components/map/map.svelte';
|
|
import Map from '../shared-components/map/map.svelte';
|
|
- import { websocketStore } from '$lib/stores/websocket';
|
|
|
|
import { AppRoute } from '$lib/constants';
|
|
import { AppRoute } from '$lib/constants';
|
|
import ChangeLocation from '../shared-components/change-location.svelte';
|
|
import ChangeLocation from '../shared-components/change-location.svelte';
|
|
import { handleError } from '../../utils/handle-error';
|
|
import { handleError } from '../../utils/handle-error';
|
|
|
|
+ import { notificationController, NotificationType } from '../shared-components/notification/notification';
|
|
|
|
|
|
export let asset: AssetResponseDto;
|
|
export let asset: AssetResponseDto;
|
|
export let albums: AlbumResponseDto[] = [];
|
|
export let albums: AlbumResponseDto[] = [];
|
|
@@ -57,16 +57,6 @@
|
|
|
|
|
|
$: people = asset.people || [];
|
|
$: people = asset.people || [];
|
|
|
|
|
|
- const unsubscribe = websocketStore.onAssetUpdate.subscribe((assetUpdate) => {
|
|
|
|
- if (assetUpdate && assetUpdate.id === asset.id) {
|
|
|
|
- asset = assetUpdate;
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
-
|
|
|
|
- onDestroy(() => {
|
|
|
|
- unsubscribe();
|
|
|
|
- });
|
|
|
|
-
|
|
|
|
const dispatch = createEventDispatcher();
|
|
const dispatch = createEventDispatcher();
|
|
|
|
|
|
const getMegapixel = (width: number, height: number): number | undefined => {
|
|
const getMegapixel = (width: number, height: number): number | undefined => {
|
|
@@ -110,6 +100,10 @@
|
|
isShowChangeDate = false;
|
|
isShowChangeDate = false;
|
|
try {
|
|
try {
|
|
await api.assetApi.updateAsset({ id: asset.id, updateAssetDto: { dateTimeOriginal } });
|
|
await api.assetApi.updateAsset({ id: asset.id, updateAssetDto: { dateTimeOriginal } });
|
|
|
|
+ notificationController.show({
|
|
|
|
+ message: 'The date has been changed successfully, please reload to see the changes.',
|
|
|
|
+ type: NotificationType.Info,
|
|
|
|
+ });
|
|
} catch (error) {
|
|
} catch (error) {
|
|
handleError(error, 'Unable to change date');
|
|
handleError(error, 'Unable to change date');
|
|
}
|
|
}
|
|
@@ -128,6 +122,10 @@
|
|
longitude: gps.lng,
|
|
longitude: gps.lng,
|
|
},
|
|
},
|
|
});
|
|
});
|
|
|
|
+ notificationController.show({
|
|
|
|
+ message: 'The location has been changed successfully, please reload to see the changes.',
|
|
|
|
+ type: NotificationType.Info,
|
|
|
|
+ });
|
|
} catch (error) {
|
|
} catch (error) {
|
|
handleError(error, 'Unable to change location');
|
|
handleError(error, 'Unable to change location');
|
|
}
|
|
}
|