lint: remove more unused imports and variables (5 fixes)
Co-Authored-By: Justin Edmund <justin@jedmund.com>
This commit is contained in:
parent
018fc67b2c
commit
841ee79885
4 changed files with 3 additions and 20 deletions
|
|
@ -18,17 +18,6 @@
|
||||||
|
|
||||||
let { album = null, mode }: Props = $props()
|
let { album = null, mode }: Props = $props()
|
||||||
|
|
||||||
// Album schema for validation
|
|
||||||
const albumSchema = z.object({
|
|
||||||
title: z.string().min(1, 'Title is required'),
|
|
||||||
slug: z
|
|
||||||
.string()
|
|
||||||
.min(1, 'Slug is required')
|
|
||||||
.regex(/^[a-z0-9-]+$/, 'Slug must be lowercase letters, numbers, and hyphens only'),
|
|
||||||
location: z.string().optional(),
|
|
||||||
year: z.string().optional()
|
|
||||||
})
|
|
||||||
|
|
||||||
// State
|
// State
|
||||||
let isLoading = $state(mode === 'edit')
|
let isLoading = $state(mode === 'edit')
|
||||||
let showBulkAlbumModal = $state(false)
|
let showBulkAlbumModal = $state(false)
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,6 @@
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import Modal from './Modal.svelte'
|
import Modal from './Modal.svelte'
|
||||||
import Button from './Button.svelte'
|
import Button from './Button.svelte'
|
||||||
import Input from './Input.svelte'
|
|
||||||
import Textarea from './Textarea.svelte'
|
import Textarea from './Textarea.svelte'
|
||||||
import SmartImage from '../SmartImage.svelte'
|
import SmartImage from '../SmartImage.svelte'
|
||||||
import AlbumSelector from './AlbumSelector.svelte'
|
import AlbumSelector from './AlbumSelector.svelte'
|
||||||
|
|
@ -12,7 +11,7 @@
|
||||||
import MediaMetadataPanel from './MediaMetadataPanel.svelte'
|
import MediaMetadataPanel from './MediaMetadataPanel.svelte'
|
||||||
import MediaUsageList from './MediaUsageList.svelte'
|
import MediaUsageList from './MediaUsageList.svelte'
|
||||||
import { toast } from '$lib/stores/toast'
|
import { toast } from '$lib/stores/toast'
|
||||||
import { formatFileSize, getFileType, isVideoFile } from '$lib/utils/mediaHelpers'
|
import { getFileType, isVideoFile } from '$lib/utils/mediaHelpers'
|
||||||
import type { Media } from '@prisma/client'
|
import type { Media } from '@prisma/client'
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
|
|
@ -44,7 +43,6 @@
|
||||||
|
|
||||||
// Album management state
|
// Album management state
|
||||||
let albums = $state<Array<{ id: number; title: string; slug: string }>>([])
|
let albums = $state<Array<{ id: number; title: string; slug: string }>>([])
|
||||||
let loadingAlbums = $state(false)
|
|
||||||
let showAlbumSelector = $state(false)
|
let showAlbumSelector = $state(false)
|
||||||
|
|
||||||
// Initialize form when media changes
|
// Initialize form when media changes
|
||||||
|
|
@ -90,8 +88,6 @@
|
||||||
if (!media) return
|
if (!media) return
|
||||||
|
|
||||||
try {
|
try {
|
||||||
loadingAlbums = true
|
|
||||||
|
|
||||||
// Load albums this media belongs to
|
// Load albums this media belongs to
|
||||||
const mediaResponse = await fetch(`/api/media/${media.id}/albums`, {
|
const mediaResponse = await fetch(`/api/media/${media.id}/albums`, {
|
||||||
credentials: 'same-origin'
|
credentials: 'same-origin'
|
||||||
|
|
@ -103,8 +99,6 @@
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Error loading albums:', error)
|
console.error('Error loading albums:', error)
|
||||||
albums = []
|
albums = []
|
||||||
} finally {
|
|
||||||
loadingAlbums = false
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -38,7 +38,7 @@
|
||||||
{#if isLoading && media.length === 0}
|
{#if isLoading && media.length === 0}
|
||||||
<!-- Loading skeleton -->
|
<!-- Loading skeleton -->
|
||||||
<div class="media-grid">
|
<div class="media-grid">
|
||||||
{#each Array(12) as _, i}
|
{#each Array(12) as _}
|
||||||
<div class="media-item skeleton" aria-hidden="true">
|
<div class="media-item skeleton" aria-hidden="true">
|
||||||
<div class="media-thumbnail skeleton-bg"></div>
|
<div class="media-thumbnail skeleton-bg"></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -182,7 +182,7 @@ $effect(() => {
|
||||||
})
|
})
|
||||||
|
|
||||||
// Navigation guard: flush autosave before navigating away (only if unsaved)
|
// Navigation guard: flush autosave before navigating away (only if unsaved)
|
||||||
beforeNavigate(async (navigation) => {
|
beforeNavigate(async (_navigation) => {
|
||||||
if (hasLoaded && autoSave) {
|
if (hasLoaded && autoSave) {
|
||||||
if (autoSave.status === 'saved') {
|
if (autoSave.status === 'saved') {
|
||||||
return
|
return
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue