mirror of
https://github.com/truewhile/MeBox.git
synced 2026-09-29 19:36:36 +08:00
a79bbb80a8
Soft-delete restore/purge/list and the recycle_purge job are gone. Admin delete now removes library index rows, with an optional delete_files query that also deletes local media + sidecar NFO. UI copy is renamed from 移入回收站 to 删除, with a confirm checkbox. Co-authored-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: truewhile <truewhile@users.noreply.github.com>
52 lines
1.7 KiB
TypeScript
52 lines
1.7 KiB
TypeScript
import { Database, FileText, Search, Sparkles, Trash2 } from 'lucide-react'
|
|
|
|
import type { Media } from '../types'
|
|
import { isRemoteEmbyID } from '../utils/remoteEmby'
|
|
|
|
type LibraryMovieActionsProps = {
|
|
media: Media
|
|
busy: boolean
|
|
onSmartScrape: (media: Media) => void
|
|
onManualScrape: (media: Media) => void
|
|
onProbe: (media: Media) => void
|
|
onNFO: (media: Media) => void
|
|
onDelete: (media: Media) => void
|
|
}
|
|
|
|
export function LibraryMovieActions({
|
|
media,
|
|
busy,
|
|
onSmartScrape,
|
|
onManualScrape,
|
|
onProbe,
|
|
onNFO,
|
|
onDelete,
|
|
}: LibraryMovieActionsProps) {
|
|
const buttonClass = 'flex h-8 w-8 items-center justify-center rounded-lg border border-white/70 bg-white/90 text-gray-700 shadow-sm backdrop-blur transition hover:bg-brand-50 hover:text-brand-600 disabled:opacity-50'
|
|
|
|
// 远程 Emby 条目为只读视图:刮削/探测/NFO/删除不适用。
|
|
if (isRemoteEmbyID(media.id)) {
|
|
return null
|
|
}
|
|
|
|
return (
|
|
<>
|
|
<button title="智能刮削" disabled={busy} onClick={() => onSmartScrape(media)} className={buttonClass}>
|
|
<Sparkles size={13} />
|
|
</button>
|
|
<button title="手动匹配刮削" disabled={busy} onClick={() => onManualScrape(media)} className={buttonClass}>
|
|
<Search size={13} />
|
|
</button>
|
|
<button title="探测媒体轨" disabled={busy} onClick={() => onProbe(media)} className={buttonClass}>
|
|
<Database size={13} />
|
|
</button>
|
|
<button title="写出本地 NFO" disabled={busy} onClick={() => onNFO(media)} className={buttonClass}>
|
|
<FileText size={13} />
|
|
</button>
|
|
<button title="删除" disabled={busy} onClick={() => onDelete(media)} className={`${buttonClass} hover:!bg-red-50 hover:!text-red-500`}>
|
|
<Trash2 size={13} />
|
|
</button>
|
|
</>
|
|
)
|
|
}
|