lint: remove unused imports and variables (8 fixes)
Co-Authored-By: Justin Edmund <justin@jedmund.com>
This commit is contained in:
parent
1cda37dafb
commit
ee31ed9a1e
6 changed files with 3 additions and 33 deletions
|
|
@ -1,4 +1,4 @@
|
||||||
type SerializableGameInfo = {
|
export type SerializableGameInfo = {
|
||||||
id: number | string | null
|
id: number | string | null
|
||||||
name: string
|
name: string
|
||||||
playtime: string | number | undefined
|
playtime: string | number | undefined
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,3 @@
|
||||||
import type { Album } from '$lib/types/lastfm'
|
|
||||||
import { logger } from '$lib/server/logger'
|
import { logger } from '$lib/server/logger'
|
||||||
|
|
||||||
export interface TrackPlayInfo {
|
export interface TrackPlayInfo {
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,4 @@
|
||||||
<script>
|
<script>
|
||||||
import { page } from '$app/stores';
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div class="error-container">
|
<div class="error-container">
|
||||||
|
|
|
||||||
|
|
@ -40,22 +40,6 @@ async function fetchRecentAlbums(fetch: typeof window.fetch): Promise<Album[]> {
|
||||||
return musicData.albums
|
return musicData.albums
|
||||||
}
|
}
|
||||||
|
|
||||||
async function fetchRecentSteamGames(fetch: typeof window.fetch): Promise<SerializableGameInfo[]> {
|
|
||||||
const response = await fetch('/api/steam')
|
|
||||||
if (!response.ok) {
|
|
||||||
throw new Error(`Failed to fetch recent game: ${response.status}`)
|
|
||||||
}
|
|
||||||
return await response.json()
|
|
||||||
}
|
|
||||||
|
|
||||||
async function fetchRecentPSNGames(fetch: typeof window.fetch): Promise<SerializableGameInfo[]> {
|
|
||||||
const response = await fetch('/api/psn')
|
|
||||||
if (!response.ok) {
|
|
||||||
throw new Error(`Failed to fetch recent game: ${response.status}`)
|
|
||||||
}
|
|
||||||
return await response.json()
|
|
||||||
}
|
|
||||||
|
|
||||||
async function fetchProjects(
|
async function fetchProjects(
|
||||||
fetch: typeof window.fetch
|
fetch: typeof window.fetch
|
||||||
): Promise<{ projects: Project[]; pagination: any }> {
|
): Promise<{ projects: Project[]; pagination: any }> {
|
||||||
|
|
|
||||||
|
|
@ -43,8 +43,6 @@
|
||||||
let filteredAlbums = $state<Album[]>([])
|
let filteredAlbums = $state<Album[]>([])
|
||||||
let isLoading = $state(true)
|
let isLoading = $state(true)
|
||||||
let error = $state('')
|
let error = $state('')
|
||||||
let total = $state(0)
|
|
||||||
let albumTypeCounts = $state<Record<string, number>>({})
|
|
||||||
let showDeleteModal = $state(false)
|
let showDeleteModal = $state(false)
|
||||||
let albumToDelete = $state<Album | null>(null)
|
let albumToDelete = $state<Album | null>(null)
|
||||||
let activeDropdown = $state<number | null>(null)
|
let activeDropdown = $state<number | null>(null)
|
||||||
|
|
@ -101,15 +99,6 @@
|
||||||
|
|
||||||
const data = await response.json()
|
const data = await response.json()
|
||||||
albums = data.albums || []
|
albums = data.albums || []
|
||||||
total = data.pagination?.total || albums.length
|
|
||||||
|
|
||||||
// Calculate album status counts
|
|
||||||
const counts: Record<string, number> = {
|
|
||||||
all: albums.length,
|
|
||||||
published: albums.filter((a) => a.status === 'published').length,
|
|
||||||
draft: albums.filter((a) => a.status === 'draft').length
|
|
||||||
}
|
|
||||||
albumTypeCounts = counts
|
|
||||||
|
|
||||||
// Apply initial filter and sort
|
// Apply initial filter and sort
|
||||||
applyFilterAndSort()
|
applyFilterAndSort()
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,6 @@
|
||||||
const media = $derived(data.items ?? [])
|
const media = $derived(data.items ?? [])
|
||||||
const currentPage = $derived(data.pagination?.page ?? 1)
|
const currentPage = $derived(data.pagination?.page ?? 1)
|
||||||
const totalPages = $derived(data.pagination?.totalPages ?? 1)
|
const totalPages = $derived(data.pagination?.totalPages ?? 1)
|
||||||
const total = $derived(data.pagination?.total ?? 0)
|
|
||||||
|
|
||||||
// Read filter states from URL
|
// Read filter states from URL
|
||||||
const filterType = $derived($page.url.searchParams.get('mimeType') ?? 'all')
|
const filterType = $derived($page.url.searchParams.get('mimeType') ?? 'all')
|
||||||
|
|
@ -149,7 +148,7 @@
|
||||||
isDetailsModalOpen = false
|
isDetailsModalOpen = false
|
||||||
}
|
}
|
||||||
|
|
||||||
async function handleMediaUpdate(updatedMedia: Media) {
|
async function handleMediaUpdate(_updatedMedia: Media) {
|
||||||
// Invalidate to reload from server
|
// Invalidate to reload from server
|
||||||
await invalidate('admin:media')
|
await invalidate('admin:media')
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue