2022-10-06 11:25:54 -05:00
|
|
|
<script lang="ts">
|
2023-05-23 16:04:24 -04:00
|
|
|
import type Icon from 'svelte-material-icons/AbTesting.svelte';
|
2023-01-26 22:50:22 -06:00
|
|
|
import SelectionSearch from 'svelte-material-icons/SelectionSearch.svelte';
|
|
|
|
|
import Play from 'svelte-material-icons/Play.svelte';
|
2023-04-01 06:53:20 +02:00
|
|
|
import Pause from 'svelte-material-icons/Pause.svelte';
|
|
|
|
|
import FastForward from 'svelte-material-icons/FastForward.svelte';
|
2023-01-26 22:50:22 -06:00
|
|
|
import AllInclusive from 'svelte-material-icons/AllInclusive.svelte';
|
2023-04-01 22:46:07 +02:00
|
|
|
import Close from 'svelte-material-icons/Close.svelte';
|
2023-02-22 18:53:08 +01:00
|
|
|
import { locale } from '$lib/stores/preferences.store';
|
2022-10-06 11:25:54 -05:00
|
|
|
import { createEventDispatcher } from 'svelte';
|
2023-04-01 22:46:07 +02:00
|
|
|
import { JobCommand, JobCommandDto, JobCountsDto, QueueStatusDto } from '@api';
|
2023-04-01 06:53:20 +02:00
|
|
|
import Badge from '$lib/components/elements/badge.svelte';
|
2023-04-01 22:46:07 +02:00
|
|
|
import JobTileButton from './job-tile-button.svelte';
|
|
|
|
|
import JobTileStatus from './job-tile-status.svelte';
|
2022-10-06 11:25:54 -05:00
|
|
|
|
|
|
|
|
export let title: string;
|
2023-04-01 06:53:20 +02:00
|
|
|
export let subtitle: string | undefined = undefined;
|
2023-03-20 11:55:28 -04:00
|
|
|
export let jobCounts: JobCountsDto;
|
2023-04-01 22:46:07 +02:00
|
|
|
export let queueStatus: QueueStatusDto;
|
2023-04-01 06:53:20 +02:00
|
|
|
export let allowForceCommand = true;
|
2023-05-23 16:04:24 -04:00
|
|
|
export let icon: typeof Icon;
|
2023-01-26 22:50:22 -06:00
|
|
|
|
feat(server): xmp sidecar metadata (#2466)
* initial commit for XMP sidecar support
* Added support for 'missing' metadata files to include those without sidecar files, now detects sidecar files in the filesystem for media already ingested but the sidecar was created afterwards
* didn't mean to commit default log level during testing
* new sidecar logic for video metadata as well
* Added xml mimetype for sidecars only
* don't need capture group for this regex
* wrong default value reverted
* simplified the move here - keep it in the same try catch since the outcome is to move the media back anyway
* simplified setter logic
Co-authored-by: Jason Rasmussen <jrasm91@gmail.com>
* simplified logic per suggestions
* sidecar is now its own queue with a discover and sync, updated UI for the new job queueing
* queue a sidecar job for every asset based on discovery or sync, though the logic is almost identical aside from linking the sidecar
* now queue sidecar jobs for each assset, though logic is mostly the same between discovery and sync
* simplified logic of filename extraction and asset instantiation
* not sure how that got deleted..
* updated code per suggestions and comments in the PR
* stat was not being used, removed the variable set
* better type checking, using in-scope variables for exif getter instead of passing in every time
* removed commented out test
* ran and resolved all lints, formats, checks, and tests
* resolved suggested change in PR
* made getExifProperty more dynamic with multiple possible args for fallbacks, fixed typo, used generic in function for better type checking
* better error handling and moving files back to positions on move or save failure
* regenerated api
* format fixes
* Added XMP documentation
* documentation typo
* Merged in main
* missed merge conflict
* more changes due to a merge
* Resolving conflicts
* added icon for sidecar jobs
---------
Co-authored-by: Jason Rasmussen <jrasm91@gmail.com>
Co-authored-by: Alex Tran <alex.tran1502@gmail.com>
2023-05-24 21:59:30 -04:00
|
|
|
export let allText: string;
|
|
|
|
|
export let missingText: string;
|
|
|
|
|
|
2023-04-01 22:46:07 +02:00
|
|
|
$: waitingCount = jobCounts.waiting + jobCounts.paused + jobCounts.delayed;
|
|
|
|
|
$: isIdle = !queueStatus.isActive && !queueStatus.isPaused;
|
2023-01-09 22:35:37 +02:00
|
|
|
|
2023-04-01 06:53:20 +02:00
|
|
|
const dispatch = createEventDispatcher<{ command: JobCommandDto }>();
|
2022-10-06 11:25:54 -05:00
|
|
|
</script>
|
|
|
|
|
|
2023-04-17 18:18:49 +02:00
|
|
|
<div
|
|
|
|
|
class="flex sm:flex-row flex-col bg-gray-100 dark:bg-immich-dark-gray rounded-3xl overflow-hidden"
|
|
|
|
|
>
|
2023-04-01 22:46:07 +02:00
|
|
|
<div class="flex flex-col w-full">
|
|
|
|
|
{#if queueStatus.isPaused}
|
|
|
|
|
<JobTileStatus color="warning">Paused</JobTileStatus>
|
|
|
|
|
{:else if queueStatus.isActive}
|
|
|
|
|
<JobTileStatus color="success">Active</JobTileStatus>
|
|
|
|
|
{/if}
|
|
|
|
|
<div class="flex flex-col gap-2 p-9">
|
2023-04-01 06:53:20 +02:00
|
|
|
<div
|
|
|
|
|
class="flex items-center gap-4 text-xl font-semibold text-immich-primary dark:text-immich-dark-primary"
|
|
|
|
|
>
|
2023-05-23 16:04:24 -04:00
|
|
|
<span class="flex gap-2 items-center">
|
|
|
|
|
<svelte:component this={icon} size="1.25em" class="shrink-0 hidden sm:block" />
|
|
|
|
|
{title.toUpperCase()}
|
|
|
|
|
</span>
|
2023-04-01 06:53:20 +02:00
|
|
|
<div class="flex gap-2">
|
|
|
|
|
{#if jobCounts.failed > 0}
|
2023-04-01 22:46:07 +02:00
|
|
|
<Badge color="primary">
|
2023-04-01 06:53:20 +02:00
|
|
|
{jobCounts.failed.toLocaleString($locale)} failed
|
|
|
|
|
</Badge>
|
|
|
|
|
{/if}
|
2023-04-01 22:46:07 +02:00
|
|
|
{#if jobCounts.delayed > 0}
|
|
|
|
|
<Badge color="secondary">
|
|
|
|
|
{jobCounts.delayed.toLocaleString($locale)} delayed
|
|
|
|
|
</Badge>
|
|
|
|
|
{/if}
|
2023-04-01 06:53:20 +02:00
|
|
|
</div>
|
2023-01-26 22:50:22 -06:00
|
|
|
</div>
|
|
|
|
|
|
2023-04-01 06:53:20 +02:00
|
|
|
{#if subtitle}
|
|
|
|
|
<div class="text-sm dark:text-white whitespace-pre-line">{subtitle}</div>
|
2023-01-26 22:50:22 -06:00
|
|
|
{/if}
|
2023-04-01 06:53:20 +02:00
|
|
|
<div class="text-sm dark:text-white">
|
|
|
|
|
<slot />
|
|
|
|
|
</div>
|
2023-01-26 22:50:22 -06:00
|
|
|
|
2023-04-01 06:53:20 +02:00
|
|
|
<div class="flex w-full max-w-md mt-2">
|
2023-01-26 22:50:22 -06:00
|
|
|
<div
|
|
|
|
|
class="flex place-items-center justify-between bg-immich-primary dark:bg-immich-dark-primary text-white dark:text-immich-dark-gray w-full rounded-tl-lg rounded-bl-lg py-4 pl-4 pr-6"
|
|
|
|
|
>
|
|
|
|
|
<p>Active</p>
|
|
|
|
|
<p class="text-2xl">
|
2023-04-01 06:53:20 +02:00
|
|
|
{jobCounts.active.toLocaleString($locale)}
|
2023-01-26 22:50:22 -06:00
|
|
|
</p>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div
|
|
|
|
|
class="flex place-items-center justify-between bg-gray-200 text-immich-dark-bg dark:bg-gray-700 dark:text-immich-gray w-full rounded-tr-lg rounded-br-lg py-4 pr-4 pl-6"
|
|
|
|
|
>
|
|
|
|
|
<p class="text-2xl">
|
2023-04-01 06:53:20 +02:00
|
|
|
{waitingCount.toLocaleString($locale)}
|
2023-01-26 22:50:22 -06:00
|
|
|
</p>
|
|
|
|
|
<p>Waiting</p>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2022-10-06 11:25:54 -05:00
|
|
|
</div>
|
2023-04-17 18:18:49 +02:00
|
|
|
<div class="flex sm:flex-col flex-row sm:w-32 w-full overflow-hidden">
|
2023-04-01 22:46:07 +02:00
|
|
|
{#if !isIdle}
|
|
|
|
|
{#if waitingCount > 0}
|
|
|
|
|
<JobTileButton
|
|
|
|
|
color="gray"
|
|
|
|
|
on:click={() => dispatch('command', { command: JobCommand.Empty, force: false })}
|
|
|
|
|
>
|
|
|
|
|
<Close size="24" /> CLEAR
|
|
|
|
|
</JobTileButton>
|
|
|
|
|
{/if}
|
|
|
|
|
{#if queueStatus.isPaused}
|
2023-05-18 17:43:09 +02:00
|
|
|
{@const size = waitingCount > 0 ? '24' : '48'}
|
2023-04-01 22:46:07 +02:00
|
|
|
<JobTileButton
|
|
|
|
|
color="light-gray"
|
|
|
|
|
on:click={() => dispatch('command', { command: JobCommand.Resume, force: false })}
|
|
|
|
|
>
|
|
|
|
|
<!-- size property is not reactive, so have to use width and height -->
|
|
|
|
|
<FastForward width={size} height={size} /> RESUME
|
|
|
|
|
</JobTileButton>
|
|
|
|
|
{:else}
|
|
|
|
|
<JobTileButton
|
|
|
|
|
color="light-gray"
|
|
|
|
|
on:click={() => dispatch('command', { command: JobCommand.Pause, force: false })}
|
|
|
|
|
>
|
|
|
|
|
<Pause size="24" /> PAUSE
|
|
|
|
|
</JobTileButton>
|
|
|
|
|
{/if}
|
2023-04-01 06:53:20 +02:00
|
|
|
{:else if allowForceCommand}
|
2023-04-01 22:46:07 +02:00
|
|
|
<JobTileButton
|
|
|
|
|
color="gray"
|
2023-04-01 06:53:20 +02:00
|
|
|
on:click={() => dispatch('command', { command: JobCommand.Start, force: true })}
|
|
|
|
|
>
|
feat(server): xmp sidecar metadata (#2466)
* initial commit for XMP sidecar support
* Added support for 'missing' metadata files to include those without sidecar files, now detects sidecar files in the filesystem for media already ingested but the sidecar was created afterwards
* didn't mean to commit default log level during testing
* new sidecar logic for video metadata as well
* Added xml mimetype for sidecars only
* don't need capture group for this regex
* wrong default value reverted
* simplified the move here - keep it in the same try catch since the outcome is to move the media back anyway
* simplified setter logic
Co-authored-by: Jason Rasmussen <jrasm91@gmail.com>
* simplified logic per suggestions
* sidecar is now its own queue with a discover and sync, updated UI for the new job queueing
* queue a sidecar job for every asset based on discovery or sync, though the logic is almost identical aside from linking the sidecar
* now queue sidecar jobs for each assset, though logic is mostly the same between discovery and sync
* simplified logic of filename extraction and asset instantiation
* not sure how that got deleted..
* updated code per suggestions and comments in the PR
* stat was not being used, removed the variable set
* better type checking, using in-scope variables for exif getter instead of passing in every time
* removed commented out test
* ran and resolved all lints, formats, checks, and tests
* resolved suggested change in PR
* made getExifProperty more dynamic with multiple possible args for fallbacks, fixed typo, used generic in function for better type checking
* better error handling and moving files back to positions on move or save failure
* regenerated api
* format fixes
* Added XMP documentation
* documentation typo
* Merged in main
* missed merge conflict
* more changes due to a merge
* Resolving conflicts
* added icon for sidecar jobs
---------
Co-authored-by: Jason Rasmussen <jrasm91@gmail.com>
Co-authored-by: Alex Tran <alex.tran1502@gmail.com>
2023-05-24 21:59:30 -04:00
|
|
|
<AllInclusive size="24" />
|
|
|
|
|
{allText}
|
2023-04-01 22:46:07 +02:00
|
|
|
</JobTileButton>
|
|
|
|
|
<JobTileButton
|
|
|
|
|
color="light-gray"
|
2023-04-01 06:53:20 +02:00
|
|
|
on:click={() => dispatch('command', { command: JobCommand.Start, force: false })}
|
|
|
|
|
>
|
feat(server): xmp sidecar metadata (#2466)
* initial commit for XMP sidecar support
* Added support for 'missing' metadata files to include those without sidecar files, now detects sidecar files in the filesystem for media already ingested but the sidecar was created afterwards
* didn't mean to commit default log level during testing
* new sidecar logic for video metadata as well
* Added xml mimetype for sidecars only
* don't need capture group for this regex
* wrong default value reverted
* simplified the move here - keep it in the same try catch since the outcome is to move the media back anyway
* simplified setter logic
Co-authored-by: Jason Rasmussen <jrasm91@gmail.com>
* simplified logic per suggestions
* sidecar is now its own queue with a discover and sync, updated UI for the new job queueing
* queue a sidecar job for every asset based on discovery or sync, though the logic is almost identical aside from linking the sidecar
* now queue sidecar jobs for each assset, though logic is mostly the same between discovery and sync
* simplified logic of filename extraction and asset instantiation
* not sure how that got deleted..
* updated code per suggestions and comments in the PR
* stat was not being used, removed the variable set
* better type checking, using in-scope variables for exif getter instead of passing in every time
* removed commented out test
* ran and resolved all lints, formats, checks, and tests
* resolved suggested change in PR
* made getExifProperty more dynamic with multiple possible args for fallbacks, fixed typo, used generic in function for better type checking
* better error handling and moving files back to positions on move or save failure
* regenerated api
* format fixes
* Added XMP documentation
* documentation typo
* Merged in main
* missed merge conflict
* more changes due to a merge
* Resolving conflicts
* added icon for sidecar jobs
---------
Co-authored-by: Jason Rasmussen <jrasm91@gmail.com>
Co-authored-by: Alex Tran <alex.tran1502@gmail.com>
2023-05-24 21:59:30 -04:00
|
|
|
<SelectionSearch size="24" />
|
|
|
|
|
{missingText}
|
2023-04-01 22:46:07 +02:00
|
|
|
</JobTileButton>
|
2023-04-01 06:53:20 +02:00
|
|
|
{:else}
|
2023-04-01 22:46:07 +02:00
|
|
|
<JobTileButton
|
|
|
|
|
color="light-gray"
|
2023-04-01 06:53:20 +02:00
|
|
|
on:click={() => dispatch('command', { command: JobCommand.Start, force: false })}
|
|
|
|
|
>
|
|
|
|
|
<Play size="48" /> START
|
2023-04-01 22:46:07 +02:00
|
|
|
</JobTileButton>
|
2023-01-26 22:50:22 -06:00
|
|
|
{/if}
|
2022-10-06 11:25:54 -05:00
|
|
|
</div>
|
|
|
|
|
</div>
|