event.key === 'Enter' && searchLibrary()}
placeholder={mediaType === 'Movie' ? 'Search movies...' : 'Search shows...'}
/>
The suggested genre uses TMDB order as a hint, but you can change the choice before writing it back to Emby.
{#if searchError}
{searchError}
{/if}
{#if actionError}
{actionError}
{:else if actionMessage}
{actionMessage}
{/if}
{#if !searchBusy && !searchResults.length}
Search for a movie or show to start cleaning up its genres.
{:else}
{#each searchResults as item}
{@const inspection = inspections[item.id]}
Emby
{(inspection?.currentGenres || item.genres || []).join(', ') || 'None'}
{#if inspection?.error}
{inspection.error}
{:else if inspection?.item}
TMDB
{inspection.tmdb?.genres?.join(', ') || 'No genres returned'}
Match
{#if inspection.tmdb?.tmdbId}
{inspection.tmdb.source === 'providerId' ? 'Provider ID match' : 'Title search match'} · TMDB {inspection.tmdb.tmdbId}
{:else}
No TMDB match
{/if}
{#if inspection.tmdb?.genres?.length}
{/if}
{/if}
{/each}
{/if}