Remove everything related to websocket
This commit is contained in:
@@ -172,12 +172,6 @@ export class JobService {
|
|||||||
});
|
});
|
||||||
|
|
||||||
case JobName.METADATA_EXTRACTION:
|
case JobName.METADATA_EXTRACTION:
|
||||||
if (item.data.source === 'sidecar-write') {
|
|
||||||
const [asset] = await this.assetRepository.getByIds([item.data.id]);
|
|
||||||
if (asset) {
|
|
||||||
this.communicationRepository.send(CommunicationEvent.ASSET_UPDATE, asset.ownerId, mapAsset(asset));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
await this.jobRepository.queue({ name: JobName.LINK_LIVE_PHOTOS, data: item.data });
|
await this.jobRepository.queue({ name: JobName.LINK_LIVE_PHOTOS, data: item.data });
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|||||||
@@ -20,7 +20,6 @@
|
|||||||
import ThemeButton from '../shared-components/theme-button.svelte';
|
import ThemeButton from '../shared-components/theme-button.svelte';
|
||||||
import { shouldIgnoreShortcut } from '$lib/utils/shortcut';
|
import { shouldIgnoreShortcut } from '$lib/utils/shortcut';
|
||||||
import { mdiFileImagePlusOutline, mdiFolderDownloadOutline } from '@mdi/js';
|
import { mdiFileImagePlusOutline, mdiFolderDownloadOutline } from '@mdi/js';
|
||||||
import UpdatePanel from '../shared-components/update-panel.svelte';
|
|
||||||
|
|
||||||
export let sharedLink: SharedLinkResponseDto;
|
export let sharedLink: SharedLinkResponseDto;
|
||||||
export let user: UserResponseDto | undefined = undefined;
|
export let user: UserResponseDto | undefined = undefined;
|
||||||
@@ -168,5 +167,4 @@
|
|||||||
</p>
|
</p>
|
||||||
</section>
|
</section>
|
||||||
</AssetGrid>
|
</AssetGrid>
|
||||||
<UpdatePanel {assetStore} />
|
|
||||||
</main>
|
</main>
|
||||||
|
|||||||
@@ -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');
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,7 +24,10 @@
|
|||||||
await api.assetApi.updateAssets({
|
await api.assetApi.updateAssets({
|
||||||
assetBulkUpdateDto: { ids, dateTimeOriginal },
|
assetBulkUpdateDto: { ids, dateTimeOriginal },
|
||||||
});
|
});
|
||||||
notificationController.show({ message: 'Updating date please wait', type: NotificationType.Info });
|
notificationController.show({
|
||||||
|
message: 'Updating date you can reload to see change',
|
||||||
|
type: NotificationType.Info,
|
||||||
|
});
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
handleError(error, 'Unable to change date');
|
handleError(error, 'Unable to change date');
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,7 +28,10 @@
|
|||||||
longitude: point.lng,
|
longitude: point.lng,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
notificationController.show({ message: 'Updating location please wait', type: NotificationType.Info });
|
notificationController.show({
|
||||||
|
message: 'Updating location you can reload to see change',
|
||||||
|
type: NotificationType.Info,
|
||||||
|
});
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
handleError(error, 'Unable to update location');
|
handleError(error, 'Unable to update location');
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,38 +0,0 @@
|
|||||||
<script lang="ts">
|
|
||||||
import { websocketStore } from '$lib/stores/websocket';
|
|
||||||
import type { AssetStore } from '$lib/stores/assets.store';
|
|
||||||
import { notificationController, NotificationType } from './notification/notification';
|
|
||||||
|
|
||||||
export let assetStore: AssetStore | null;
|
|
||||||
let assetUpdateCount = 0;
|
|
||||||
let lastAssetName: string;
|
|
||||||
let timeoutId: string | number | NodeJS.Timeout | undefined;
|
|
||||||
|
|
||||||
websocketStore.onAssetUpdate.subscribe((asset) => {
|
|
||||||
if (asset && asset.originalFileName && assetStore) {
|
|
||||||
lastAssetName = asset.originalFileName;
|
|
||||||
assetUpdateCount++;
|
|
||||||
|
|
||||||
assetStore.updateAsset(asset, true);
|
|
||||||
|
|
||||||
assetStore.removeAsset(asset.id); // Update timeline
|
|
||||||
assetStore.addAsset(asset);
|
|
||||||
|
|
||||||
clearTimeout(timeoutId);
|
|
||||||
timeoutId = setTimeout(() => {
|
|
||||||
if (assetUpdateCount === 1) {
|
|
||||||
notificationController.show({
|
|
||||||
message: `Asset updated: ${lastAssetName}.`,
|
|
||||||
type: NotificationType.Info,
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
notificationController.show({
|
|
||||||
message: `${assetUpdateCount} assets updated.`,
|
|
||||||
type: NotificationType.Info,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
assetUpdateCount = 0;
|
|
||||||
}, 500);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
@@ -58,7 +58,6 @@
|
|||||||
import ActivityStatus from '$lib/components/asset-viewer/activity-status.svelte';
|
import ActivityStatus from '$lib/components/asset-viewer/activity-status.svelte';
|
||||||
import { numberOfComments, setNumberOfComments, updateNumberOfComments } from '$lib/stores/activity.store';
|
import { numberOfComments, setNumberOfComments, updateNumberOfComments } from '$lib/stores/activity.store';
|
||||||
import AlbumOptions from '$lib/components/album-page/album-options.svelte';
|
import AlbumOptions from '$lib/components/album-page/album-options.svelte';
|
||||||
import UpdatePanel from '$lib/components/shared-components/update-panel.svelte';
|
|
||||||
|
|
||||||
export let data: PageData;
|
export let data: PageData;
|
||||||
|
|
||||||
@@ -755,5 +754,3 @@
|
|||||||
on:save={({ detail: description }) => handleUpdateDescription(description)}
|
on:save={({ detail: description }) => handleUpdateDescription(description)}
|
||||||
/>
|
/>
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
<UpdatePanel {assetStore} />
|
|
||||||
|
|||||||
@@ -16,7 +16,6 @@
|
|||||||
import { AssetStore } from '$lib/stores/assets.store';
|
import { AssetStore } from '$lib/stores/assets.store';
|
||||||
import type { PageData } from './$types';
|
import type { PageData } from './$types';
|
||||||
import { mdiPlus, mdiDotsVertical } from '@mdi/js';
|
import { mdiPlus, mdiDotsVertical } from '@mdi/js';
|
||||||
import UpdatePanel from '$lib/components/shared-components/update-panel.svelte';
|
|
||||||
|
|
||||||
export let data: PageData;
|
export let data: PageData;
|
||||||
|
|
||||||
@@ -53,4 +52,3 @@
|
|||||||
/>
|
/>
|
||||||
</AssetGrid>
|
</AssetGrid>
|
||||||
</UserPageLayout>
|
</UserPageLayout>
|
||||||
<UpdatePanel {assetStore} />
|
|
||||||
|
|||||||
@@ -18,7 +18,6 @@
|
|||||||
import { AssetStore } from '$lib/stores/assets.store';
|
import { AssetStore } from '$lib/stores/assets.store';
|
||||||
import type { PageData } from './$types';
|
import type { PageData } from './$types';
|
||||||
import { mdiDotsVertical, mdiPlus } from '@mdi/js';
|
import { mdiDotsVertical, mdiPlus } from '@mdi/js';
|
||||||
import UpdatePanel from '$lib/components/shared-components/update-panel.svelte';
|
|
||||||
|
|
||||||
export let data: PageData;
|
export let data: PageData;
|
||||||
|
|
||||||
@@ -58,4 +57,3 @@
|
|||||||
/>
|
/>
|
||||||
</AssetGrid>
|
</AssetGrid>
|
||||||
</UserPageLayout>
|
</UserPageLayout>
|
||||||
<UpdatePanel {assetStore} />
|
|
||||||
|
|||||||
@@ -13,8 +13,6 @@
|
|||||||
import { onDestroy } from 'svelte';
|
import { onDestroy } from 'svelte';
|
||||||
import type { PageData } from './$types';
|
import type { PageData } from './$types';
|
||||||
import { mdiPlus, mdiArrowLeft } from '@mdi/js';
|
import { mdiPlus, mdiArrowLeft } from '@mdi/js';
|
||||||
import UpdatePanel from '$lib/components/shared-components/update-panel.svelte';
|
|
||||||
|
|
||||||
export let data: PageData;
|
export let data: PageData;
|
||||||
|
|
||||||
const assetStore = new AssetStore({ userId: data.partner.id, isArchived: false, withStacked: true });
|
const assetStore = new AssetStore({ userId: data.partner.id, isArchived: false, withStacked: true });
|
||||||
@@ -46,5 +44,4 @@
|
|||||||
</ControlAppBar>
|
</ControlAppBar>
|
||||||
{/if}
|
{/if}
|
||||||
<AssetGrid {assetStore} {assetInteractionStore} />
|
<AssetGrid {assetStore} {assetInteractionStore} />
|
||||||
<UpdatePanel {assetStore} />
|
|
||||||
</main>
|
</main>
|
||||||
|
|||||||
@@ -23,7 +23,6 @@
|
|||||||
import type { PageData } from './$types';
|
import type { PageData } from './$types';
|
||||||
import { assetViewingStore } from '$lib/stores/asset-viewing.store';
|
import { assetViewingStore } from '$lib/stores/asset-viewing.store';
|
||||||
import { mdiDotsVertical, mdiPlus } from '@mdi/js';
|
import { mdiDotsVertical, mdiPlus } from '@mdi/js';
|
||||||
import UpdatePanel from '$lib/components/shared-components/update-panel.svelte';
|
|
||||||
|
|
||||||
export let data: PageData;
|
export let data: PageData;
|
||||||
|
|
||||||
@@ -98,4 +97,3 @@
|
|||||||
/>
|
/>
|
||||||
</AssetGrid>
|
</AssetGrid>
|
||||||
</UserPageLayout>
|
</UserPageLayout>
|
||||||
<UpdatePanel {assetStore} />
|
|
||||||
|
|||||||
@@ -23,7 +23,6 @@
|
|||||||
import empty3Url from '$lib/assets/empty-3.svg';
|
import empty3Url from '$lib/assets/empty-3.svg';
|
||||||
import ConfirmDialogue from '$lib/components/shared-components/confirm-dialogue.svelte';
|
import ConfirmDialogue from '$lib/components/shared-components/confirm-dialogue.svelte';
|
||||||
import { mdiDeleteOutline, mdiHistory } from '@mdi/js';
|
import { mdiDeleteOutline, mdiHistory } from '@mdi/js';
|
||||||
import UpdatePanel from '$lib/components/shared-components/update-panel.svelte';
|
|
||||||
|
|
||||||
export let data: PageData;
|
export let data: PageData;
|
||||||
|
|
||||||
@@ -114,4 +113,3 @@
|
|||||||
</svelte:fragment>
|
</svelte:fragment>
|
||||||
</ConfirmDialogue>
|
</ConfirmDialogue>
|
||||||
{/if}
|
{/if}
|
||||||
<UpdatePanel {assetStore} />
|
|
||||||
|
|||||||
Reference in New Issue
Block a user