{#if files.length === 0}

No subtitle files found.

Start a scan to discover SRT files.

{:else}
{#if selectedCount > 0}
{selectedCount} {selectedCount === 1 ? "file" : "files"} selected
{#if !cleanMode}
{#if showMetadataDropup}

Metadata Source

{#each metadataDropdownOptions as option} {/each}
{/if}
{/if}
{/if}
Status Filename {cleanMode ? "Clean Scan" : "Matched Result"} {#if loading && files.length === 0} {#each Array(6) as _}
{/each} {:else if cleanMode} {#if cleanModeWithKeywords.length > 0}
Results With Keywords
{#each cleanModeWithKeywords as file (file.path)} toggleSelection(file)} class="h-4 w-4 rounded border-input bg-background text-accent focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring" /> {file.name}
Detected: {file.clean_keywords.join(", ")}
Clean only
{#if expandedRows[file.path]}
Detected Keywords
{file.clean_keywords.join(", ")}
Cleanup Summary
{file.summary || "No changes needed"}
{/if} {/each} {/if} {#if cleanModeNoKeywords.length > 0}
Clean Files (No Keywords Found)
{#each cleanModeNoKeywords as file (file.path)} toggleSelection(file)} class="h-4 w-4 rounded border-input bg-background text-accent focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring" /> {file.name}
Detected: None
Clean only
{#if expandedRows[file.path]}
Detected Keywords
None
Cleanup Summary
{file.summary || "No changes needed"}
{/if} {/each} {/if} {:else} {#each paginatedFiles as file (file.path)} toggleSelection(file)} class="h-4 w-4 rounded border-input bg-background text-accent focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring" /> {file.name} {#if cleanMode}
{#if file.clean_keywords && file.clean_keywords.length > 0} Detected: {file.clean_keywords.join(", ")} {:else} Detected: None {/if}
{:else}
{getTitle(file)} {#if file.title} {/if}
{#if suggestedMatches[file.path]}
→ Matched: {suggestedMatches[file.path]?.title || "Unknown"} ({suggestedMatches[ file.path ]?.year || "N/A"})
{/if}
{#if matchingProgress[file.path]} {#if matchingProgress[file.path] === "matching"}
Matching
{:else if matchingProgress[file.path] === "matched"}
Matched
{:else if matchingProgress[file.path] === "no-match"}
No Match
{:else if matchingProgress[file.path] === "error"}
Error
{/if} {/if}
{/if}
{#if cleanMode} Clean only {:else} {#if suggestedMatches[file.path]} {/if} {/if}
{#if expandedRows[file.path]} {#if cleanMode}
Detected Keywords
{#if file.clean_keywords && file.clean_keywords.length > 0} {file.clean_keywords.join(", ")} {:else} None {/if}
Cleanup Summary
{file.summary || "No changes needed"}
{:else}
Rating
{getRating(file) !== "N/A" ? "⭐ " + getRating(file) : "N/A"}
Runtime
{getRuntime(file) !== "N/A" ? "⏱ " + getRuntime(file) : "N/A"}
Year
{file.year || "N/A"}
Plot Summary
{#if file.plot || file.summary} {file.plot || file.summary} {:else} Not loaded {/if}
{/if}
{/if} {/each} {/if}
{#if totalPages > 1}
Showing {pageStart}-{pageEnd} of {files.length} files
{#each Array(totalPages) as _, i} {@const page = i + 1} {#if page === 1 || page === totalPages || (page >= currentPage - 1 && page <= currentPage + 1)} {:else if page === currentPage - 2 || page === currentPage + 2} ... {/if} {/each}
{/if}
{#if !cleanMode && (hasMatches || bulkApplying)}
{#if bulkApplying}
Processing {bulkApplyProgress.current} of {bulkApplyProgress.total} files...

{bulkApplyProgress.currentFile || "Starting..."}

{Math.round( (bulkApplyProgress.current / bulkApplyProgress.total) * 100, ) || 0}%
{#if bulkApplyResults.length > 0}
{#each bulkApplyResults.slice(-5) as result} {#if result.success} {:else} {/if} {result.file} {/each}
{/if}
{:else}
{#if matchedFilesCount > 0} {matchedFilesCount} {matchedFilesCount === 1 ? "file" : "files"} matched and ready

Review the suggested matches above, then click "Bulk Apply" to process all

{:else} Matching complete

All files have been processed or matched

{/if}
{#if matchedFilesCount > 0} {/if}
{/if}
{/if}
{/if} {#if openSearchDropdown} {@const file = files.find((f) => f.path === openSearchDropdown)} {#if file}

{file.status === "Has Plot" ? "Update Plot" : "Add Plot"}

handleSearchInput(file, e)} on:keydown={(e) => handleSearchKeydown(file, e)} placeholder="Search for title..." class="w-full px-3 py-2 pr-10 text-[13px] bg-bg-primary border border-white/20 focus:border-accent rounded-lg transition-all focus:outline-none" /> {#if searchingInline[file.path]}
{:else} {/if}
{#if inlineSearchResults[file.path]?.length === 0}

No results found for "{searchInputValues[file.path]}"

Try a different search term or use auto-detection

{:else if inlineSearchResults[file.path]}
{#each [...inlineSearchResults[file.path]].sort((a, b) => { const yearA = parseInt(a.year) || 0; const yearB = parseInt(b.year) || 0; return yearB - yearA; }) as result} {/each}
{/if}
{/if} {/if} {#if showPreview && previewFile}
e.key === "Escape" && closePreview()} >
{/if} {#if showTitleSelector && titleSelectorFile}
e.key === "Escape" && closeTitleSelector()} >
{/if} {#if hoveredPlot}
Full Plot
{hoveredPlot.plot || hoveredPlot.summary}
{/if}