Compare commits

...
48 Commits
Author SHA1 Message Date
poli0981 baa7f4f0b7 Merge pull request #26 from poli0981/feat/v0.5-phase6-final
Phase 6 + v0.5.0: A/B variants, template cloning, copyright + usage policy
2026-04-23 21:18:28 +07:00
poli0981andClaude Opus 4.7 42bc7e8b6d feat(v0.5): A/B title variants, template cloning, copyright + usage policy
Phase 6 closes v0.5.0. Ships the last two roadmap features plus the two
description-footer additions the user requested mid-flight.

## A/B title variants

New `src/engine/title-variants.ts` exposes a pure `buildTitleVariants`
that reuses `buildTitle` and `buildQualityBadge` to produce 3 phrasings:

- default:      Game — Type [2K] — suffix
- typeFirst:    Type — Game [2K] — suffix
- qualityFirst: [2K] Game — Type — suffix

`qualityFirst` collapses to the default shape when no badge exists so
callers never see two identical variants.

UI: `VariantPicker` modal opens from the Output page's "Generate
alternatives" button. Each variant has its own CharCounter + Copy.

## Template cloning ("Save as Template")

New `src/store/template-store.ts` persists full-form snapshots of the
editor (`TemplateSnapshot` matches editor-store's partialize shape so
`loadProfile()` can restore everything). Dual-write to file-backed
storage alongside the other stores.

- Output page header gains "Save as Template" → modal prompting a
  name, saves the entire editor state.
- Profiles page gains a third tab "Templates" with list / apply /
  delete, plus export / import JSON — matches the existing preset
  tab pattern.

## Copyright footer (new)

`description-builder` appends section 13.5 between CTA and hashtags
when `showCopyright` is on AND `channelName` is non-empty:

  © 2026 TestChannel. All rights reserved.

`RenderOptions.showCopyright` (default true) threads through
`renderAll` → both hooks → BatchPage. Settings toggle added in Tags
section. Skipping when channelName is blank prevents orphan
"©  . All rights reserved." lines.

## Usage policy block (new)

Section 13.7 — localised fixed template behind `showUsagePolicy`
(default off). Uses the 5-bullet "how to reuse my footage" block
supplied by the user, translated to all 6 locales with plain-text
bullets (YouTube descriptions don't render markdown).

All 6 locales gain:

- `description.sections.copyright` (interpolates year + channelName)
- `description.sections.usagePolicyHeader` (e.g. 📋 USAGE POLICY)
- `description.sections.usagePolicy` (multi-line body)

## i18n

Schema grew to 273 ui + 84 templates keys. Added namespaces:
- `ui.output` — `generateAlternatives`, `saveAsTemplate`,
  `variants.{default, typeFirst, qualityFirst}`
- `ui.templates` — title, createNew, saveAsTemplate, templateName,
  templateNamePlaceholder, loadTemplate, deleteConfirm, emptyState,
  saveHint, savedAs, appliedToast, export/importTemplates
- `ui.settings` — showCopyright, showUsagePolicy

## Signature change

`buildDescription(input, t, hashtagCount)` → `buildDescription(input,
t, options?)` where options is `{ hashtagCount, showCopyright,
showUsagePolicy }`. All internal callers updated; no public API
exposed outside the engine.

## Version bump

`package.json`, `src-tauri/tauri.conf.json`, `src-tauri/Cargo.toml` →
`0.5.0`. CLAUDE.md updated to mention `title-variants.ts` and
`template-store.ts`.

## Tests

129 passing (+13 new):
- 7 title-variants tests — shape, ordering, badge on/off, fallback
  when no badge, mod name interpolation.
- 6 description-builder tests — copyright render/skip/no-channel,
  usage policy render/skip, footer order (CTA → copyright → policy
  → hashtags).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-23 21:17:08 +07:00
poli0981 8d5803f38d Merge pull request #25 from poli0981/feat/v0.5-phase5-accordion-polish
Phase 5: accordion editor layout + CharCounter polish + Ctrl+G
2026-04-23 20:51:12 +07:00
poli0981andClaude Opus 4.7 43082a13ad feat(editor): accordion layout + CharCounter polish + Ctrl+G shortcut
Phase 5 of the v0.5 roadmap. Regroups the editor's 12+ flat sections
into 6 collapsible accordions so the form doesn't require 40-row
scrolling to reach the less-used fields.

## Accordion layout

New `Accordion` UI component (controlled, animated via grid-rows
transition so any child height works without measurement). EditorPage
re-organises every existing input into 6 stable sections:

  1. Game Info           — language, genres, preset loader, game info
  2. Video Settings      — video type + its extra fields + resolution/fps
  3. Content Details     — timestamps, warnings, playlist, contact email
  4. Attribution         — music, thumbnail text, pinned comment
  5. My Rig              — hardware fields
  6. Store & Social      — store links + social links

Open state is controlled from `settings-store.editorAccordionState`
and persisted through the existing `partialize` + file-backed
snapshot. Defaults open the first two sections so new users see
"Game Info" and "Video Settings" immediately; attribution / rig /
store & social start collapsed to reduce visible scroll.

## GameInfoForm split

The video-type-specific fields (partNumber, bossName, dlcName,
challengeName, modName) lived inside GameInfoForm, which forced them
into the wrong accordion. Moved them to a new `ExtraFieldsInput`
component so they live with the video-type picker in Video Settings.

## CharCounter polish

- Threshold bumped from strict `> 80%` to `>= 80%` — the plan's
  cutoff, matching what creators expect when they think "80%".
- Warning and over-limit states switch to `font-semibold` so the
  number pops without needing coloured backgrounds (which the app's
  CSS-var theme can't express cleanly via Tailwind opacity
  modifiers).

## Ctrl+G generate shortcut

Added alongside the existing Ctrl+Enter. Both navigate to the Output
page. ShortcutHelpModal now lists Ctrl+G first (matching the v0.5
spec) while keeping Ctrl+Enter as an alternative.

## i18n

All six locales gain `editor.sections.{gameInfo, videoSettings,
contentDetails, attribution, rig, storeAndSocial}`. Schema bumped;
validate:locales shows 253/253 ui keys × 6 locales.

Tests: 116 passing (no engine change, no new tests needed).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-23 20:50:05 +07:00
poli0981 4d38d68a45 Merge pull request #24 from poli0981/feat/v0.5-phase4-data-fields
Phase 4: music attribution + thumbnail text + pinned comment
2026-04-23 20:38:45 +07:00
poli0981andClaude Opus 4.7 2474cb68ba feat(editor): music attribution, thumbnail text, and pinned comment fields
Phase 4 of the v0.5 roadmap. Adds three data fields that gameplay
YouTubers manage manually today — keeps everything inside YTDescGen so
workflow stays single-app.

## Music / sound attribution

- New `musicAttribution` field on GeneratorInput and editor-store.
- When non-empty, description-builder emits a "🎵 MUSIC / SOUND"
  section right before the donate block (both are credit-adjacent).
- Threaded through `useGeneratedOutput`, `useMultilangOutput`, and the
  BatchPage render loop so every language and part picks it up.
- New template key `description.sections.music` in all six locales.

## Thumbnail text helper

- `thumbnailText` field on editor-store. Never touches the engine —
  it's a creator-private draft so a designer (or the creator) can
  copy the thumbnail overlay text separately.

## Pinned comment template

- `pinnedComment` field on editor-store. Kept out of the description
  on purpose: YouTube treats the pinned comment as its own surface,
  so the text ships via its own copy button, not inlined.

## UI

- Three new editor components (ThumbnailHelper, PinnedCommentEditor,
  MusicAttributionEditor), each a thin Textarea wired into the store.
- EditorPage renders them after WarningToggles and before the store/
  rig/social blocks — roughly the "Attribution" cluster.
- New OutputExtras component on OutputPage shows thumbnail text and
  pinned comment as standalone sections (with their own Copy
  buttons) only when the corresponding field has content.

## i18n

All six locales gain:
- editor: `thumbnailText`, `thumbnailTextPlaceholder`, `pinnedComment`,
  `pinnedCommentPlaceholder`, `musicAttribution`,
  `musicAttributionPlaceholder`
- output: `thumbnailText`, `copyThumbnailText`, `pinnedComment`,
  `copyPinnedComment`
- templates: `description.sections.music` (the section header)

Schema bumped; validate:locales shows 247/247 ui + 81/81 templates.

## Tests

116 passing (+3 new): music section rendered, order vs donate section,
blank/whitespace skipped.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-23 20:37:24 +07:00
poli0981 3e2fbd838a Merge pull request #23 from poli0981/feat/v0.5-phase3-quality-badge-video-types
Phase 3: quality badge in title + mods/collectibles video types
2026-04-23 20:23:50 +07:00
poli0981andClaude Opus 4.7 e5314ce09c feat(title): quality badge + mods and collectibles video types
Phase 3 of the v0.5 roadmap. Brings two related title-surface upgrades.

## Quality badge "[2K 60FPS]"

- New `buildQualityBadge` helper in title-builder renders a compact
  badge after the video-type segment when resolution/fps are above the
  defaults:
    1080p 60fps → no badge
    1440p 60fps → "[2K]"
    4K 120fps → "[4K 120FPS]"
    1080p 120fps → "[1080p 120FPS]" (resolution retained so a lonely
    fps isn't ambiguous)
  1440p maps to "2K" for title scannability; 720p and 4K pass through.
- Example output:
    Elden Ring — Part 5 [2K] — Gameplay No Commentary
- Settings toggle `showQualityBadge` (default true, in Tags section)
  lets creators opt out.
- `RenderOptions.showQualityBadge` threads through `renderAll`,
  `useGeneratedOutput`, `useMultilangOutput`, and the BatchPage render
  loop.

## Mods + Collectibles video types

Two new entries in VIDEO_TYPES for gameplay channels that frequently
make this kind of content:

- `mods` (icon 🧩): extra field `modName`. Title renders as
  "{{modName}} Mods" (e.g. "Requiem Mods"). Intro template names the
  mod. Tag pool: "mods", "modded gameplay", "mod showcase", etc.
- `collectibles` (icon ⭐): no extra fields. Title "All Collectibles".
  Tag pool covers 100% collectibles, completionist run, achievement
  guide.

GameInfoForm renders the modName input when the video type is `mods`.
`GeneratorInput.modName` is optional and threaded through both title
and description builders.

## i18n

All six locales (en/vi/ja/es/ko/zh) gain:
- `title.videoType.mods` + `.collectibles` (title templates)
- `description.intro.mods` + `.collectibles` (intro templates)
- `videoTypes.mods` + `.collectibles` (UI labels)
- `editor.modName` + `.modNamePlaceholder`
- `settings.showQualityBadge`

Schema bumped; validate:locales shows 237/237 ui + 80/80 templates.

## Tests

113 passing (+15 new). New coverage:
- 6 buildQualityBadge unit tests (all resolution/fps combinations)
- 6 buildTitle tests for badge placement, override, and both new
  video types
- 2 tag-generator tests for the new VIDEO_TYPE_TAGS entries

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-23 20:22:07 +07:00
poli0981 f6d8dfe51e Merge pull request #22 from poli0981/feat/v0.5-phase2-multi-genre
Phase 2: multi-select genres (42 total) with persist migrations
2026-04-23 20:10:07 +07:00
poli0981andClaude Opus 4.7 32e2e1e90e feat(genres): multi-select genres with 15 new granular sub-genres
Phase 2 of the v0.5 roadmap. Turns the single-genre picker into a
multi-select (max 3) and doubles the genre catalogue to 42 entries
so creators can tag a game like Elden Ring as "Action + Action RPG +
Souls-like" instead of picking one.

## Engine — breaking change to GeneratorInput

- `GeneratorInput.genre: Genre` became `genres: Genre[]`. The first
  entry drives the genre hashtag and trending-tag template; all
  selected genres contribute to the tag pool and the final dedup
  collapses overlap.
- New `MAX_GENRES = 3` constant.
- 15 new `GENRE_TAG_REGISTRY` entries, each with 3-4 genre-specific
  tag phrases: hack_slash, beatemup, platformer, survival_horror,
  psychological_horror, jrpg, action_rpg, arena_shooter, tactical_fps,
  boomer_shooter, extraction_shooter, shmup, city_builder, deck_builder,
  auto_battler.

## Stores — zustand persist migrations

All four persisted stores bump to version 2 and migrate v1 → v2
in-place so existing drafts, settings, presets, and history survive:

- editor-store: `genre` → `genres[]`
- settings-store: `defaultGenre` → `defaultGenres[]`
- preset-store: `GamePreset.genre` → `genres[]` (plus import normalisation)
- history-store: `HistoryEntry.genre` → `genres[]`

## UI

- ChipGroup gains a `multiple` mode with optional `max`. When the cap
  is reached, unselected chips disable and a counter (e.g. 2/3) shows
  next to the label.
- GenreSelector and the Settings page's default-genre field both use
  the new multi-select chip group.
- PresetCard renders every selected genre as a chip instead of just
  the first one.

## i18n

All 6 locales (en/vi/ja/es/ko/zh) gain 15 genre labels. The schema
(`_schema.json`) is updated to match so `npm run validate:locales`
stays strict. Tests: 98 passing (+1 new multi-genre hashtag test).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-23 20:08:39 +07:00
poli0981 9e99335d41 Merge pull request #21 from poli0981/feat/v0.5-phase1-bugs
Phase 1: fix underscore leaks + Tauri settings-folder opener
2026-04-23 19:49:05 +07:00
poli0981andClaude Opus 4.7 0979cfb3cc fix(tauri): open settings folder via opener plugin
The existing "Open Folder" button called tauri-plugin-shell.open() but
the default capability only grants shell:default, which excludes
allow-open, so every click toast-failed with "Could not open settings
folder".

Swap to the purpose-built tauri-plugin-opener (v2), which is the
recommended way to reveal files/folders in the host file manager:

- Cargo.toml: add tauri-plugin-opener = "2"
- lib.rs: register the plugin
- capabilities/default.json: grant opener:default plus
  allow-open-path and allow-reveal-item-in-dir scoped to $APPDATA (the
  only directory the UI ever opens)
- package.json: add @tauri-apps/plugin-opener
- SettingsPage.tsx: call openPath(dir) from the opener plugin

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-23 19:47:56 +07:00
poli0981andClaude Opus 4.7 d07b3fb3fa fix(engine): sanitise hashtags and humanise snake_case rig keys
Three underscore leaks were surfacing in the generated output:

- Rig section printed snake_case keys as-is (VIDEO_EDITOR:), now the key
  is split on underscore before upper-casing (VIDEO EDITOR:).
- Genre hashtag included the raw id (#visual_novel), now goes through a
  new sanitiseHashtag that drops every non-letter/digit so game names
  with punctuation also work (#STALKER2, #YakuzaLikeaDragon).
- Trending tag template interpolated the raw genre id ("best
  visual_novel games 2026"), now humanised via humanizeId.

Also narrows the store-links filter with a type predicate to remove a
pre-existing non-null assertion that was failing ESLint on main.

Adds 16 new tests covering the sanitiser, rig humanisation, hashtag
sanitising, and trending-tag humanisation.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-23 19:47:23 +07:00
poli0981 186252b18f Merge pull request #20 from poli0981/chore/bump-version-0.4.0
chore: bump version to 0.4.0
2026-04-15 17:04:00 +07:00
poli0981andClaude Opus 4.6 252c2c589f chore: bump version to 0.4.0
Covers everything merged since v0.2.0:
- Phase A (PR #9-#15): tray Quit fix, drop macOS from release matrix,
  playlist title simplification, full_demo/demo_part video types,
  per-language tag scoping + visual_novel genre, timeline i18n parser.
- Phase B (PR #16-#19): proper Steam/itch.io URL regex with Steam
  normalize, invalid URLs no longer commit to the output, rig
  Video Editor dropdown + version, per-link Free/Paid/Demo type with
  dynamic GET/DOWNLOAD heading.

Bumps package.json, package-lock.json, src-tauri/Cargo.toml,
src-tauri/Cargo.lock, and src-tauri/tauri.conf.json.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-15 17:02:35 +07:00
poli0981 5f237012ea Merge pull request #19 from poli0981/feat/store-link-type
feat(store-links): per-link Free/Paid/Demo type with dynamic heading
2026-04-15 14:57:46 +07:00
poli0981andClaude Opus 4.6 f14b898d98 feat(store-links): per-link Free/Paid/Demo type with dynamic heading
Adds a parallel storeLinkTypes map to the editor store and GeneratorInput
so each store link can be classified as paid, free, or demo. Missing
entries default to "paid" so pre-existing drafts keep rendering
identically.

- Engine: new StoreLinkType union; description-builder picks a heading
  by majority (>50% non-paid → DOWNLOAD THE GAME, otherwise GET THE GAME)
  and appends a (free) or (free demo) suffix per link.
- Locales: the old description.sections.storeLinks key is replaced by
  storeLinksBuy / storeLinksDownload + a storeLinkSuffix block across
  all 6 templates.json files. ui.json gains editor.storeLinkType and a
  storeLinkTypes namespace.
- UI: StoreLinkEditor now renders a Type select next to each URL input.
  setStoreLinkType action added to editor-store.
- 6 new description-builder tests cover majority rule, tie-breaking,
  demo/free suffixes, and the paid default fallback.

No migration is required because storeLinkTypes starts empty and the
engine treats missing entries as "paid".

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-15 14:57:22 +07:00
poli0981 77a4ef1d9c Merge pull request #18 from poli0981/feat/rig-video-editor
feat(rig): add Video Editor dropdown + version field
2026-04-15 14:43:43 +07:00
poli0981andClaude Opus 4.6 e3ecfc20a4 feat(rig): add Video Editor dropdown + version field
Extends the rig config with a new field type 'dropdown_with_version'
so users can pick their video editor from a curated list (DaVinci
Resolve / Studio, Premiere, After Effects, CapCut, Vegas, Final Cut,
Kdenlive, Shotcut, Filmora, Other) and free-type the version number.

- src/config/rig-fields.ts: new RigField shape, VIDEO_EDITOR_OPTIONS
  list, and a formatRigValue() helper that expands the stored
  "<id>|<version>" form into "Brand Name X.Y" for description output.
- RigEditor renders a Select + version Input pair for the new field
  type, falling back to Input for text fields.
- description-builder pipes rig values through formatRigValue.
- New 'editor.version' and 'rig.video_editor' keys in all 6 ui.json
  locales; schema updated accordingly.
- 7 new tests for formatRigValue edge cases.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-15 14:43:33 +07:00
poli0981 17e7d0dd6c Merge pull request #17 from poli0981/fix/url-invalid-not-committed
fix(validation): clear committed value when URL is invalid
2026-04-15 14:39:14 +07:00
poli0981andClaude Opus 4.6 7c77e8ed18 fix(validation): clear committed value when URL is invalid
ValidatedInput now commits an empty string (not the raw input) when a
field fails validation, while preserving the user's typed text in the
local displayValue so they can keep editing. This prevents invalid URLs
from landing in the generated description/tags — the existing
description-builder filters on empty strings, so bad links silently drop
out until they become valid again.

Warnings (e.g. prefix mismatch) continue to commit so the user can
override, but hard errors from validateUrlWithPattern now block the
commit path entirely.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-15 14:39:04 +07:00
poli0981 efebd24492 Merge pull request #16 from poli0981/fix/url-validation-platforms
fix(platforms): proper URL regex for Steam + itch.io with normalize
2026-04-15 14:37:43 +07:00
poli0981andClaude Opus 4.6 5871a482c7 fix(platforms): proper URL regex for Steam + itch.io with Steam normalize
Platform config now carries an authoritative urlPattern RegExp (and an
optional normalize() hook) instead of a naive startsWith() prefix check.

- Steam: https://store.steampowered.com/app/<id> with optional trailing
  slug. A normalizer strips the slug so committed URLs are canonical.
- itch.io: enforces the https://<dev>.itch.io/<game> subdomain form and
  rejects the bare https://itch.io/ host.
- validateUrlWithPattern() added to utils/validation for platform-scoped
  checks; prefix-mismatch is now a hard error instead of a silent warning.
- StoreLinkEditor uses the new validator and normalizes Steam URLs on
  commit.
- 13 new unit tests covering Steam accept/reject/normalize and itch.io
  accept/reject.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-15 14:37:24 +07:00
poli0981 2dc4cc3ac6 Merge pull request #15 from poli0981/feat/timeline-i18n
feat(timeline): parse and localize chapter markers
2026-04-15 13:50:46 +07:00
poli0981andClaude Opus 4.6 97a63d36f7 feat(timeline): parse and localize chapter markers
Adds a pure timeline parser (src/engine/timeline-parser.ts) that
recognizes common chapter markers across 6 languages (Chapter/Part/
Boss/Final Boss/Intro/Ending/Tutorial/Credits, in en/vi/ja/es/ko/zh),
extracts ordinal numbers, and re-renders the block in the user's
output language using a new templates.json 'timeline.keywords' namespace.

- New engine module: timeline-parser.ts with parseTimeline / renderTimeline
- description-builder now runs raw timestamps through parse+render so
  'Chapter 1' becomes 'Chương 1' when language is Vietnamese
- All 6 locales gain the timeline.keywords block (en/vi/ja/es/ko/zh)
- Schema updated, 12 new unit tests for the parser/renderer

Unrecognized labels are kept verbatim so the user's free-form notes
survive the round-trip.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-15 13:50:37 +07:00
poli0981 bf1d71a2bb Merge pull request #14 from poli0981/feat/tag-generator-upgrade
feat(tags): scope tags to selected language, add visual_novel genre
2026-04-15 13:46:10 +07:00
poli0981andClaude Opus 4.6 a4e49f417f feat(tags): scope tags to selected language, add visual_novel genre
- Multilingual tags now honor the selected language instead of always
  emitting every language pool. Picking 'vi' no longer injects Japanese,
  Korean, or Chinese tags.
- Core tag pool is now language-specific (CORE_TAGS_BY_LANG) so the
  highest-priority tags match the viewer's region.
- New genre 'visual_novel' added to engine types, GENRE_TAG_REGISTRY,
  config/genres.ts, schema, and all 6 ui.json locales.
- Expanded several genre tag pools (story, indie, action, horror, etc.)
  so common searches aren't missed.
- Engine types updated with full_demo / demo_part / visual_novel.
- tag-generator tests updated to verify per-language isolation and new
  genre/video-type pools.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-15 13:46:01 +07:00
poli0981 535e4f7a8c Merge pull request #13 from poli0981/chore/cleanup-vite-cache
chore: clean up .vite cache + PHASE-4.1.md from main
2026-04-15 13:38:04 +07:00
poli0981andClaude Opus 4.6 91708ee95f chore: remove accidentally committed .vite/ cache and PHASE-4.1.md
PR #12 accidentally committed the Vite dep cache and a local planning
note. This removes them from the tree and adds .vite/ to .gitignore
so it can't happen again.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-15 13:37:56 +07:00
poli0981 793332b60c Merge pull request #12 from poli0981/feat/demo-video-types
feat(video-types): add 'full_demo' and 'demo_part'
2026-04-15 13:35:17 +07:00
poli0981andClaude Opus 4.6 e68d98df52 feat(video-types): add 'full_demo' and 'demo_part' video types
Introduces two new video types for demo coverage: 'full_demo' (complete
demo playthrough) and 'demo_part' (part-based demo series, reuses
partNumber field). Both wire through config, tag-generator pools,
schema, and all 6 locale templates.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-15 13:35:07 +07:00
poli0981 9f09e53d73 Merge pull request #11 from poli0981/feat/playlist-title-format
feat(playlist): simplify title format to '[status] - Game Name'
2026-04-15 13:32:41 +07:00
poli0981andClaude Opus 4.6 9877671cae feat(playlist): simplify title format to '[status] - Game Name'
Drop the 'Gameplay No Commentary' suffix and em-dash separators from
the playlist title format across all 6 locales. Titles are now
'{{status}} - {{gameName}}' (e.g. '✅ Completed - Elden Ring').

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-15 13:32:32 +07:00
poli0981 9f76b07cb0 Merge pull request #10 from poli0981/ci/remove-macos
ci: drop macOS from desktop release matrix
2026-04-15 13:31:28 +07:00
poli0981andClaude Opus 4.6 d8a2780fe2 ci: drop macOS from desktop release matrix
Only Windows is supported for desktop releases going forward. Removes
both aarch64-apple-darwin and x86_64-apple-darwin matrix entries.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-15 13:31:11 +07:00
poli0981 c590e5a0a2 Merge pull request #9 from poli0981/fix/tray-quit
fix(tauri): tray Quit now actually exits the app
2026-04-15 13:30:40 +07:00
poli0981andClaude Opus 4.6 0c1df9d31f fix(tauri): tray Quit now actually exits the app
Introduce an AtomicBool 'quitting' flag set when the user picks Quit
from the tray menu. Window CloseRequested and RunEvent::ExitRequested
check this flag: when false, the app stays alive (close-to-tray); when
true, the exit proceeds normally.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-15 13:29:47 +07:00
poli0981 16dddb747e chore: update Tauri config version to 0.2.0 2026-04-08 19:52:50 +07:00
poli0981 68fbb957ea chore: update project version to 0.2.0 in package and Cargo files 2026-04-08 19:36:29 +07:00
poli0981 fd8d50a19c chore: bump version to 0.2.0 2026-04-08 19:25:18 +07:00
poli0981 fc3bab06ab Merge pull request #8 from poli0981/fix/tray-icon-builder-api
fix(tauri): remove extra arg from TrayIconBuilder::with_id
2026-04-08 18:46:07 +07:00
poli0981andClaude Opus 4.6 fd6f28529f fix(tauri): remove extra arg from TrayIconBuilder::with_id
TrayIconBuilder::with_id in Tauri 2.10.3 takes only the ID argument.
The app handle is passed via .build(app), fixing macOS CI build failure.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-08 18:45:28 +07:00
poli0981 2b2ca7f65f Merge pull request #7 from poli0981/feat/log-viewer-tab
feat: real-time log viewer tab
2026-04-08 15:55:19 +07:00
poli0981andClaude Opus 4.6 adfade87b9 feat: real-time log viewer tab with global error capture
Log infrastructure:
- log-store.ts: Zustand in-memory store (500 max entries, no persist)
- logger.ts: standalone utility (logger.error/warn/info/debug)
  works outside React via useLogStore.getState()
- use-global-error-handler.ts: captures window.onerror and
  unhandledrejection events, mounted in AppShell

Log viewer UI:
- LogPage: level filter chips (All/Error/Warn/Info/Debug), search,
  clear all, auto-scroll toggle, entry count with error/warn badges
- LogEntry: colored level badge, source tag, timestamp, message,
  expandable details/stacktrace, copy + delete per entry

Instrumentation:
- storage-adapter.ts: 4 catch blocks now log to logger
- use-clipboard.ts: catch → logger.error("clipboard", ...)
- SettingsPage.tsx: 2 catches → logger.error("settings", ...)

Navigation:
- /logs route (lazy-loaded), ScrollText icon in TabBar
- i18n: logs.* keys in all 6 languages (208 UI keys each)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-08 15:54:27 +07:00
poli0981 f781647320 Merge pull request #6 from poli0981/fix/lang-sync-ui-settings-health
fix: output language sync, card UI, settings file ops, data health check
2026-04-08 15:32:25 +07:00
poli0981andClaude Opus 4.6 27afedb460 fix: output language sync, card UI, settings file ops, data health check
#5 Fix output language not syncing with editor selection:
- use-generated-output.ts: replaced useTranslation("templates") (global app
  language) with i18n.getFixedT(state.language, "templates") so QuickPreview
  and OutputPage render templates in the editor's selected output language

#6 Card UI more visible:
- ProfileCard, PresetCard, HistoryCard: changed from bg-surface-1 border-border
  to bg-surface-2 border-border-strong with shadow-md and hover:border-accent/30

#1 Open/Save settings file (Tauri desktop):
- SettingsPage: added "Open Folder" button (opens appDataDir in file explorer)
  and "Export" button (saves settings.json via native save dialog)
- Only shown when running in Tauri

#4 Data file health check on startup:
- storage-adapter.ts: added checkDataFileHealth() — checks if Tauri settings
  file exists and is valid JSON; if missing/corrupt, rebuilds from localStorage
- App.tsx: calls health check on mount, shows toast warning if file was restored

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-08 15:31:36 +07:00
poli0981 f55f0e65c3 Merge pull request #5 from poli0981/feat/phase4.1-fixes-improvements
feat: Phase 4.1 — Bug fixes, validation, playlist generator
2026-04-08 15:03:20 +07:00
poli0981andClaude Opus 4.6 e2e789beeb feat: Phase 4.1 — Bug fixes, validation, playlist generator, FMV genre
Bug fixes:
- Storage adapter: dual localStorage + file persistence for Tauri
- All 4 stores (settings, profiles, presets, history) now dual-write via subscriber
- Tauri: save_to_file creates parent dirs, tray with fixed ID + tooltip
- Tauri: hide-on-close (prevent_close), keep alive in tray (prevent_exit)
- Description builder: uses proper brand labels (Steam, PayPal) instead of IDs
- Social fields restructured: added label field for direct use in output

Input validation:
- validateEmails() — 1-3 comma-separated emails
- validateUrl() / validateUrlWithPrefix() — URL format validation
- ValidatedInput component with error display
- Applied to contactEmail, playlistLink, store links, social links

Unified language selection:
- Renamed defaultLanguage → appLanguage with browser locale detection
- Header: custom dropdown quick-switch (flag + name)
- Settings page: clear App Language vs Output Language labels

New features:
- FMV genre (26 total) with tag pool
- New social: Bluesky, Mastodon, Facebook, FB Page, FB Group (17 total)
- Social icons in description output (emoji per platform)
- Playlist template generator: 4 statuses × 8 content types
- PlaylistPage with status/content-type chips, output preview, copy
- Batch mode: multi-language per part (select languages, grouped output)

i18n: 202 UI keys + 61 template keys across 6 languages (all validated)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-08 15:02:15 +07:00
101 changed files with 17803 additions and 590 deletions

No files matched your search

-4
View File
@@ -14,10 +14,6 @@ jobs:
include:
- os: windows-latest
target: x86_64-pc-windows-msvc
- os: macos-latest
target: aarch64-apple-darwin
- os: macos-latest
target: x86_64-apple-darwin
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
+1
View File
@@ -1,5 +1,6 @@
node_modules/
dist/
.vite/
.env
.env.*
*.local
+4 -2
View File
@@ -75,7 +75,8 @@ yt-desc-gen/
│ │ └── _schema.json # JSON schema for locale validation
│ │
│ ├── engine/ # Core template engine (pure functions, no React)
│ │ ├── title-builder.ts # Title generation logic
│ │ ├── title-builder.ts # Title generation + quality-badge helper
│ │ ├── title-variants.ts # A/B variant title generator (v0.5)
│ │ ├── description-builder.ts # Description generation logic
│ │ ├── tag-generator.ts # Tag generation + dedup + char limit
│ │ ├── template-renderer.ts # Orchestrator: combines title + desc + tags
@@ -85,8 +86,9 @@ yt-desc-gen/
│ │ ├── editor-store.ts # Current editor form state
│ │ ├── profile-store.ts # Saved profiles (social, rig, channel)
│ │ ├── preset-store.ts # Game presets (name + store links)
│ │ ├── template-store.ts # Full-form snapshots (v0.5)
│ │ ├── history-store.ts # Generated output history
│ │ └── settings-store.ts # App settings (theme, default language)
│ │ └── settings-store.ts # App settings (theme, default language, description toggles)
│ │
│ ├── hooks/ # Custom React hooks
│ │ ├── use-generated-output.ts # Memoized template rendering
+12 -2
View File
@@ -1,16 +1,17 @@
{
"name": "yt-desc-gen",
"version": "0.1.0",
"version": "0.5.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "yt-desc-gen",
"version": "0.1.0",
"version": "0.5.0",
"dependencies": {
"@tauri-apps/api": "^2.0.0",
"@tauri-apps/plugin-dialog": "^2.0.0",
"@tauri-apps/plugin-fs": "^2.0.0",
"@tauri-apps/plugin-opener": "^2.0.0",
"@tauri-apps/plugin-shell": "^2.0.0",
"clsx": "^2.1.0",
"i18next": "^23.15.0",
@@ -1513,6 +1514,15 @@
"@tauri-apps/api": "^2.10.1"
}
},
"node_modules/@tauri-apps/plugin-opener": {
"version": "2.5.3",
"resolved": "https://registry.npmjs.org/@tauri-apps/plugin-opener/-/plugin-opener-2.5.3.tgz",
"integrity": "sha512-CCcUltXMOfUEArbf3db3kCE7Ggy1ExBEBl51Ko2ODJ6GDYHRp1nSNlQm5uNCFY5k7/ufaK5Ib3Du/Zir19IYQQ==",
"license": "MIT OR Apache-2.0",
"dependencies": {
"@tauri-apps/api": "^2.8.0"
}
},
"node_modules/@tauri-apps/plugin-shell": {
"version": "2.3.5",
"resolved": "https://registry.npmjs.org/@tauri-apps/plugin-shell/-/plugin-shell-2.3.5.tgz",
+2 -1
View File
@@ -1,6 +1,6 @@
{
"name": "yt-desc-gen",
"version": "0.1.0",
"version": "0.5.0",
"private": true,
"type": "module",
"scripts": {
@@ -33,6 +33,7 @@
"@tauri-apps/api": "^2.0.0",
"@tauri-apps/plugin-dialog": "^2.0.0",
"@tauri-apps/plugin-fs": "^2.0.0",
"@tauri-apps/plugin-opener": "^2.0.0",
"@tauri-apps/plugin-shell": "^2.0.0"
},
"devDependencies": {
+1 -1
View File
@@ -5070,7 +5070,7 @@ dependencies = [
[[package]]
name = "yt-desc-gen"
version = "0.1.0"
version = "0.4.0"
dependencies = [
"serde",
"serde_json",
+2 -1
View File
@@ -1,6 +1,6 @@
[package]
name = "yt-desc-gen"
version = "0.1.0"
version = "0.5.0"
description = "YouTube Gameplay Description Generator"
authors = ["poli0981"]
edition = "2021"
@@ -16,6 +16,7 @@ tauri-build = { version = "2", features = [] }
tauri = { version = "2", features = ["tray-icon"] }
tauri-plugin-dialog = "2"
tauri-plugin-fs = "2"
tauri-plugin-opener = "2"
tauri-plugin-shell = "2"
serde = { version = "1", features = ["derive"] }
serde_json = "1"
+10 -1
View File
@@ -10,6 +10,15 @@
"fs:default",
"fs:allow-read-text-file",
"fs:allow-write-text-file",
"shell:default"
"shell:default",
"opener:default",
{
"identifier": "opener:allow-open-path",
"allow": [{ "path": "$APPDATA" }, { "path": "$APPDATA/**" }]
},
{
"identifier": "opener:allow-reveal-item-in-dir",
"allow": [{ "path": "$APPDATA" }, { "path": "$APPDATA/**" }]
}
]
}
+1
View File
@@ -0,0 +1 @@
{"core":{"default_permission":{"identifier":"default","description":"Default core plugins set.","permissions":["core:path:default","core:event:default","core:window:default","core:webview:default","core:app:default","core:image:default","core:resources:default","core:menu:default","core:tray:default"]},"permissions":{},"permission_sets":{},"global_scope_schema":null},"core:app":{"default_permission":{"identifier":"default","description":"Default permissions for the plugin.","permissions":["allow-version","allow-name","allow-tauri-version","allow-identifier","allow-bundle-type","allow-register-listener","allow-remove-listener"]},"permissions":{"allow-app-hide":{"identifier":"allow-app-hide","description":"Enables the app_hide command without any pre-configured scope.","commands":{"allow":["app_hide"],"deny":[]}},"allow-app-show":{"identifier":"allow-app-show","description":"Enables the app_show command without any pre-configured scope.","commands":{"allow":["app_show"],"deny":[]}},"allow-bundle-type":{"identifier":"allow-bundle-type","description":"Enables the bundle_type command without any pre-configured scope.","commands":{"allow":["bundle_type"],"deny":[]}},"allow-default-window-icon":{"identifier":"allow-default-window-icon","description":"Enables the default_window_icon command without any pre-configured scope.","commands":{"allow":["default_window_icon"],"deny":[]}},"allow-fetch-data-store-identifiers":{"identifier":"allow-fetch-data-store-identifiers","description":"Enables the fetch_data_store_identifiers command without any pre-configured scope.","commands":{"allow":["fetch_data_store_identifiers"],"deny":[]}},"allow-identifier":{"identifier":"allow-identifier","description":"Enables the identifier command without any pre-configured scope.","commands":{"allow":["identifier"],"deny":[]}},"allow-name":{"identifier":"allow-name","description":"Enables the name command without any pre-configured scope.","commands":{"allow":["name"],"deny":[]}},"allow-register-listener":{"identifier":"allow-register-listener","description":"Enables the register_listener command without any pre-configured scope.","commands":{"allow":["register_listener"],"deny":[]}},"allow-remove-data-store":{"identifier":"allow-remove-data-store","description":"Enables the remove_data_store command without any pre-configured scope.","commands":{"allow":["remove_data_store"],"deny":[]}},"allow-remove-listener":{"identifier":"allow-remove-listener","description":"Enables the remove_listener command without any pre-configured scope.","commands":{"allow":["remove_listener"],"deny":[]}},"allow-set-app-theme":{"identifier":"allow-set-app-theme","description":"Enables the set_app_theme command without any pre-configured scope.","commands":{"allow":["set_app_theme"],"deny":[]}},"allow-set-dock-visibility":{"identifier":"allow-set-dock-visibility","description":"Enables the set_dock_visibility command without any pre-configured scope.","commands":{"allow":["set_dock_visibility"],"deny":[]}},"allow-tauri-version":{"identifier":"allow-tauri-version","description":"Enables the tauri_version command without any pre-configured scope.","commands":{"allow":["tauri_version"],"deny":[]}},"allow-version":{"identifier":"allow-version","description":"Enables the version command without any pre-configured scope.","commands":{"allow":["version"],"deny":[]}},"deny-app-hide":{"identifier":"deny-app-hide","description":"Denies the app_hide command without any pre-configured scope.","commands":{"allow":[],"deny":["app_hide"]}},"deny-app-show":{"identifier":"deny-app-show","description":"Denies the app_show command without any pre-configured scope.","commands":{"allow":[],"deny":["app_show"]}},"deny-bundle-type":{"identifier":"deny-bundle-type","description":"Denies the bundle_type command without any pre-configured scope.","commands":{"allow":[],"deny":["bundle_type"]}},"deny-default-window-icon":{"identifier":"deny-default-window-icon","description":"Denies the default_window_icon command without any pre-configured scope.","commands":{"allow":[],"deny":["default_window_icon"]}},"deny-fetch-data-store-identifiers":{"identifier":"deny-fetch-data-store-identifiers","description":"Denies the fetch_data_store_identifiers command without any pre-configured scope.","commands":{"allow":[],"deny":["fetch_data_store_identifiers"]}},"deny-identifier":{"identifier":"deny-identifier","description":"Denies the identifier command without any pre-configured scope.","commands":{"allow":[],"deny":["identifier"]}},"deny-name":{"identifier":"deny-name","description":"Denies the name command without any pre-configured scope.","commands":{"allow":[],"deny":["name"]}},"deny-register-listener":{"identifier":"deny-register-listener","description":"Denies the register_listener command without any pre-configured scope.","commands":{"allow":[],"deny":["register_listener"]}},"deny-remove-data-store":{"identifier":"deny-remove-data-store","description":"Denies the remove_data_store command Line truncated
+1
View File
@@ -0,0 +1 @@
{"default":{"identifier":"default","description":"Default capabilities for YTDescGen","local":true,"windows":["main"],"permissions":["core:default","dialog:default","dialog:allow-save","dialog:allow-open","fs:default","fs:allow-read-text-file","fs:allow-write-text-file","shell:default"]}}
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
+44 -7
View File
@@ -1,11 +1,17 @@
use std::sync::atomic::{AtomicBool, Ordering};
use std::sync::Arc;
use tauri::{
menu::{Menu, MenuItem},
tray::{MouseButton, MouseButtonState, TrayIconBuilder, TrayIconEvent},
Manager,
Manager, RunEvent, WindowEvent,
};
#[tauri::command]
fn save_to_file(path: String, content: String) -> Result<(), String> {
if let Some(parent) = std::path::Path::new(&path).parent() {
std::fs::create_dir_all(parent).map_err(|e| e.to_string())?;
}
std::fs::write(&path, &content).map_err(|e| e.to_string())
}
@@ -16,25 +22,37 @@ fn read_from_file(path: String) -> Result<String, String> {
#[cfg_attr(mobile, tauri::mobile_entry_point)]
pub fn run() {
// Flag that signals the user has requested a full quit (via tray menu).
// When false, closing the window hides it to the tray; when true,
// the app is allowed to exit.
let quitting = Arc::new(AtomicBool::new(false));
let quitting_menu = quitting.clone();
let quitting_window = quitting.clone();
let quitting_run = quitting.clone();
tauri::Builder::default()
.plugin(tauri_plugin_dialog::init())
.plugin(tauri_plugin_fs::init())
.plugin(tauri_plugin_opener::init())
.plugin(tauri_plugin_shell::init())
.setup(|app| {
let show = MenuItem::with_id(app, "show", "Show", true, None::<&str>)?;
.setup(move |app| {
let show = MenuItem::with_id(app, "show", "Show YTDescGen", true, None::<&str>)?;
let quit = MenuItem::with_id(app, "quit", "Quit", true, None::<&str>)?;
let menu = Menu::with_items(app, &[&show, &quit])?;
let _tray = TrayIconBuilder::new()
let _tray = TrayIconBuilder::with_id("ytdescgen-tray")
.tooltip("YTDescGen — YouTube Description Generator")
.menu(&menu)
.on_menu_event(|app, event| match event.id.as_ref() {
.on_menu_event(move |app, event| match event.id.as_ref() {
"show" => {
if let Some(window) = app.get_webview_window("main") {
let _ = window.show();
let _ = window.unminimize();
let _ = window.set_focus();
}
}
"quit" => {
quitting_menu.store(true, Ordering::SeqCst);
app.exit(0);
}
_ => {}
@@ -49,6 +67,7 @@ pub fn run() {
let app = tray.app_handle();
if let Some(window) = app.get_webview_window("main") {
let _ = window.show();
let _ = window.unminimize();
let _ = window.set_focus();
}
}
@@ -57,7 +76,25 @@ pub fn run() {
Ok(())
})
.on_window_event(move |window, event| {
if let WindowEvent::CloseRequested { api, .. } = event {
// If the user asked to quit via the tray menu, let the
// window close normally so the app can exit.
if !quitting_window.load(Ordering::SeqCst) {
let _ = window.hide();
api.prevent_close();
}
}
})
.invoke_handler(tauri::generate_handler![save_to_file, read_from_file])
.run(tauri::generate_context!())
.expect("error while running tauri application");
.build(tauri::generate_context!())
.expect("error while building tauri application")
.run(move |_app_handle, event| {
if let RunEvent::ExitRequested { api, .. } = event {
// Only prevent exit when the user hasn't explicitly asked to quit.
if !quitting_run.load(Ordering::SeqCst) {
api.prevent_exit();
}
}
});
}
+1 -1
View File
@@ -1,7 +1,7 @@
{
"$schema": "https://raw.githubusercontent.com/tauri-apps/tauri/dev/crates/tauri-cli/schema.json",
"productName": "YTDescGen",
"version": "0.1.0",
"version": "0.5.0",
"identifier": "com.skullmute.ytdescgen",
"build": {
"beforeBuildCommand": "npm run build",
+31 -1
View File
@@ -1,9 +1,11 @@
import { lazy, Suspense } from "react";
import { lazy, Suspense, useEffect } from "react";
import { HashRouter, Routes, Route } from "react-router-dom";
import { Toaster } from "react-hot-toast";
import toast from "react-hot-toast";
import { AppShell } from "@components/layout/AppShell";
import { EditorPage } from "@pages/EditorPage";
import { OutputPage } from "@pages/OutputPage";
import { checkDataFileHealth } from "@utils/storage-adapter";
import "@i18n/index";
const ProfilesPage = lazy(() =>
@@ -18,12 +20,24 @@ const SettingsPage = lazy(() =>
const BatchPage = lazy(() =>
import("@pages/BatchPage").then((m) => ({ default: m.BatchPage })),
);
const PlaylistPage = lazy(() =>
import("@pages/PlaylistPage").then((m) => ({ default: m.PlaylistPage })),
);
const LogPage = lazy(() =>
import("@pages/LogPage").then((m) => ({ default: m.LogPage })),
);
function PageLoader() {
return <div className="flex items-center justify-center p-12 text-text-muted">Loading...</div>;
}
export default function App() {
useEffect(() => {
checkDataFileHealth().then((msg) => {
if (msg) toast(msg, { icon: "⚠️", duration: 5000 });
});
}, []);
return (
<>
<HashRouter>
@@ -63,6 +77,22 @@ export default function App() {
</Suspense>
}
/>
<Route
path="playlist"
element={
<Suspense fallback={<PageLoader />}>
<PlaylistPage />
</Suspense>
}
/>
<Route
path="logs"
element={
<Suspense fallback={<PageLoader />}>
<LogPage />
</Suspense>
}
/>
</Route>
</Routes>
</HashRouter>
@@ -0,0 +1,64 @@
import { useTranslation } from "react-i18next";
import { Input } from "@components/ui/Input";
import { VIDEO_TYPES } from "@config/video-types";
import { useEditorStore } from "@store/editor-store";
/**
* Renders inputs for the extra fields required by the currently selected
* video type — e.g. "Part Number" for `part`, "Boss Name" for `boss`,
* "Mod Name" for `mods`. Returns null when the video type has no extras,
* so the caller doesn't have to conditionally render.
*/
export function ExtraFieldsInput() {
const { t } = useTranslation("ui");
const store = useEditorStore();
const currentVideoType = VIDEO_TYPES.find((vt) => vt.id === store.videoType);
const extraFields: readonly string[] = currentVideoType?.extraFields ?? [];
if (extraFields.length === 0) return null;
return (
<div className="flex flex-col gap-3">
{extraFields.includes("partNumber") && (
<Input
label={t("editor.partNumber")}
placeholder={t("editor.partNumberPlaceholder")}
value={store.partNumber ?? ""}
onChange={(e) => store.set("partNumber", e.target.value)}
/>
)}
{extraFields.includes("bossName") && (
<Input
label={t("editor.bossName")}
placeholder={t("editor.bossNamePlaceholder")}
value={store.bossName ?? ""}
onChange={(e) => store.set("bossName", e.target.value)}
/>
)}
{extraFields.includes("dlcName") && (
<Input
label={t("editor.dlcName")}
placeholder={t("editor.dlcNamePlaceholder")}
value={store.dlcName ?? ""}
onChange={(e) => store.set("dlcName", e.target.value)}
/>
)}
{extraFields.includes("challengeName") && (
<Input
label={t("editor.challengeName")}
placeholder={t("editor.challengeNamePlaceholder")}
value={store.challengeName ?? ""}
onChange={(e) => store.set("challengeName", e.target.value)}
/>
)}
{extraFields.includes("modName") && (
<Input
label={t("editor.modName")}
placeholder={t("editor.modNamePlaceholder")}
value={store.modName ?? ""}
onChange={(e) => store.set("modName", e.target.value)}
/>
)}
</div>
);
}
+5 -36
View File
@@ -2,16 +2,17 @@ import { useTranslation } from "react-i18next";
import { Input } from "@components/ui/Input";
import { Select } from "@components/ui/Select";
import { PLATFORMS } from "@config/platforms";
import { VIDEO_TYPES } from "@config/video-types";
import { useEditorStore } from "@store/editor-store";
/**
* Core identity fields for the video (game name, channel, platform).
* Video-type-specific extra fields (partNumber, bossName, …) live in
* ExtraFieldsInput so they group with the video-type picker.
*/
export function GameInfoForm() {
const { t } = useTranslation("ui");
const store = useEditorStore();
const currentVideoType = VIDEO_TYPES.find((vt) => vt.id === store.videoType);
const extraFields: readonly string[] = currentVideoType?.extraFields ?? [];
const platformOptions = PLATFORMS.map((p) => ({ value: p.id, label: p.label }));
return (
@@ -34,38 +35,6 @@ export function GameInfoForm() {
value={store.platform}
onChange={(v) => store.set("platform", v)}
/>
{extraFields.includes("partNumber") && (
<Input
label={t("editor.partNumber")}
placeholder={t("editor.partNumberPlaceholder")}
value={store.partNumber ?? ""}
onChange={(e) => store.set("partNumber", e.target.value)}
/>
)}
{extraFields.includes("bossName") && (
<Input
label={t("editor.bossName")}
placeholder={t("editor.bossNamePlaceholder")}
value={store.bossName ?? ""}
onChange={(e) => store.set("bossName", e.target.value)}
/>
)}
{extraFields.includes("dlcName") && (
<Input
label={t("editor.dlcName")}
placeholder={t("editor.dlcNamePlaceholder")}
value={store.dlcName ?? ""}
onChange={(e) => store.set("dlcName", e.target.value)}
/>
)}
{extraFields.includes("challengeName") && (
<Input
label={t("editor.challengeName")}
placeholder={t("editor.challengeNamePlaceholder")}
value={store.challengeName ?? ""}
onChange={(e) => store.set("challengeName", e.target.value)}
/>
)}
</div>
);
}
+6 -3
View File
@@ -2,10 +2,11 @@ import { useTranslation } from "react-i18next";
import { ChipGroup } from "@components/ui/ChipGroup";
import { GENRES } from "@config/genres";
import { useEditorStore } from "@store/editor-store";
import { MAX_GENRES, type Genre } from "@engine/types";
export function GenreSelector() {
const { t } = useTranslation("ui");
const genre = useEditorStore((s) => s.genre);
const genres = useEditorStore((s) => s.genres);
const set = useEditorStore((s) => s.set);
const options = GENRES.map((g) => ({
@@ -17,9 +18,11 @@ export function GenreSelector() {
return (
<ChipGroup
label={t("editor.genre")}
multiple
max={MAX_GENRES}
options={options}
value={genre}
onChange={(v) => set("genre", v as typeof genre)}
value={genres}
onChange={(next) => set("genres", next as Genre[])}
/>
);
}
@@ -0,0 +1,23 @@
import { useTranslation } from "react-i18next";
import { Textarea } from "@components/ui/Textarea";
import { useEditorStore } from "@store/editor-store";
/**
* Music / sound attribution credit. When non-empty, the engine adds a
* "🎵 MUSIC / SOUND" section to the generated description.
*/
export function MusicAttributionEditor() {
const { t } = useTranslation("ui");
const musicAttribution = useEditorStore((s) => s.musicAttribution);
const set = useEditorStore((s) => s.set);
return (
<Textarea
label={t("editor.musicAttribution")}
placeholder={t("editor.musicAttributionPlaceholder")}
value={musicAttribution ?? ""}
onChange={(e) => set("musicAttribution", e.target.value)}
rows={3}
/>
);
}
@@ -0,0 +1,24 @@
import { useTranslation } from "react-i18next";
import { Textarea } from "@components/ui/Textarea";
import { useEditorStore } from "@store/editor-store";
/**
* Template for the pinned comment a creator posts under their own
* video. Lives outside the description so the creator can paste it
* directly into YouTube's comment box.
*/
export function PinnedCommentEditor() {
const { t } = useTranslation("ui");
const pinnedComment = useEditorStore((s) => s.pinnedComment);
const set = useEditorStore((s) => s.set);
return (
<Textarea
label={t("editor.pinnedComment")}
placeholder={t("editor.pinnedCommentPlaceholder")}
value={pinnedComment ?? ""}
onChange={(e) => set("pinnedComment", e.target.value)}
rows={3}
/>
);
}
+41 -9
View File
@@ -1,5 +1,6 @@
import { useTranslation } from "react-i18next";
import { Input } from "@components/ui/Input";
import { Select } from "@components/ui/Select";
import { RIG_FIELDS } from "@config/rig-fields";
import { useEditorStore } from "@store/editor-store";
@@ -12,15 +13,46 @@ export function RigEditor() {
<div className="flex flex-col gap-3">
<span className="text-sm font-medium text-text-secondary">{t("editor.rig")}</span>
<div className="grid grid-cols-2 gap-2">
{RIG_FIELDS.map((field) => (
<Input
key={field.id}
label={t(field.labelKey)}
placeholder={field.placeholder}
value={rig[field.id] ?? ""}
onChange={(e) => setNested("rig", field.id, e.target.value)}
/>
))}
{RIG_FIELDS.map((field) => {
if (field.type === "dropdown_with_version") {
const raw = rig[field.id] ?? "";
const [value = "", version = ""] = raw.split("|");
const commit = (nextValue: string, nextVersion: string) => {
// Keep the stored form compact: drop the pipe when empty.
const next =
!nextValue && !nextVersion ? "" : `${nextValue}|${nextVersion}`;
setNested("rig", field.id, next);
};
return (
<div key={field.id} className="col-span-2 grid grid-cols-[1fr_auto] gap-2">
<Select
label={t(field.labelKey)}
value={value}
options={field.options ?? []}
onChange={(v) => commit(v, version)}
/>
<Input
label={t("editor.version")}
placeholder={field.versionPlaceholder}
value={version}
onChange={(e) => commit(value, e.target.value)}
/>
</div>
);
}
return (
<Input
key={field.id}
label={t(field.labelKey)}
placeholder={field.placeholder}
value={rig[field.id] ?? ""}
onChange={(e) => setNested("rig", field.id, e.target.value)}
/>
);
})}
</div>
</div>
);
+17 -5
View File
@@ -1,7 +1,8 @@
import { useTranslation } from "react-i18next";
import { Input } from "@components/ui/Input";
import { ValidatedInput } from "@components/ui/ValidatedInput";
import { SOCIAL_FIELDS } from "@config/social-fields";
import { useEditorStore } from "@store/editor-store";
import { validateUrl, validateUrlWithPrefix } from "@utils/validation";
export function SocialEditor() {
const { t } = useTranslation("ui");
@@ -18,12 +19,15 @@ export function SocialEditor() {
<div className="flex flex-col gap-2">
<span className="text-xs font-medium uppercase text-text-muted">Donate</span>
{donateFields.map((field) => (
<Input
<ValidatedInput
key={field.id}
label={t(field.labelKey)}
placeholder={field.urlPrefix || "URL"}
value={social[field.id] ?? ""}
onChange={(e) => setNested("social", field.id, e.target.value)}
onChange={(v) => setNested("social", field.id, v)}
validate={(v) =>
field.urlPrefix ? validateUrlWithPrefix(v, field.urlPrefix) : validateUrl(v)
}
/>
))}
</div>
@@ -31,12 +35,20 @@ export function SocialEditor() {
<div className="flex flex-col gap-2">
<span className="text-xs font-medium uppercase text-text-muted">Social</span>
{socialFields.map((field) => (
<Input
<ValidatedInput
key={field.id}
label={t(field.labelKey)}
placeholder={field.urlPrefix || "URL"}
value={social[field.id] ?? ""}
onChange={(e) => setNested("social", field.id, e.target.value)}
onChange={(v) => setNested("social", field.id, v)}
validate={(v) =>
field.urlPrefix ? validateUrlWithPrefix(v, field.urlPrefix) : validateUrl(v)
}
helpText={
field.id === "mastodon"
? "Full URL including instance, e.g. https://mastodon.social/@user"
: undefined
}
/>
))}
</div>
+39 -10
View File
@@ -1,26 +1,55 @@
import { useTranslation } from "react-i18next";
import { Input } from "@components/ui/Input";
import { ValidatedInput } from "@components/ui/ValidatedInput";
import { Select } from "@components/ui/Select";
import { PLATFORMS } from "@config/platforms";
import { useEditorStore } from "@store/editor-store";
import { validateUrlWithPattern } from "@utils/validation";
import type { StoreLinkType } from "@engine/types";
const STORE_LINK_TYPE_VALUES: readonly StoreLinkType[] = ["paid", "free", "demo"];
export function StoreLinkEditor() {
const { t } = useTranslation("ui");
const storeLinks = useEditorStore((s) => s.storeLinks);
const storeLinkTypes = useEditorStore((s) => s.storeLinkTypes);
const setNested = useEditorStore((s) => s.setNested);
const setStoreLinkType = useEditorStore((s) => s.setStoreLinkType);
const typeOptions = STORE_LINK_TYPE_VALUES.map((value) => ({
value,
label: t(`storeLinkTypes.${value}`),
}));
return (
<div className="flex flex-col gap-3">
<span className="text-sm font-medium text-text-secondary">{t("editor.storeLinks")}</span>
<div className="flex flex-col gap-2">
{PLATFORMS.map((platform) => (
<Input
key={platform.id}
label={platform.label}
placeholder={platform.urlPrefix}
value={storeLinks[platform.id] ?? ""}
onChange={(e) => setNested("storeLinks", platform.id, e.target.value)}
/>
))}
{PLATFORMS.map((platform) => {
const currentType = storeLinkTypes[platform.id] ?? "paid";
return (
<div
key={platform.id}
className="grid grid-cols-[1fr_9rem] items-end gap-2"
>
<ValidatedInput
label={platform.label}
placeholder={platform.urlPrefix}
value={storeLinks[platform.id] ?? ""}
onChange={(v) => {
const final = v && platform.normalize ? platform.normalize(v) : v;
setNested("storeLinks", platform.id, final);
}}
validate={(v) => validateUrlWithPattern(v, platform.urlPattern)}
/>
<Select
label={t("editor.storeLinkType")}
value={currentType}
options={typeOptions}
onChange={(v) => setStoreLinkType(platform.id, v as StoreLinkType)}
/>
</div>
);
})}
</div>
</div>
);
+24
View File
@@ -0,0 +1,24 @@
import { useTranslation } from "react-i18next";
import { Textarea } from "@components/ui/Textarea";
import { useEditorStore } from "@store/editor-store";
/**
* Free-form draft for the thumbnail text overlay. Never lands in the
* generated description — stored only so the creator (or a collaborating
* designer) can copy it separately.
*/
export function ThumbnailHelper() {
const { t } = useTranslation("ui");
const thumbnailText = useEditorStore((s) => s.thumbnailText);
const set = useEditorStore((s) => s.set);
return (
<Textarea
label={t("editor.thumbnailText")}
placeholder={t("editor.thumbnailTextPlaceholder")}
value={thumbnailText ?? ""}
onChange={(e) => set("thumbnailText", e.target.value)}
rows={2}
/>
);
}
+1 -1
View File
@@ -19,7 +19,7 @@ export function HistoryCard({ entry }: HistoryCardProps) {
const date = new Date(entry.createdAt).toLocaleDateString();
return (
<div className="rounded-lg border border-border bg-surface-1">
<div className="rounded-lg border border-border-strong bg-surface-2 shadow-md shadow-black/10 transition-colors hover:border-accent/30">
<div
className="flex cursor-pointer items-center justify-between p-3"
onClick={() => setExpanded(!expanded)}
+2
View File
@@ -4,6 +4,7 @@ import { Header } from "./Header";
import { TabBar } from "./TabBar";
import { ShortcutHelpModal } from "@components/ui/ShortcutHelpModal";
import { useKeyboardShortcuts } from "@hooks/use-keyboard-shortcuts";
import { useGlobalErrorHandler } from "@hooks/use-global-error-handler";
export function AppShell() {
const [showShortcuts, setShowShortcuts] = useState(false);
@@ -11,6 +12,7 @@ export function AppShell() {
useKeyboardShortcuts({
onToggleHelp: () => setShowShortcuts((v) => !v),
});
useGlobalErrorHandler();
return (
<div className="flex min-h-screen flex-col bg-surface-0">
+52 -11
View File
@@ -1,14 +1,35 @@
import { useState, useRef, useEffect } from "react";
import { useTranslation } from "react-i18next";
import { Select } from "@components/ui/Select";
import { ChevronDown } from "lucide-react";
import { SUPPORTED_LANGUAGES } from "@i18n/index";
import { useSettingsStore } from "@store/settings-store";
import type { SupportedLanguage } from "@engine/types";
import clsx from "clsx";
export function Header() {
const { t, i18n } = useTranslation("ui");
const { appLanguage, setAppLanguage } = useSettingsStore();
const [open, setOpen] = useState(false);
const dropdownRef = useRef<HTMLDivElement>(null);
const langOptions = SUPPORTED_LANGUAGES.map((lang) => ({
value: lang.id,
label: `${lang.flag} ${lang.nativeName}`,
}));
const current = SUPPORTED_LANGUAGES.find((l) => l.id === appLanguage);
useEffect(() => {
if (!open) return;
const handleClick = (e: MouseEvent) => {
if (dropdownRef.current && !dropdownRef.current.contains(e.target as Node)) {
setOpen(false);
}
};
document.addEventListener("mousedown", handleClick);
return () => document.removeEventListener("mousedown", handleClick);
}, [open]);
const handleSwitch = (langId: SupportedLanguage) => {
setAppLanguage(langId);
i18n.changeLanguage(langId);
setOpen(false);
};
return (
<header className="flex items-center justify-between border-b border-border bg-surface-1 px-6 py-3">
@@ -16,12 +37,32 @@ export function Header() {
<h1 className="text-lg font-bold text-text-primary">{t("app.title")}</h1>
<p className="text-xs text-text-muted">{t("app.subtitle")}</p>
</div>
<div className="w-40">
<Select
options={langOptions}
value={i18n.language}
onChange={(v) => i18n.changeLanguage(v)}
/>
<div className="relative" ref={dropdownRef}>
<button
onClick={() => setOpen(!open)}
className="flex items-center gap-1.5 rounded-lg px-3 py-1.5 text-sm transition-colors hover:bg-surface-2"
>
<span>{current?.flag}</span>
<span className="text-text-primary">{current?.nativeName}</span>
<ChevronDown className="h-3.5 w-3.5 text-text-muted" />
</button>
{open && (
<div className="absolute right-0 top-full z-50 mt-1 min-w-44 rounded-lg border border-border bg-surface-1 py-1 shadow-xl">
{SUPPORTED_LANGUAGES.map((lang) => (
<button
key={lang.id}
onClick={() => handleSwitch(lang.id as SupportedLanguage)}
className={clsx(
"flex w-full items-center gap-2 px-3 py-2 text-sm transition-colors hover:bg-surface-2",
lang.id === appLanguage ? "bg-accent-muted text-accent" : "text-text-primary",
)}
>
<span>{lang.flag}</span>
<span>{lang.nativeName}</span>
</button>
))}
</div>
)}
</div>
</header>
);
+3 -1
View File
@@ -1,6 +1,6 @@
import { NavLink } from "react-router-dom";
import { useTranslation } from "react-i18next";
import { Pencil, FileText, User, Clock, Settings, Layers } from "lucide-react";
import { Pencil, FileText, User, Clock, Settings, Layers, ListVideo, ScrollText } from "lucide-react";
import clsx from "clsx";
const tabs = [
@@ -9,6 +9,8 @@ const tabs = [
{ to: "/batch", labelKey: "tabs.batch", icon: Layers },
{ to: "/profiles", labelKey: "tabs.profiles", icon: User },
{ to: "/history", labelKey: "tabs.history", icon: Clock },
{ to: "/playlist", labelKey: "tabs.playlist", icon: ListVideo },
{ to: "/logs", labelKey: "tabs.logs", icon: ScrollText },
{ to: "/settings", labelKey: "tabs.settings", icon: Settings },
] as const;
+91
View File
@@ -0,0 +1,91 @@
import { useState } from "react";
import { ChevronDown, ChevronUp, Trash2, Copy, Check } from "lucide-react";
import { useLogStore, type LogEntry as LogEntryType, type LogLevel } from "@store/log-store";
import clsx from "clsx";
const LEVEL_STYLES: Record<LogLevel, string> = {
error: "bg-red-500/20 text-red-400",
warn: "bg-yellow-500/20 text-yellow-400",
info: "bg-blue-500/20 text-blue-400",
debug: "bg-gray-500/20 text-gray-400",
};
interface LogEntryProps {
entry: LogEntryType;
}
export function LogEntryCard({ entry }: LogEntryProps) {
const deleteEntry = useLogStore((s) => s.deleteEntry);
const [expanded, setExpanded] = useState(false);
const [copied, setCopied] = useState(false);
const time = new Date(entry.timestamp).toLocaleTimeString();
const handleCopy = (e: React.MouseEvent) => {
e.stopPropagation();
const text = `[${entry.level.toUpperCase()}] [${entry.source}] ${entry.message}${entry.details ? `\n${entry.details}` : ""}`;
navigator.clipboard.writeText(text).then(() => {
setCopied(true);
setTimeout(() => setCopied(false), 1500);
});
};
return (
<div
className={clsx(
"rounded-lg border bg-surface-2 transition-colors",
entry.level === "error" ? "border-red-500/30" : "border-border",
)}
>
<div
className="flex cursor-pointer items-center gap-2 px-3 py-2"
onClick={() => setExpanded(!expanded)}
>
<span
className={clsx(
"shrink-0 rounded px-1.5 py-0.5 font-mono text-[10px] font-bold uppercase",
LEVEL_STYLES[entry.level],
)}
>
{entry.level}
</span>
<span className="shrink-0 rounded bg-surface-3 px-1.5 py-0.5 text-[10px] text-text-muted">
{entry.source}
</span>
<span className="min-w-0 flex-1 truncate text-xs text-text-primary">{entry.message}</span>
<span className="shrink-0 text-[10px] text-text-muted">{time}</span>
<div className="flex shrink-0 items-center gap-0.5">
<button
onClick={handleCopy}
className="rounded p-1 text-text-muted hover:bg-surface-3 hover:text-text-primary"
>
{copied ? <Check className="h-3 w-3 text-success" /> : <Copy className="h-3 w-3" />}
</button>
<button
onClick={(e) => {
e.stopPropagation();
deleteEntry(entry.id);
}}
className="rounded p-1 text-text-muted hover:bg-surface-3 hover:text-danger"
>
<Trash2 className="h-3 w-3" />
</button>
{entry.details &&
(expanded ? (
<ChevronUp className="h-3.5 w-3.5 text-text-muted" />
) : (
<ChevronDown className="h-3.5 w-3.5 text-text-muted" />
))}
</div>
</div>
{expanded && entry.details && (
<div className="border-t border-border px-3 py-2">
<pre className="max-h-40 overflow-auto whitespace-pre-wrap font-mono text-[11px] text-text-secondary">
{entry.details}
</pre>
</div>
)}
</div>
);
}
+11 -2
View File
@@ -6,14 +6,23 @@ interface CharCounterProps {
limit: number;
}
/**
* Thresholds follow the v0.5 spec:
* - ≥100 %: red (over limit — YouTube will refuse the string).
* - ≥80 %: yellow (close enough that the user should glance).
* - else: muted grey.
*/
export function CharCounter({ text, limit }: CharCounterProps) {
const { count, isOver, percentage } = useCharCount(text, limit);
const isWarning = !isOver && percentage >= 80;
return (
<span
className={clsx(
"text-xs font-mono",
isOver ? "text-danger" : percentage > 80 ? "text-warning" : "text-text-muted",
"text-xs font-mono font-semibold transition-colors",
isOver && "text-danger",
isWarning && "text-warning",
!isOver && !isWarning && "text-text-muted font-normal",
)}
>
{count}/{limit}
+54
View File
@@ -0,0 +1,54 @@
import { useTranslation } from "react-i18next";
import { useEditorStore } from "@store/editor-store";
import { CopyButton } from "./CopyButton";
/**
* Renders the non-description artefacts (thumbnail text + pinned comment)
* on the Output page. These stay outside the description because they
* get pasted into different YouTube surfaces.
*/
export function OutputExtras() {
const { t } = useTranslation("ui");
const thumbnailText = useEditorStore((s) => s.thumbnailText);
const pinnedComment = useEditorStore((s) => s.pinnedComment);
const hasThumbnail = thumbnailText && thumbnailText.trim() !== "";
const hasPinned = pinnedComment && pinnedComment.trim() !== "";
if (!hasThumbnail && !hasPinned) return null;
return (
<div className="flex flex-col gap-6">
{hasThumbnail && (
<section className="flex flex-col gap-2">
<div className="flex items-center justify-between">
<h3 className="text-sm font-semibold text-text-primary">
{t("output.thumbnailText")}
</h3>
<CopyButton text={thumbnailText} label={t("output.copyThumbnailText")} />
</div>
<div className="rounded-lg border border-border bg-surface-1 p-3">
<pre className="whitespace-pre-wrap font-sans text-sm text-text-secondary">
{thumbnailText}
</pre>
</div>
</section>
)}
{hasPinned && (
<section className="flex flex-col gap-2">
<div className="flex items-center justify-between">
<h3 className="text-sm font-semibold text-text-primary">
{t("output.pinnedComment")}
</h3>
<CopyButton text={pinnedComment} label={t("output.copyPinnedComment")} />
</div>
<div className="rounded-lg border border-border bg-surface-1 p-3">
<pre className="whitespace-pre-wrap font-sans text-sm text-text-secondary">
{pinnedComment}
</pre>
</div>
</section>
)}
</div>
);
}
+100
View File
@@ -0,0 +1,100 @@
import { useMemo } from "react";
import { useTranslation } from "react-i18next";
import i18n from "i18next";
import { Modal } from "@components/ui/Modal";
import { CopyButton } from "./CopyButton";
import { CharCounter } from "./CharCounter";
import { buildTitleVariants } from "@engine/title-variants";
import { useEditorStore } from "@store/editor-store";
import { useSettingsStore } from "@store/settings-store";
import { YT_LIMITS, type GeneratorInput } from "@engine/types";
interface VariantPickerProps {
open: boolean;
onClose: () => void;
}
/**
* Modal that shows 3 A/B-testable title variants for the current editor
* state. Generated fresh each time the modal opens — no state persists
* here because the titles are derived from the store.
*/
export function VariantPicker({ open, onClose }: VariantPickerProps) {
const { t } = useTranslation("ui");
const state = useEditorStore();
const showQualityBadge = useSettingsStore((s) => s.showQualityBadge);
const variants = useMemo(() => {
if (!open) return [];
const input: GeneratorInput = {
videoType: state.videoType,
language: state.language,
genres: state.genres,
gameName: state.gameName,
gameNameLocalized: state.gameNameLocalized,
channelName: state.channelName,
platform: state.platform,
partNumber: state.partNumber,
bossName: state.bossName,
dlcName: state.dlcName,
challengeName: state.challengeName,
modName: state.modName,
resolution: state.resolution,
fps: state.fps,
graphicsPreset: state.graphicsPreset,
spoilerWarning: state.spoilerWarning,
matureWarning: state.matureWarning,
storeLinks: state.storeLinks,
social: state.social,
rig: state.rig,
};
const tFn = i18n.getFixedT(state.language, "templates");
return buildTitleVariants(input, tFn, showQualityBadge);
}, [
open,
showQualityBadge,
state.videoType,
state.language,
state.genres,
state.gameName,
state.gameNameLocalized,
state.channelName,
state.platform,
state.partNumber,
state.bossName,
state.dlcName,
state.challengeName,
state.modName,
state.resolution,
state.fps,
state.graphicsPreset,
state.spoilerWarning,
state.matureWarning,
state.storeLinks,
state.social,
state.rig,
]);
return (
<Modal open={open} onClose={onClose} title={t("output.generateAlternatives")} className="max-w-2xl">
<div className="flex flex-col gap-4">
{variants.map((variant) => (
<section key={variant.id} className="flex flex-col gap-2">
<div className="flex items-center justify-between">
<h3 className="text-xs font-semibold uppercase tracking-wide text-text-muted">
{t(variant.labelKey)}
</h3>
<div className="flex items-center gap-3">
<CharCounter text={variant.title} limit={YT_LIMITS.TITLE_MAX} />
<CopyButton text={variant.title} label={t("output.copyTitle")} />
</div>
</div>
<div className="rounded-lg border border-border bg-surface-1 p-3">
<p className="text-sm font-medium text-text-primary">{variant.title}</p>
</div>
</section>
))}
</div>
</Modal>
);
}
+10 -8
View File
@@ -23,7 +23,7 @@ export function PresetCard({ preset }: PresetCardProps) {
loadPreset({
gameName: preset.gameName,
gameNameLocalized: preset.gameNameLocalized ? { ...preset.gameNameLocalized } : {},
genre: preset.genre,
genres: [...preset.genres],
platform: preset.platform,
storeLinks: { ...preset.storeLinks },
spoilerWarning: preset.spoilerWarning,
@@ -31,19 +31,21 @@ export function PresetCard({ preset }: PresetCardProps) {
});
};
const genre = GENRES.find((g) => g.id === preset.genre);
const genreDefs = preset.genres
.map((id) => GENRES.find((g) => g.id === id))
.filter((g): g is (typeof GENRES)[number] => g !== undefined);
return (
<>
<div className="flex items-center justify-between rounded-lg border border-border bg-surface-1 p-4">
<div className="flex items-center justify-between rounded-lg border border-border-strong bg-surface-2 p-4 shadow-md shadow-black/10 transition-colors hover:border-accent/30">
<div className="flex-1">
<h3 className="text-sm font-semibold text-text-primary">{preset.gameName}</h3>
<div className="mt-1.5 flex items-center gap-2 text-xs text-text-muted">
{genre && (
<span className="rounded bg-surface-2 px-1.5 py-0.5">
{genre.icon} {t(genre.labelKey)}
<div className="mt-1.5 flex flex-wrap items-center gap-1.5 text-xs text-text-muted">
{genreDefs.map((g) => (
<span key={g.id} className="rounded bg-surface-2 px-1.5 py-0.5">
{g.icon} {t(g.labelKey)}
</span>
)}
))}
<span>{preset.platform}</span>
</div>
</div>
+1 -1
View File
@@ -23,7 +23,7 @@ export function PresetSaveForm({ open, onClose, editPreset }: PresetSaveFormProp
const data = {
gameName: gameName.trim() || "Unnamed Game",
gameNameLocalized: editPreset?.gameNameLocalized ?? { ...editor.gameNameLocalized },
genre: editPreset?.genre ?? editor.genre,
genres: editPreset?.genres ?? [...editor.genres],
platform: editPreset?.platform ?? editor.platform,
storeLinks: editPreset?.storeLinks ?? { ...editor.storeLinks },
spoilerWarning: editPreset?.spoilerWarning ?? editor.spoilerWarning,
+1 -1
View File
@@ -22,7 +22,7 @@ export function PresetSelector() {
loadPreset({
gameName: preset.gameName,
gameNameLocalized: preset.gameNameLocalized ? { ...preset.gameNameLocalized } : {},
genre: preset.genre,
genres: [...preset.genres],
platform: preset.platform,
storeLinks: { ...preset.storeLinks },
spoilerWarning: preset.spoilerWarning,
+1 -1
View File
@@ -35,7 +35,7 @@ export function ProfileCard({ profile }: ProfileCardProps) {
return (
<>
<div className="flex items-center justify-between rounded-lg border border-border bg-surface-1 p-4">
<div className="flex items-center justify-between rounded-lg border border-border-strong bg-surface-2 p-4 shadow-md shadow-black/10 transition-colors hover:border-accent/30">
<div className="flex-1">
<h3 className="text-sm font-semibold text-text-primary">{profile.name}</h3>
<p className="mt-0.5 text-xs text-text-secondary">{profile.channelName || "No channel"}</p>
+63
View File
@@ -0,0 +1,63 @@
import { useState } from "react";
import { useTranslation } from "react-i18next";
import { Upload, Trash2 } from "lucide-react";
import { Button } from "@components/ui/Button";
import { ConfirmDialog } from "@components/ui/ConfirmDialog";
import { useEditorStore } from "@store/editor-store";
import { useTemplateStore, type EditorTemplate } from "@store/template-store";
import toast from "react-hot-toast";
interface TemplateCardProps {
template: EditorTemplate;
}
export function TemplateCard({ template }: TemplateCardProps) {
const { t } = useTranslation("ui");
const loadProfile = useEditorStore((s) => s.loadProfile);
const deleteTemplate = useTemplateStore((s) => s.deleteTemplate);
const [showDelete, setShowDelete] = useState(false);
const handleApply = () => {
loadProfile(template.snapshot);
toast.success(t("templates.appliedToast", { name: template.name }));
};
const date = new Date(template.createdAt).toLocaleDateString();
return (
<>
<div className="flex items-center justify-between rounded-lg border border-border-strong bg-surface-2 p-4 shadow-md shadow-black/10 transition-colors hover:border-accent/30">
<div className="flex-1">
<h3 className="text-sm font-semibold text-text-primary">{template.name}</h3>
<div className="mt-1.5 flex items-center gap-2 text-xs text-text-muted">
<span>{template.snapshot.gameName || "—"}</span>
<span>·</span>
<span>{date}</span>
</div>
</div>
<div className="flex items-center gap-1.5">
<Button variant="primary" size="sm" onClick={handleApply}>
<Upload className="h-3.5 w-3.5" />
{t("templates.loadTemplate")}
</Button>
<Button variant="ghost" size="sm" onClick={() => setShowDelete(true)}>
<Trash2 className="h-3.5 w-3.5 text-danger" />
</Button>
</div>
</div>
<ConfirmDialog
open={showDelete}
onConfirm={() => {
deleteTemplate(template.id);
setShowDelete(false);
}}
onCancel={() => setShowDelete(false)}
title={t("common.delete")}
message={t("templates.deleteConfirm")}
confirmLabel={t("common.delete")}
variant="danger"
/>
</>
);
}
+24
View File
@@ -0,0 +1,24 @@
import { useTranslation } from "react-i18next";
import { useTemplateStore } from "@store/template-store";
import { TemplateCard } from "./TemplateCard";
export function TemplateList() {
const { t } = useTranslation("ui");
const templates = useTemplateStore((s) => s.templates);
if (templates.length === 0) {
return (
<p className="rounded-lg border border-dashed border-border py-8 text-center text-sm text-text-muted">
{t("templates.emptyState")}
</p>
);
}
return (
<div className="flex flex-col gap-2">
{templates.map((template) => (
<TemplateCard key={template.id} template={template} />
))}
</div>
);
}
@@ -0,0 +1,87 @@
import { useState } from "react";
import { useTranslation } from "react-i18next";
import { Modal } from "@components/ui/Modal";
import { Button } from "@components/ui/Button";
import { Input } from "@components/ui/Input";
import { useEditorStore } from "@store/editor-store";
import { useTemplateStore, type TemplateSnapshot } from "@store/template-store";
import toast from "react-hot-toast";
interface TemplateSaveFormProps {
open: boolean;
onClose: () => void;
}
/**
* Prompts for a template name, then saves the entire editor form as a
* reusable snapshot. Leaves the editor state untouched.
*/
export function TemplateSaveForm({ open, onClose }: TemplateSaveFormProps) {
const { t } = useTranslation("ui");
const editor = useEditorStore();
const addTemplate = useTemplateStore((s) => s.addTemplate);
const [name, setName] = useState("");
const handleSave = () => {
const snapshot: TemplateSnapshot = {
videoType: editor.videoType,
language: editor.language,
genres: [...editor.genres],
gameName: editor.gameName,
gameNameLocalized: { ...editor.gameNameLocalized },
channelName: editor.channelName,
platform: editor.platform,
partNumber: editor.partNumber,
bossName: editor.bossName,
dlcName: editor.dlcName,
challengeName: editor.challengeName,
modName: editor.modName,
resolution: editor.resolution,
fps: editor.fps,
graphicsPreset: editor.graphicsPreset,
timestamps: editor.timestamps,
playlistLink: editor.playlistLink,
contactEmail: editor.contactEmail,
musicAttribution: editor.musicAttribution,
thumbnailText: editor.thumbnailText,
pinnedComment: editor.pinnedComment,
spoilerWarning: editor.spoilerWarning,
matureWarning: editor.matureWarning,
storeLinks: { ...editor.storeLinks },
storeLinkTypes: { ...editor.storeLinkTypes },
social: { ...editor.social },
rig: { ...editor.rig },
};
addTemplate(name, snapshot);
toast.success(t("templates.savedAs", { name: name.trim() || "Untitled" }));
setName("");
onClose();
};
return (
<Modal
open={open}
onClose={onClose}
title={t("templates.saveAsTemplate")}
footer={
<>
<Button variant="ghost" onClick={onClose}>
{t("common.cancel")}
</Button>
<Button onClick={handleSave}>{t("common.save")}</Button>
</>
}
>
<div className="flex flex-col gap-3">
<Input
label={t("templates.templateName")}
placeholder={t("templates.templateNamePlaceholder")}
value={name}
onChange={(e) => setName(e.target.value)}
autoFocus
/>
<p className="text-xs text-text-muted">{t("templates.saveHint")}</p>
</div>
</Modal>
);
}
+72
View File
@@ -0,0 +1,72 @@
import { ChevronDown } from "lucide-react";
import type { ReactNode } from "react";
import clsx from "clsx";
interface AccordionProps {
/** Unique id for the section — used as React key in lists. */
id: string;
/** Header label. */
title: string;
/** Optional leading icon (emoji or single-char string). */
icon?: string;
/** Optional trailing badge — e.g. a count or status chip. */
badge?: ReactNode;
/** Controlled open state. */
open: boolean;
/** Called when the user clicks the header to toggle. */
onToggle: () => void;
children: ReactNode;
}
/**
* Single-section accordion. Controlled only — the parent decides which
* sections are open and persists that choice. Height animates via a
* grid-rows trick so content can be any height without measurement.
*/
export function Accordion({
id,
title,
icon,
badge,
open,
onToggle,
children,
}: AccordionProps) {
return (
<section
data-accordion-id={id}
className="overflow-hidden rounded-lg border border-border bg-surface-1"
>
<button
type="button"
onClick={onToggle}
aria-expanded={open}
className="flex w-full items-center justify-between gap-3 px-4 py-3 text-left transition-colors hover:bg-surface-2"
>
<div className="flex items-center gap-2">
{icon && <span className="text-base leading-none">{icon}</span>}
<span className="text-sm font-semibold text-text-primary">{title}</span>
{badge}
</div>
<ChevronDown
className={clsx(
"h-4 w-4 text-text-muted transition-transform duration-200",
open && "rotate-180",
)}
/>
</button>
<div
className={clsx(
"grid transition-[grid-template-rows] duration-200 ease-out",
open ? "grid-rows-[1fr]" : "grid-rows-[0fr]",
)}
>
<div className="overflow-hidden">
<div className="flex flex-col gap-3 border-t border-border px-4 py-4">
{children}
</div>
</div>
</div>
</section>
);
}
+73 -21
View File
@@ -6,35 +6,87 @@ interface ChipOption {
icon?: string;
}
interface ChipGroupProps {
interface BaseProps {
label?: string;
options: readonly ChipOption[];
value: string;
onChange: (value: string) => void;
className?: string;
}
export function ChipGroup({ label, options, value, onChange, className }: ChipGroupProps) {
type SingleProps = BaseProps & {
multiple?: false;
value: string;
onChange: (value: string) => void;
};
type MultiProps = BaseProps & {
multiple: true;
/** Ordered list of selected option ids. */
value: readonly string[];
onChange: (value: string[]) => void;
/** Optional cap on total selections. When reached, unselected chips disable. */
max?: number;
};
export type ChipGroupProps = SingleProps | MultiProps;
export function ChipGroup(props: ChipGroupProps) {
const { label, options, className } = props;
const isSelected = (id: string): boolean => {
if (props.multiple) return props.value.includes(id);
return props.value === id;
};
const atCapacity = props.multiple && props.max != null && props.value.length >= props.max;
const handleClick = (id: string) => {
if (props.multiple) {
if (props.value.includes(id)) {
props.onChange(props.value.filter((v) => v !== id));
} else {
if (props.max != null && props.value.length >= props.max) return;
props.onChange([...props.value, id]);
}
} else {
props.onChange(id);
}
};
const counter =
props.multiple && props.max != null ? `${props.value.length}/${props.max}` : null;
return (
<div className={clsx("flex flex-col gap-2", className)}>
{label && <span className="text-sm font-medium text-text-secondary">{label}</span>}
{(label || counter) && (
<div className="flex items-center justify-between">
{label && <span className="text-sm font-medium text-text-secondary">{label}</span>}
{counter && <span className="text-xs text-text-muted">{counter}</span>}
</div>
)}
<div className="flex flex-wrap gap-2">
{options.map((option) => (
<button
key={option.id}
type="button"
onClick={() => onChange(option.id)}
className={clsx(
"inline-flex items-center gap-1.5 rounded-lg px-3 py-1.5 text-sm font-medium transition-colors",
value === option.id
? "bg-accent text-white"
: "bg-surface-2 text-text-secondary hover:bg-surface-3 hover:text-text-primary",
)}
>
{option.icon && <span>{option.icon}</span>}
{option.label}
</button>
))}
{options.map((option) => {
const selected = isSelected(option.id);
const disabled = !selected && atCapacity;
return (
<button
key={option.id}
type="button"
disabled={disabled}
onClick={() => handleClick(option.id)}
className={clsx(
"inline-flex items-center gap-1.5 rounded-lg px-3 py-1.5 text-sm font-medium transition-colors",
selected
? "bg-accent text-white"
: disabled
? "cursor-not-allowed bg-surface-2 text-text-muted opacity-40"
: "bg-surface-2 text-text-secondary hover:bg-surface-3 hover:text-text-primary",
)}
>
{option.icon && <span>{option.icon}</span>}
{option.label}
</button>
);
})}
</div>
</div>
);
+1
View File
@@ -7,6 +7,7 @@ interface ShortcutHelpModalProps {
}
const shortcuts = [
{ keys: "Ctrl + G", labelKey: "shortcuts.generate" },
{ keys: "Ctrl + Enter", labelKey: "shortcuts.generate" },
{ keys: "Ctrl + Shift + C", labelKey: "shortcuts.copyAll" },
{ keys: "Ctrl + S", labelKey: "shortcuts.saveDraft" },
+71
View File
@@ -0,0 +1,71 @@
import { useState, useCallback } from "react";
import { useTranslation } from "react-i18next";
import type { ValidationResult } from "@utils/validation";
import clsx from "clsx";
interface ValidatedInputProps {
label: string;
value: string;
onChange: (value: string) => void;
validate: (value: string) => ValidationResult;
placeholder?: string;
helpText?: string;
}
export function ValidatedInput({
label,
value,
onChange,
validate,
placeholder,
helpText,
}: ValidatedInputProps) {
const { t } = useTranslation("ui");
const [displayValue, setDisplayValue] = useState(value);
const [error, setError] = useState<string | null>(null);
const [touched, setTouched] = useState(false);
const handleChange = useCallback(
(newValue: string) => {
setDisplayValue(newValue);
const result = validate(newValue);
if (result.valid && !result.error) {
// Fully valid: commit the value to the store.
setError(null);
onChange(newValue);
} else if (result.valid && result.error) {
// Warning (e.g. prefix mismatch from validateUrlWithPrefix).
// Surface the warning but still commit so the user can decide.
setError(t(result.error, result.errorParams as Record<string, string>));
onChange(newValue);
} else {
// Invalid: show the error and CLEAR the committed value so the
// bad input never reaches the generated description/tags. The
// local displayValue is preserved so the user can keep editing.
setError(t(result.error ?? "", result.errorParams as Record<string, string>));
onChange("");
}
setTouched(true);
},
[validate, onChange, t],
);
return (
<div className="flex flex-col gap-1">
<label className="text-sm font-medium text-text-secondary">{label}</label>
<input
type="text"
value={displayValue}
onChange={(e) => handleChange(e.target.value)}
onBlur={() => setTouched(true)}
placeholder={placeholder}
className={clsx(
"rounded-lg border bg-surface-1 px-3 py-2 text-sm text-text-primary placeholder:text-text-muted transition-colors focus:outline-none focus:ring-2 focus:ring-accent/50",
touched && error ? "border-danger" : "border-border focus:border-accent",
)}
/>
{touched && error && <p className="text-xs text-danger">{error}</p>}
{helpText && !error && <p className="text-xs text-text-muted">{helpText}</p>}
</div>
);
}
+15 -5
View File
@@ -1,11 +1,11 @@
import type { VideoTypeId } from "./video-types";
import type { GenreId } from "./genres";
import type { SupportedLanguage } from "@engine/types";
import type { SupportedLanguage, StoreLinkType } from "@engine/types";
export interface EditorDefaults {
videoType: VideoTypeId;
language: SupportedLanguage;
genre: GenreId;
genres: GenreId[];
gameName: string;
gameNameLocalized: Record<string, string>;
channelName: string;
@@ -14,15 +14,20 @@ export interface EditorDefaults {
bossName: string;
dlcName: string;
challengeName: string;
modName: string;
resolution: string;
fps: string;
graphicsPreset: string;
timestamps: string;
playlistLink: string;
contactEmail: string;
musicAttribution: string;
thumbnailText: string;
pinnedComment: string;
spoilerWarning: boolean;
matureWarning: boolean;
storeLinks: Record<string, string>;
storeLinkTypes: Record<string, StoreLinkType>;
social: Record<string, string>;
rig: Record<string, string>;
}
@@ -30,14 +35,14 @@ export interface EditorDefaults {
export interface SettingsDefaults {
theme: "dark" | "light";
defaultLanguage: string;
defaultGenre: GenreId;
defaultGenres: GenreId[];
}
export const DEFAULTS = {
editor: {
videoType: "full",
language: "en",
genre: "action",
genres: ["action"],
gameName: "",
gameNameLocalized: {},
channelName: "",
@@ -46,15 +51,20 @@ export const DEFAULTS = {
bossName: "",
dlcName: "",
challengeName: "",
modName: "",
resolution: "1080p",
fps: "60",
graphicsPreset: "Ultra",
timestamps: "",
playlistLink: "",
contactEmail: "",
musicAttribution: "",
thumbnailText: "",
pinnedComment: "",
spoilerWarning: false,
matureWarning: false,
storeLinks: {},
storeLinkTypes: {},
social: {},
rig: {},
} satisfies EditorDefaults,
@@ -62,6 +72,6 @@ export const DEFAULTS = {
settings: {
theme: "dark",
defaultLanguage: "en",
defaultGenre: "action",
defaultGenres: ["action"],
} satisfies SettingsDefaults,
} as const;
+18 -1
View File
@@ -1,14 +1,28 @@
export const GENRES = [
{ id: "action", labelKey: "genres.action", icon: "⚔️" },
{ id: "hack_slash", labelKey: "genres.hack_slash", icon: "🗡" },
{ id: "beatemup", labelKey: "genres.beatemup", icon: "👊" },
{ id: "platformer", labelKey: "genres.platformer", icon: "🦘" },
{ id: "horror", labelKey: "genres.horror", icon: "👻" },
{ id: "survival_horror", labelKey: "genres.survival_horror", icon: "🧟" },
{ id: "psychological_horror", labelKey: "genres.psychological_horror", icon: "🧠" },
{ id: "rpg", labelKey: "genres.rpg", icon: "🛡" },
{ id: "jrpg", labelKey: "genres.jrpg", icon: "🎎" },
{ id: "action_rpg", labelKey: "genres.action_rpg", icon: "🏹" },
{ id: "crpg", labelKey: "genres.crpg", icon: "📜" },
{ id: "fps", labelKey: "genres.fps", icon: "🔫" },
{ id: "arena_shooter", labelKey: "genres.arena_shooter", icon: "🎯" },
{ id: "tactical_fps", labelKey: "genres.tactical_fps", icon: "🎖" },
{ id: "boomer_shooter", labelKey: "genres.boomer_shooter", icon: "💥" },
{ id: "extraction_shooter", labelKey: "genres.extraction_shooter", icon: "🎒" },
{ id: "shmup", labelKey: "genres.shmup", icon: "🛸" },
{ id: "openworld", labelKey: "genres.openworld", icon: "🌍" },
{ id: "indie", labelKey: "genres.indie", icon: "🕹" },
{ id: "soulslike", labelKey: "genres.soulslike", icon: "💀" },
{ id: "racing", labelKey: "genres.racing", icon: "🏎" },
{ id: "story", labelKey: "genres.story", icon: "📖" },
{ id: "simulation", labelKey: "genres.simulation", icon: "🏗" },
{ id: "city_builder", labelKey: "genres.city_builder", icon: "🏙" },
{ id: "fighting", labelKey: "genres.fighting", icon: "🥊" },
{ id: "stealth", labelKey: "genres.stealth", icon: "🥷" },
{ id: "survival_craft", labelKey: "genres.survival_craft", icon: "⛏" },
@@ -19,11 +33,14 @@ export const GENRES = [
{ id: "puzzle", labelKey: "genres.puzzle", icon: "🧩" },
{ id: "tower_defense", labelKey: "genres.tower_defense", icon: "🏰" },
{ id: "card_game", labelKey: "genres.card_game", icon: "🃏" },
{ id: "deck_builder", labelKey: "genres.deck_builder", icon: "🎴" },
{ id: "auto_battler", labelKey: "genres.auto_battler", icon: "🤖" },
{ id: "battle_royale", labelKey: "genres.battle_royale", icon: "🏆" },
{ id: "crpg", labelKey: "genres.crpg", icon: "📜" },
{ id: "tactical", labelKey: "genres.tactical", icon: "♟" },
{ id: "space", labelKey: "genres.space", icon: "🚀" },
{ id: "farming", labelKey: "genres.farming", icon: "🌾" },
{ id: "fmv", labelKey: "genres.fmv", icon: "🎬" },
{ id: "visual_novel", labelKey: "genres.visual_novel", icon: "💬" },
] as const;
export type GenreId = (typeof GENRES)[number]["id"];
+89 -10
View File
@@ -1,13 +1,92 @@
export const PLATFORMS = [
{ id: "steam", label: "Steam", urlPrefix: "https://store.steampowered.com/app/" },
{ id: "epic", label: "Epic Games Store", urlPrefix: "https://store.epicgames.com/" },
{ id: "ps", label: "PlayStation Store", urlPrefix: "https://store.playstation.com/" },
{ id: "xbox", label: "Xbox / Microsoft Store", urlPrefix: "https://www.xbox.com/games/" },
{ id: "nintendo", label: "Nintendo eShop", urlPrefix: "https://www.nintendo.com/store/" },
{ id: "gog", label: "GOG", urlPrefix: "https://www.gog.com/game/" },
{ id: "itchio", label: "itch.io", urlPrefix: "https://itch.io/" },
{ id: "humble", label: "Humble Bundle", urlPrefix: "https://www.humblebundle.com/store/" },
{ id: "amazon", label: "Amazon Luna", urlPrefix: "https://www.amazon.com/luna/" },
export interface PlatformConfig {
readonly id: string;
readonly label: string;
/** Shown as placeholder / hint to the user. */
readonly urlPrefix: string;
/** Authoritative validator. Must match the entire trimmed URL. */
readonly urlPattern: RegExp;
/**
* Optional canonicaliser run on already-valid URLs before commit.
* Useful for stripping trailing slug segments (e.g. Steam app pages
* include the game name after the app id).
*/
readonly normalize?: (url: string) => string;
}
/**
* Normaliser for Steam store URLs.
*
* Valid shape: `https://store.steampowered.com/app/<id>` with an optional
* trailing slug such as `/ELDEN_RING/`. This strips everything after the
* numeric id, yielding the canonical `.../app/<id>` form.
*/
function normalizeSteamUrl(url: string): string {
const match = url.match(
/^(https:\/\/store\.steampowered\.com\/app\/\d+)(?:\/.*)?$/i,
);
return match?.[1] ?? url;
}
export const PLATFORMS: readonly PlatformConfig[] = [
{
id: "steam",
label: "Steam",
urlPrefix: "https://store.steampowered.com/app/",
// /app/<digits>, optionally followed by /<slug> or trailing slash.
urlPattern: /^https:\/\/store\.steampowered\.com\/app\/\d+(?:\/[^\s]*)?$/i,
normalize: normalizeSteamUrl,
},
{
id: "epic",
label: "Epic Games Store",
urlPrefix: "https://store.epicgames.com/",
urlPattern: /^https:\/\/store\.epicgames\.com\/[^\s]+$/i,
},
{
id: "ps",
label: "PlayStation Store",
urlPrefix: "https://store.playstation.com/",
urlPattern: /^https:\/\/store\.playstation\.com\/[^\s]+$/i,
},
{
id: "xbox",
label: "Xbox / Microsoft Store",
urlPrefix: "https://www.xbox.com/games/",
urlPattern: /^https:\/\/www\.xbox\.com\/[^\s]+$/i,
},
{
id: "nintendo",
label: "Nintendo eShop",
urlPrefix: "https://www.nintendo.com/store/",
urlPattern: /^https:\/\/www\.nintendo\.com\/[^\s]+$/i,
},
{
id: "gog",
label: "GOG",
urlPrefix: "https://www.gog.com/game/",
urlPattern: /^https:\/\/www\.gog\.com\/[^\s]+$/i,
},
{
id: "itchio",
label: "itch.io",
urlPrefix: "https://<dev>.itch.io/<game>",
// itch.io games live at https://<dev>.itch.io/<game>, where <dev>
// is a user subdomain. Reject the bare https://itch.io/... host.
urlPattern:
/^https:\/\/[a-z0-9][a-z0-9-]*\.itch\.io\/[a-z0-9][a-z0-9_-]*\/?$/i,
},
{
id: "humble",
label: "Humble Bundle",
urlPrefix: "https://www.humblebundle.com/store/",
urlPattern: /^https:\/\/www\.humblebundle\.com\/[^\s]+$/i,
},
{
id: "amazon",
label: "Amazon Luna",
urlPrefix: "https://www.amazon.com/luna/",
urlPattern: /^https:\/\/www\.amazon\.com\/[^\s]+$/i,
},
] as const;
export type PlatformId = (typeof PLATFORMS)[number]["id"];
+89 -10
View File
@@ -1,12 +1,91 @@
export const RIG_FIELDS = [
{ id: "cpu", labelKey: "rig.cpu", placeholder: "Intel i9-14900K / AMD Ryzen 9 7950X" },
{ id: "gpu", labelKey: "rig.gpu", placeholder: "NVIDIA RTX 4090 / AMD RX 7900 XTX" },
{ id: "ram", labelKey: "rig.ram", placeholder: "32GB DDR5-6000" },
{ id: "storage", labelKey: "rig.storage", placeholder: "2TB Samsung 990 PRO NVMe" },
{ id: "monitor", labelKey: "rig.monitor", placeholder: "LG 27GP950 27\" 4K 144Hz" },
{ id: "capture", labelKey: "rig.capture", placeholder: "OBS Studio 30.x" },
{ id: "motherboard", labelKey: "rig.motherboard", placeholder: "ASUS ROG Maximus Z790 Hero" },
{ id: "controller", labelKey: "rig.controller", placeholder: "DualSense / Xbox Elite Series 2" },
] as const;
/**
* Supported rig field input types.
*
* - `text`: plain text input (existing behaviour).
* - `dropdown_with_version`: a dropdown of preset options paired with a
* free-form version text input. The stored value is
* `"<option_value>|<version>"` so we don't break the flat
* `Partial<Record<string, string>>` rig shape in the editor store.
*/
export type RigFieldType = "text" | "dropdown_with_version";
export interface RigFieldOption {
readonly value: string;
/** Display label (not translated — software names are brand-preserved). */
readonly label: string;
}
export interface RigField {
readonly id: string;
readonly labelKey: string;
readonly type: RigFieldType;
readonly placeholder?: string;
readonly options?: readonly RigFieldOption[];
readonly versionPlaceholder?: string;
}
/**
* Dropdown options for the video editing software field.
*
* Order loosely reflects popularity among no-commentary gameplay
* creators. Add new entries here — the UI picks them up automatically.
*/
export const VIDEO_EDITOR_OPTIONS: readonly RigFieldOption[] = [
{ value: "", label: "—" },
{ value: "davinci_resolve", label: "DaVinci Resolve" },
{ value: "davinci_resolve_studio", label: "DaVinci Resolve Studio" },
{ value: "premiere", label: "Adobe Premiere Pro" },
{ value: "after_effects", label: "Adobe After Effects" },
{ value: "capcut", label: "CapCut" },
{ value: "vegas", label: "Vegas Pro" },
{ value: "final_cut", label: "Final Cut Pro" },
{ value: "kdenlive", label: "Kdenlive" },
{ value: "shotcut", label: "Shotcut" },
{ value: "filmora", label: "Wondershare Filmora" },
{ value: "other", label: "Other" },
];
export const RIG_FIELDS: readonly RigField[] = [
{ id: "cpu", labelKey: "rig.cpu", type: "text", placeholder: "Intel i9-14900K / AMD Ryzen 9 7950X" },
{ id: "gpu", labelKey: "rig.gpu", type: "text", placeholder: "NVIDIA RTX 4090 / AMD RX 7900 XTX" },
{ id: "ram", labelKey: "rig.ram", type: "text", placeholder: "32GB DDR5-6000" },
{ id: "storage", labelKey: "rig.storage", type: "text", placeholder: "2TB Samsung 990 PRO NVMe" },
{ id: "monitor", labelKey: "rig.monitor", type: "text", placeholder: "LG 27GP950 27\" 4K 144Hz" },
{ id: "capture", labelKey: "rig.capture", type: "text", placeholder: "OBS Studio 30.x" },
{ id: "motherboard", labelKey: "rig.motherboard", type: "text", placeholder: "ASUS ROG Maximus Z790 Hero" },
{ id: "controller", labelKey: "rig.controller", type: "text", placeholder: "DualSense / Xbox Elite Series 2" },
{
id: "video_editor",
labelKey: "rig.video_editor",
type: "dropdown_with_version",
options: VIDEO_EDITOR_OPTIONS,
versionPlaceholder: "19.1 / 2024 / v5.0",
},
];
export type RigFieldId = (typeof RIG_FIELDS)[number]["id"];
/**
* Format a stored rig value for display in the description output.
* For dropdown_with_version fields, this turns `"davinci_resolve_studio|19.1"`
* into `"DaVinci Resolve Studio 19.1"`. Other values pass through.
*/
export function formatRigValue(fieldId: string, raw: string): string {
const field = RIG_FIELDS.find((f) => f.id === fieldId);
if (!field || field.type !== "dropdown_with_version") return raw;
const [value = "", version = ""] = raw.split("|");
const trimmedVersion = version.trim();
if (!value && !trimmedVersion) return "";
// The empty-value sentinel option renders as "—" in the dropdown but
// should act as "no selection" in the output.
let label = "";
if (value) {
const option = field.options?.find((o) => o.value === value);
label = option?.label ?? value;
}
if (!label) return trimmedVersion;
return trimmedVersion ? `${label} ${trimmedVersion}` : label;
}
+19 -37
View File
@@ -1,41 +1,23 @@
export const SOCIAL_FIELDS = [
{ id: "kofi", labelKey: "social.kofi", urlPrefix: "https://ko-fi.com/", category: "donate" },
{
id: "patreon",
labelKey: "social.patreon",
urlPrefix: "https://patreon.com/",
category: "donate",
},
{
id: "buymeacoffee",
labelKey: "social.buymeacoffee",
urlPrefix: "https://buymeacoffee.com/",
category: "donate",
},
{
id: "paypal",
labelKey: "social.paypal",
urlPrefix: "https://paypal.me/",
category: "donate",
},
{ id: "github", labelKey: "social.github", urlPrefix: "https://github.com/", category: "social" },
{ id: "twitter", labelKey: "social.twitter", urlPrefix: "https://x.com/", category: "social" },
{ id: "discord", labelKey: "social.discord", urlPrefix: "https://discord.gg/", category: "social" },
{ id: "website", labelKey: "social.website", urlPrefix: "", category: "social" },
{ id: "twitch", labelKey: "social.twitch", urlPrefix: "https://twitch.tv/", category: "social" },
{ id: "tiktok", labelKey: "social.tiktok", urlPrefix: "https://tiktok.com/@", category: "social" },
{
id: "instagram",
labelKey: "social.instagram",
urlPrefix: "https://instagram.com/",
category: "social",
},
{
id: "streamlabs",
labelKey: "social.streamlabs",
urlPrefix: "https://streamlabs.com/",
category: "donate",
},
// Donate
{ id: "kofi", label: "Ko-fi", labelKey: "social.kofi", urlPrefix: "https://ko-fi.com/", category: "donate" },
{ id: "patreon", label: "Patreon", labelKey: "social.patreon", urlPrefix: "https://patreon.com/", category: "donate" },
{ id: "buymeacoffee", label: "Buy Me a Coffee", labelKey: "social.buymeacoffee", urlPrefix: "https://buymeacoffee.com/", category: "donate" },
{ id: "paypal", label: "PayPal", labelKey: "social.paypal", urlPrefix: "https://paypal.me/", category: "donate" },
{ id: "streamlabs", label: "Streamlabs", labelKey: "social.streamlabs", urlPrefix: "https://streamlabs.com/", category: "donate" },
// Social
{ id: "github", label: "GitHub", labelKey: "social.github", urlPrefix: "https://github.com/", category: "social" },
{ id: "twitter", label: "Twitter / X", labelKey: "social.twitter", urlPrefix: "https://x.com/", category: "social" },
{ id: "discord", label: "Discord", labelKey: "social.discord", urlPrefix: "https://discord.gg/", category: "social" },
{ id: "twitch", label: "Twitch", labelKey: "social.twitch", urlPrefix: "https://twitch.tv/", category: "social" },
{ id: "tiktok", label: "TikTok", labelKey: "social.tiktok", urlPrefix: "https://tiktok.com/@", category: "social" },
{ id: "instagram", label: "Instagram", labelKey: "social.instagram", urlPrefix: "https://instagram.com/", category: "social" },
{ id: "bluesky", label: "Bluesky", labelKey: "social.bluesky", urlPrefix: "https://bsky.app/profile/", category: "social" },
{ id: "mastodon", label: "Mastodon", labelKey: "social.mastodon", urlPrefix: "", category: "social" },
{ id: "facebook", label: "Facebook", labelKey: "social.facebook", urlPrefix: "https://facebook.com/", category: "social" },
{ id: "fb_page", label: "Facebook Page", labelKey: "social.fb_page", urlPrefix: "https://facebook.com/", category: "social" },
{ id: "fb_group", label: "Facebook Group", labelKey: "social.fb_group", urlPrefix: "https://facebook.com/groups/", category: "social" },
{ id: "website", label: "Website", labelKey: "social.website", urlPrefix: "", category: "social" },
] as const;
export type SocialFieldId = (typeof SOCIAL_FIELDS)[number]["id"];
+4
View File
@@ -1,6 +1,8 @@
export const VIDEO_TYPES = [
{ id: "full", labelKey: "videoTypes.full", icon: "🎮", extraFields: [] },
{ id: "part", labelKey: "videoTypes.part", icon: "📂", extraFields: ["partNumber"] },
{ id: "full_demo", labelKey: "videoTypes.full_demo", icon: "🎬", extraFields: [] },
{ id: "demo_part", labelKey: "videoTypes.demo_part", icon: "🎞", extraFields: ["partNumber"] },
{ id: "boss", labelKey: "videoTypes.boss", icon: "👹", extraFields: ["bossName"] },
{ id: "boss_nohit", labelKey: "videoTypes.boss_nohit", icon: "💀", extraFields: ["bossName"] },
{ id: "ending", labelKey: "videoTypes.ending", icon: "🏁", extraFields: [] },
@@ -13,6 +15,8 @@ export const VIDEO_TYPES = [
{ id: "secret", labelKey: "videoTypes.secret", icon: "🔍", extraFields: [] },
{ id: "comparison", labelKey: "videoTypes.comparison", icon: "⚖️", extraFields: [] },
{ id: "guide", labelKey: "videoTypes.guide", icon: "📘", extraFields: [] },
{ id: "mods", labelKey: "videoTypes.mods", icon: "🧩", extraFields: ["modName"] },
{ id: "collectibles", labelKey: "videoTypes.collectibles", icon: "⭐", extraFields: [] },
] as const;
export type VideoTypeId = (typeof VIDEO_TYPES)[number]["id"];
+137 -40
View File
@@ -1,28 +1,55 @@
import type { GeneratorInput, TranslationFn, CharLimitWarning } from "./types";
import { YT_LIMITS } from "./types";
import { PLATFORMS } from "@config/platforms";
import { SOCIAL_FIELDS } from "@config/social-fields";
import { formatRigValue } from "@config/rig-fields";
import { parseTimeline, renderTimeline } from "./timeline-parser";
import { sanitizeHashtag } from "@utils/sanitize";
const SOCIAL_ICONS: Record<string, string> = {
kofi: "☕",
patreon: "🎨",
buymeacoffee: "☕",
paypal: "💸",
streamlabs: "🎬",
github: "🐙",
twitter: "🐦",
discord: "💬",
twitch: "📺",
tiktok: "🎵",
instagram: "📸",
bluesky: "🦋",
mastodon: "🐘",
facebook: "👤",
fb_page: "📄",
fb_group: "👥",
website: "🌐",
};
function hasEntries(obj: Partial<Record<string, string>>): boolean {
return Object.values(obj).some((v) => v && v.trim() !== "");
}
function formatKeyValueBlock(
obj: Partial<Record<string, string>>,
labelMap?: Record<string, string>,
): string {
return Object.entries(obj)
.filter(([, v]) => v && v.trim() !== "")
.map(([k, v]) => {
const label = labelMap?.[k] ?? k.toUpperCase();
return `${label}: ${v}`;
})
.join("\n");
function getLabelForId(id: string, configs: readonly { id: string; label: string }[]): string {
return configs.find((c) => c.id === id)?.label ?? id;
}
export interface BuildDescriptionOptions {
hashtagCount?: number;
/** When true and channelName is non-empty, appends an auto-generated
* copyright line after the CTA. */
showCopyright?: boolean;
/** When true, appends a localised usage-policy block after the
* copyright line. */
showUsagePolicy?: boolean;
}
export function buildDescription(
input: GeneratorInput,
t: TranslationFn,
hashtagCount = 3,
options: BuildDescriptionOptions = {},
): string {
const { hashtagCount = 3, showCopyright = false, showUsagePolicy = false } = options;
const sections: string[] = [];
const gameName =
input.gameNameLocalized?.[input.language] ?? input.gameName;
@@ -35,24 +62,56 @@ export function buildDescription(
bossName: input.bossName ?? "",
dlcName: input.dlcName ?? "",
challengeName: input.challengeName ?? "",
modName: input.modName ?? "",
});
sections.push(intro);
// 2. No Commentary tagline
sections.push(t("description.noCommentaryLine"));
// 3. Timestamps
// 3. Timestamps (parsed + localized keywords)
if (input.timestamps && input.timestamps.trim()) {
sections.push(`${t("description.sections.timestamps")}\n${input.timestamps.trim()}`);
const entries = parseTimeline(input.timestamps);
const rendered = renderTimeline(entries, input.language, t);
sections.push(`${t("description.sections.timestamps")}\n${rendered}`);
}
// 4. Store Links
// 4. Store Links (heading + per-link suffix by pricing category)
if (hasEntries(input.storeLinks)) {
const links = Object.entries(input.storeLinks)
.filter(([, v]) => v && v.trim() !== "")
.map(([platform, url]) => `${platform}: ${url}`)
.join("\n");
sections.push(`${t("description.sections.storeLinks")}\n${links}`);
const entries = Object.entries(input.storeLinks)
.filter((entry): entry is [string, string] =>
typeof entry[1] === "string" && entry[1].trim() !== "",
)
.map(([id, url]) => ({
id,
url: url.trim(),
type: (input.storeLinkTypes?.[id] ?? "paid") as "paid" | "free" | "demo",
}));
if (entries.length > 0) {
// Majority rule: if more than half the links are free/demo,
// switch the heading to "DOWNLOAD THE GAME". Ties favour "GET".
const nonPaid = entries.filter((e) => e.type !== "paid").length;
const headingKey =
nonPaid > entries.length / 2
? "description.sections.storeLinksDownload"
: "description.sections.storeLinksBuy";
const lines = entries
.map((e) => {
const label = getLabelForId(e.id, PLATFORMS);
const suffix =
e.type === "demo"
? ` (${t("description.storeLinkSuffix.demo")})`
: e.type === "free"
? ` (${t("description.storeLinkSuffix.free")})`
: "";
return `🎮 ${label}${suffix}: ${e.url}`;
})
.join("\n");
sections.push(`${t(headingKey)}\n${lines}`);
}
}
// 5. Video Settings
@@ -66,7 +125,14 @@ export function buildDescription(
// 6. Rig
if (hasEntries(input.rig)) {
sections.push(`${t("description.sections.rig")}\n${formatKeyValueBlock(input.rig)}`);
const rigLines = Object.entries(input.rig)
.map(([k, v]) => [k, formatRigValue(k, v ?? "")] as const)
.filter(([, v]) => v && v.trim() !== "")
.map(([k, v]) => `${k.replace(/_/g, " ").toUpperCase()}: ${v}`)
.join("\n");
if (rigLines) {
sections.push(`${t("description.sections.rig")}\n${rigLines}`);
}
}
// 7. Spoiler Warning
@@ -79,24 +145,34 @@ export function buildDescription(
sections.push(t("description.sections.matureWarning"));
}
// 9. Donate Links
const donateFields = ["kofi", "patreon", "buymeacoffee", "paypal", "streamlabs"];
const donateLinks = Object.entries(input.social)
.filter(([k, v]) => donateFields.includes(k) && v && v.trim() !== "")
.map(([k, v]) => `${k}: ${v}`)
.join("\n");
if (donateLinks) {
sections.push(`${t("description.sections.donate")}\n${donateLinks}`);
// 8.5. Music / sound attribution — sits right before the donate
// block because both are "credits"-adjacent sections.
if (input.musicAttribution && input.musicAttribution.trim()) {
sections.push(
`${t("description.sections.music")}\n${input.musicAttribution.trim()}`,
);
}
// 10. Social Links
const socialFields = ["github", "twitter", "discord", "twitch", "tiktok", "instagram", "website"];
const socialLinks = Object.entries(input.social)
.filter(([k, v]) => socialFields.includes(k) && v && v.trim() !== "")
.map(([k, v]) => `${k}: ${v}`)
.join("\n");
if (socialLinks) {
sections.push(`${t("description.sections.social")}\n${socialLinks}`);
// 9. Donate Links (use proper labels + icons)
const donateEntries = Object.entries(input.social)
.filter(([k, v]) => {
const field = SOCIAL_FIELDS.find((f) => f.id === k);
return field?.category === "donate" && v && v.trim() !== "";
})
.map(([k, v]) => `${SOCIAL_ICONS[k] ?? "💰"} ${getLabelForId(k, SOCIAL_FIELDS)}: ${v}`);
if (donateEntries.length > 0) {
sections.push(`${t("description.sections.donate")}\n${donateEntries.join("\n")}`);
}
// 10. Social Links (use proper labels + icons)
const socialEntries = Object.entries(input.social)
.filter(([k, v]) => {
const field = SOCIAL_FIELDS.find((f) => f.id === k);
return field?.category === "social" && v && v.trim() !== "";
})
.map(([k, v]) => `${SOCIAL_ICONS[k] ?? "🔗"} ${getLabelForId(k, SOCIAL_FIELDS)}: ${v}`);
if (socialEntries.length > 0) {
sections.push(`${t("description.sections.social")}\n${socialEntries.join("\n")}`);
}
// 11. Playlist
@@ -112,11 +188,32 @@ export function buildDescription(
// 13. CTA
sections.push(t("description.sections.cta"));
// 14. Hashtags
// 13.5 Copyright line — auto-generated from channelName + current year.
// Skipped when the creator hasn't set a channel name (nothing to claim).
if (showCopyright && input.channelName.trim()) {
const year = new Date().getFullYear();
sections.push(
t("description.sections.copyright", {
year: String(year),
channelName: input.channelName.trim(),
}),
);
}
// 13.7 Usage policy — fixed localised template behind a Settings toggle.
if (showUsagePolicy) {
const header = t("description.sections.usagePolicyHeader");
const body = t("description.sections.usagePolicy");
sections.push(`${header}\n${body}`);
}
// 14. Hashtags — first genre is the primary tag; any further genres are
// already represented in the tag list so they don't duplicate here.
const primaryGenre = input.genres[0];
const allHashtags = [
`#${gameName.replace(/\s+/g, "")}`,
`#${sanitizeHashtag(gameName)}`,
"#GameplayNoCommentary",
`#${input.genre}`,
...(primaryGenre ? [`#${sanitizeHashtag(primaryGenre)}`] : []),
];
sections.push(allHashtags.slice(0, hashtagCount).join(" "));
+78
View File
@@ -0,0 +1,78 @@
import type { TranslationFn } from "./types";
import { PLATFORMS } from "@config/platforms";
export type PlaylistStatus = "completed" | "dropped" | "incomplete" | "in_progress";
export type PlaylistContentType =
| "full_gameplay"
| "boss_fights"
| "speedrun"
| "all_endings"
| "dlc"
| "100_percent"
| "guide"
| "highlights";
export interface PlaylistInput {
gameName: string;
channelName: string;
status: PlaylistStatus;
contentType: PlaylistContentType;
totalVideos?: number;
storeLinks?: Partial<Record<string, string>>;
playlistNote?: string;
}
export interface PlaylistOutput {
title: string;
description: string;
}
export function buildPlaylistTitle(input: PlaylistInput, t: TranslationFn): string {
const statusText = t(`playlist.status.${input.status}`);
return t("playlist.titleFormat", {
status: statusText,
gameName: input.gameName,
});
}
export function buildPlaylistDescription(input: PlaylistInput, t: TranslationFn): string {
const lines: string[] = [];
lines.push(
t(`playlist.description.${input.contentType}`, {
gameName: input.gameName,
channelName: input.channelName,
}),
);
lines.push("");
if (input.totalVideos && input.totalVideos > 0) {
lines.push(t("playlist.videoCount", { count: String(input.totalVideos) }));
lines.push("");
}
if (input.storeLinks) {
const storeEntries = Object.entries(input.storeLinks).filter(
([, url]) => url && url.trim() !== "",
);
if (storeEntries.length > 0) {
lines.push(t("playlist.storeSection"));
for (const [id, url] of storeEntries) {
const platform = PLATFORMS.find((p) => p.id === id);
lines.push(`🎮 ${platform?.label ?? id}: ${url}`);
}
lines.push("");
}
}
if (input.playlistNote?.trim()) {
lines.push(input.playlistNote.trim());
lines.push("");
}
lines.push(t("playlist.footer"));
return lines.join("\n");
}
+256 -59
View File
@@ -1,37 +1,172 @@
import type { GeneratorInput } from "./types";
import type { GeneratorInput, SupportedLanguage } from "./types";
import { YT_LIMITS } from "./types";
import { humanizeId } from "@utils/sanitize";
/**
* Genre tag pool registry.
*
* Each entry returns an array of tags for the given game name. These tags
* are language-agnostic (English-based SEO terms commonly searched across
* all regions). Language-specific tags come from CORE_TAGS_BY_LANG and
* MULTILINGUAL_TAGS.
*/
const GENRE_TAG_REGISTRY: Record<string, (gameName: string) => string[]> = {
action: (g) => [`${g} action`, "action game no commentary", "action adventure gameplay"],
horror: (g) => [`${g} horror`, "horror game no commentary", "survival horror gameplay"],
rpg: (g) => [`${g} RPG`, "RPG no commentary", "RPG gameplay", "JRPG no commentary"],
fps: (g) => [`${g} FPS`, "FPS no commentary", "shooter gameplay no commentary"],
openworld: (g) => [`${g} open world`, "open world no commentary", "free roam gameplay"],
indie: (g) => [`${g} indie`, "indie game no commentary", "indie gameplay"],
soulslike: (g) => [`${g} souls like`, "soulsborne no commentary", "souls like gameplay"],
racing: (g) => [`${g} racing`, "racing game no commentary", "racing gameplay"],
story: (g) => [`${g} story`, "story game no commentary", "narrative gameplay"],
simulation: (g) => [`${g} simulation`, "simulation game no commentary", "strategy gameplay"],
fighting: (g) => [`${g} fighting`, "fighting game no commentary", "combo gameplay"],
stealth: (g) => [`${g} stealth`, "stealth game no commentary", "stealth gameplay"],
survival_craft: (g) => [`${g} survival`, "survival crafting no commentary", "base building"],
roguelike: (g) => [`${g} roguelike`, "roguelike no commentary", "roguelite gameplay"],
metroidvania: (g) => [`${g} metroidvania`, "metroidvania no commentary", "exploration gameplay"],
mmo: (g) => [`${g} MMO`, "MMO no commentary", "MMORPG gameplay"],
rhythm: (g) => [`${g} rhythm`, "rhythm game no commentary", "music game gameplay"],
puzzle: (g) => [`${g} puzzle`, "puzzle game no commentary", "brain teaser gameplay"],
tower_defense: (g) => [`${g} tower defense`, "tower defense no commentary", "TD gameplay"],
card_game: (g) => [`${g} card game`, "deck builder no commentary", "card game gameplay"],
battle_royale: (g) => [`${g} battle royale`, "battle royale no commentary", "BR gameplay"],
crpg: (g) => [`${g} CRPG`, "CRPG no commentary", "isometric RPG gameplay"],
tactical: (g) => [`${g} tactical`, "tactical game no commentary", "turn based strategy"],
space: (g) => [`${g} space`, "space game no commentary", "sci-fi gameplay"],
farming: (g) => [`${g} farming`, "farming sim no commentary", "cozy game gameplay"],
action: (g) => [`${g} action`, "action game no commentary", "action adventure gameplay", `${g} combat`],
horror: (g) => [`${g} horror`, "horror game no commentary", "survival horror gameplay", `${g} scary`],
rpg: (g) => [`${g} RPG`, "RPG no commentary", "RPG gameplay", "JRPG no commentary", `${g} role playing`],
fps: (g) => [`${g} FPS`, "FPS no commentary", "shooter gameplay no commentary", `${g} shooter`],
openworld: (g) => [`${g} open world`, "open world no commentary", "free roam gameplay", `${g} exploration`],
indie: (g) => [`${g} indie`, `${g} indie game`, "indie game no commentary", "indie gameplay", "best indie games"],
soulslike: (g) => [`${g} souls like`, "soulsborne no commentary", "souls like gameplay", `${g} hardcore`],
racing: (g) => [`${g} racing`, "racing game no commentary", "racing gameplay", `${g} cars`],
story: (g) => [
`${g} story`,
`${g} story mode`,
"story game no commentary",
"narrative gameplay",
"cinematic adventure no commentary",
],
simulation: (g) => [`${g} simulation`, "simulation game no commentary", "strategy gameplay", `${g} sim`],
fighting: (g) => [`${g} fighting`, "fighting game no commentary", "combo gameplay", `${g} fight`],
stealth: (g) => [`${g} stealth`, "stealth game no commentary", "stealth gameplay", `${g} ghost run`],
survival_craft: (g) => [
`${g} survival`,
"survival crafting no commentary",
"base building",
`${g} crafting`,
],
roguelike: (g) => [`${g} roguelike`, "roguelike no commentary", "roguelite gameplay", `${g} run`],
metroidvania: (g) => [
`${g} metroidvania`,
"metroidvania no commentary",
"exploration gameplay",
`${g} platformer`,
],
mmo: (g) => [`${g} MMO`, "MMO no commentary", "MMORPG gameplay", `${g} online`],
rhythm: (g) => [`${g} rhythm`, "rhythm game no commentary", "music game gameplay", `${g} music`],
puzzle: (g) => [`${g} puzzle`, "puzzle game no commentary", "brain teaser gameplay", `${g} logic`],
tower_defense: (g) => [`${g} tower defense`, "tower defense no commentary", "TD gameplay", `${g} strategy`],
card_game: (g) => [`${g} card game`, "deck builder no commentary", "card game gameplay", `${g} TCG`],
battle_royale: (g) => [`${g} battle royale`, "battle royale no commentary", "BR gameplay", `${g} solo`],
crpg: (g) => [`${g} CRPG`, "CRPG no commentary", "isometric RPG gameplay", `${g} party`],
tactical: (g) => [`${g} tactical`, "tactical game no commentary", "turn based strategy", `${g} tactics`],
space: (g) => [`${g} space`, "space game no commentary", "sci-fi gameplay", `${g} sci fi`],
farming: (g) => [`${g} farming`, "farming sim no commentary", "cozy game gameplay", `${g} cozy`],
fmv: (g) => [`${g} FMV`, "FMV game no commentary", "interactive movie gameplay", `${g} live action`],
visual_novel: (g) => [
`${g} visual novel`,
`${g} VN no commentary`,
"visual novel gameplay",
"kinetic novel no commentary",
`${g} story mode`,
],
hack_slash: (g) => [
`${g} hack and slash`,
"hack and slash no commentary",
`${g} combo gameplay`,
"character action game",
],
beatemup: (g) => [
`${g} beat em up`,
"beat em up no commentary",
`${g} brawler`,
"belt scroll action",
],
platformer: (g) => [
`${g} platformer`,
"platformer no commentary",
`${g} 2d platformer`,
`${g} 3d platformer`,
],
survival_horror: (g) => [
`${g} survival horror`,
"survival horror no commentary",
`${g} resource management horror`,
"classic survival horror",
],
psychological_horror: (g) => [
`${g} psychological horror`,
"psychological horror no commentary",
`${g} atmospheric horror`,
"mind bending horror gameplay",
],
jrpg: (g) => [
`${g} JRPG`,
"JRPG no commentary",
`${g} japanese RPG`,
"turn based JRPG gameplay",
],
action_rpg: (g) => [
`${g} action RPG`,
"action RPG no commentary",
`${g} ARPG`,
"action RPG gameplay",
],
arena_shooter: (g) => [
`${g} arena shooter`,
"arena shooter no commentary",
`${g} arena FPS`,
"fast paced shooter gameplay",
],
tactical_fps: (g) => [
`${g} tactical FPS`,
"tactical shooter no commentary",
`${g} milsim`,
"tactical FPS gameplay",
],
boomer_shooter: (g) => [
`${g} boomer shooter`,
"boomer shooter no commentary",
`${g} retro fps`,
"90s shooter gameplay",
],
extraction_shooter: (g) => [
`${g} extraction shooter`,
"extraction shooter no commentary",
`${g} loot and extract`,
"extraction FPS gameplay",
],
shmup: (g) => [
`${g} shmup`,
`${g} bullet hell`,
"shoot em up no commentary",
"danmaku gameplay",
],
city_builder: (g) => [
`${g} city builder`,
"city builder no commentary",
`${g} city building`,
"city sim gameplay",
],
deck_builder: (g) => [
`${g} deck builder`,
"deck builder no commentary",
`${g} deckbuilding roguelike`,
"deck building gameplay",
],
auto_battler: (g) => [
`${g} auto battler`,
"auto battler no commentary",
`${g} auto chess`,
"auto battler gameplay",
],
};
const VIDEO_TYPE_TAGS: Record<string, (gameName: string) => string[]> = {
full: (g) => [`${g} full game`, `${g} full gameplay no commentary`, `${g} longplay`],
part: (g) => [`${g} walkthrough`, `${g} playthrough`, `${g} let's play no commentary`],
full_demo: (g) => [
`${g} demo`,
`${g} full demo`,
`${g} demo gameplay no commentary`,
"game demo no commentary",
],
demo_part: (g) => [
`${g} demo part`,
`${g} demo playthrough`,
`${g} demo walkthrough`,
"demo gameplay no commentary",
],
boss: (g) => [`${g} boss fight`, `${g} boss battle`, "boss fight no commentary"],
boss_nohit: (g) => [`${g} boss no hit`, `${g} no damage boss`, "no hit boss fight"],
ending: (g) => [`${g} ending`, `${g} all endings`, `${g} final boss`],
@@ -44,31 +179,84 @@ const VIDEO_TYPE_TAGS: Record<string, (gameName: string) => string[]> = {
secret: (g) => [`${g} secret`, `${g} hidden`, "secret content no commentary"],
comparison: (g) => [`${g} comparison`, `${g} graphics comparison`, "comparison no commentary"],
guide: (g) => [`${g} guide`, `${g} silent guide`, "guide no commentary"],
mods: (g) => [
`${g} mods`,
`${g} modded gameplay`,
"modded gameplay no commentary",
`${g} mod showcase`,
],
collectibles: (g) => [
`${g} all collectibles`,
`${g} 100% collectibles`,
`${g} completionist no commentary`,
`${g} achievement guide`,
],
};
const MULTILINGUAL_TAGS: Record<string, (gameName: string) => string[]> = {
ja: (g) => [`${g} ゲームプレイ`, `${g} 実況なし`, "ゲームプレイ 実況なし"],
vi: (g) => [`${g} gameplay không bình luận`, `${g} không bình luận`],
es: (g) => [`${g} sin comentarios`, `${g} gameplay completo`],
ko: (g) => [`${g} 게임플레이`, `${g} 무편집`],
zh: (g) => [`${g} 无解说`, `${g} 游戏实况`],
};
function getCoreTags(gameName: string): string[] {
return [
`${gameName} gameplay`,
`${gameName} no commentary`,
/**
* Language-specific "core" tag pool. Replaces the previous English-only
* getCoreTags. Selected by GeneratorInput.language so the channel can
* match the viewer's region.
*/
const CORE_TAGS_BY_LANG: Record<SupportedLanguage, (gameName: string) => string[]> = {
en: (g) => [
`${g} gameplay`,
`${g} no commentary`,
"gameplay no commentary",
`${gameName} walkthrough`,
`${gameName} full game`,
`${gameName} gameplay no commentary`,
];
}
`${g} walkthrough`,
`${g} full game`,
`${g} gameplay no commentary`,
],
vi: (g) => [
`${g} gameplay`,
`${g} không bình luận`,
`${g} gameplay không bình luận`,
"gameplay không bình luận",
`${g} chơi thử`,
`${g} let's play`,
],
ja: (g) => [
`${g} ゲームプレイ`,
`${g} 実況なし`,
"ゲームプレイ 実況なし",
`${g} 攻略`,
`${g} プレイ動画`,
`${g} 実況プレイ`,
],
es: (g) => [
`${g} gameplay`,
`${g} sin comentarios`,
"gameplay sin comentarios",
`${g} completo`,
`${g} guía`,
`${g} español`,
],
ko: (g) => [`${g} 게임플레이`, `${g} 무편집`, "게임플레이 무편집", `${g} 공략`, `${g} 플레이`, `${g} 한국어`],
zh: (g) => [`${g} 游戏实况`, `${g} 无解说`, "游戏实况 无解说", `${g} 攻略`, `${g} 流程`, `${g} 通关`],
};
/**
* Extra region-specific tags added when includeMultilingualTags is true.
* Only the selected language's entry is used — v0.2.0 incorrectly mixed
* all languages regardless of the user's choice.
*/
const MULTILINGUAL_TAGS: Record<SupportedLanguage, (gameName: string) => string[]> = {
en: (g) => [`${g} english`, "gameplay english no commentary"],
ja: (g) => [`${g} 日本語`, `${g} 実況`, "日本語 ゲームプレイ"],
vi: (g) => [`${g} tiếng Việt`, `${g} thuyết minh`, "gameplay tiếng Việt"],
es: (g) => [`${g} español`, `${g} en español`, "gameplay en español"],
ko: (g) => [`${g} 한국어`, `${g} 플레이`, "한국어 게임플레이"],
zh: (g) => [`${g} 中文`, `${g} 游戏`, "中文 游戏实况"],
};
function getPlatformTags(gameName: string, platform: string): string[] {
if (!platform) return [];
const platformLabel = platform.toUpperCase();
return [`${gameName} ${platformLabel}`, `${platformLabel} gameplay`, `${gameName} ${platformLabel} gameplay`];
return [
`${gameName} ${platformLabel}`,
`${platformLabel} gameplay`,
`${gameName} ${platformLabel} gameplay`,
];
}
function getQualityTags(gameName: string, resolution?: string, fps?: string): string[] {
@@ -87,7 +275,8 @@ function getQualityTags(gameName: string, resolution?: string, fps?: string): st
function getTrendingTags(gameName: string, genre: string): string[] {
const year = new Date().getFullYear().toString();
return [`${gameName} ${year}`, `best ${genre} games ${year}`, `${genre} gameplay ${year}`];
const genreLabel = humanizeId(genre);
return [`${gameName} ${year}`, `best ${genreLabel} games ${year}`, `${genreLabel} gameplay ${year}`];
}
export interface TagOptions {
@@ -97,18 +286,21 @@ export interface TagOptions {
export function generateTags(input: GeneratorInput, options?: TagOptions): string[] {
const { includeMultilingualTags = true, includeTrendingTags = true } = options ?? {};
const gameName =
input.gameNameLocalized?.[input.language] ?? input.gameName;
const gameName = input.gameNameLocalized?.[input.language] ?? input.gameName;
const allTags: string[] = [];
// Core tags (highest priority)
allTags.push(...getCoreTags(gameName));
// Core tags — language-specific (highest priority)
const coreFn = CORE_TAGS_BY_LANG[input.language] ?? CORE_TAGS_BY_LANG.en;
allTags.push(...coreFn(gameName));
// Genre tags
const genreFn = GENRE_TAG_REGISTRY[input.genre];
if (genreFn) {
allTags.push(...genreFn(gameName));
// Genre tags — merge contributions from every selected genre.
// Final dedup at the bottom collapses overlap across the pools.
for (const genre of input.genres) {
const genreFn = GENRE_TAG_REGISTRY[genre];
if (genreFn) {
allTags.push(...genreFn(gameName));
}
}
// Video type tags
@@ -123,19 +315,24 @@ export function generateTags(input: GeneratorInput, options?: TagOptions): strin
// Quality tags
allTags.push(...getQualityTags(gameName, input.resolution, input.fps));
// Multilingual tags
// Multilingual tags — only the selected language (v0.3.0 fix: was
// previously iterating over every language entry).
if (includeMultilingualTags) {
for (const [, langFn] of Object.entries(MULTILINGUAL_TAGS)) {
const langFn = MULTILINGUAL_TAGS[input.language];
if (langFn) {
allTags.push(...langFn(gameName));
}
}
// Trending tags (lowest priority)
if (includeTrendingTags) {
allTags.push(...getTrendingTags(gameName, input.genre));
// Trending tags (lowest priority). The first genre stands in as the
// "primary" genre for the template — multi-genre games usually have
// one headline category that searchers use.
const primaryGenre = input.genres[0];
if (includeTrendingTags && primaryGenre) {
allTags.push(...getTrendingTags(gameName, primaryGenre));
}
// Dedup (case-insensitive)
// Dedup (case-insensitive) and enforce per-tag char limit
const seen = new Set<string>();
const deduped: string[] = [];
for (const tag of allTags) {
+23 -2
View File
@@ -6,6 +6,23 @@ import { YT_LIMITS } from "./types";
export interface RenderOptions extends TagOptions {
hashtagCount?: number;
/**
* When true, buildTitle appends a `[2K 60FPS]`-style badge to the
* video-type segment whenever resolution/fps are above the defaults.
* Defaults to true at the engine level; callers override with the
* user's setting.
*/
showQualityBadge?: boolean;
/**
* When true (and channelName is non-empty), the description ends with
* an auto-generated `© <year> <channelName>. All rights reserved.` line.
*/
showCopyright?: boolean;
/**
* When true, the description appends a localised "usage policy" block
* (📋 USAGE POLICY) after the copyright line.
*/
showUsagePolicy?: boolean;
}
export function renderAll(
@@ -13,8 +30,12 @@ export function renderAll(
t: TranslationFn,
options?: RenderOptions,
): GeneratorOutput {
const title = buildTitle(input, t);
const description = buildDescription(input, t, options?.hashtagCount);
const title = buildTitle(input, t, options?.showQualityBadge ?? true);
const description = buildDescription(input, t, {
hashtagCount: options?.hashtagCount,
showCopyright: options?.showCopyright,
showUsagePolicy: options?.showUsagePolicy,
});
const tags = generateTags(input, options);
const tagString = formatTagString(tags);
+181
View File
@@ -0,0 +1,181 @@
import type { SupportedLanguage, TranslationFn } from "./types";
/**
* Canonical keyword IDs recognized by the parser. Each corresponds to a
* translation key under `timeline.keywords.*` in templates.json.
*/
export type TimelineKeyword =
| "chapter"
| "part"
| "boss"
| "final_boss"
| "intro"
| "ending"
| "tutorial"
| "credits";
export interface TimelineEntry {
/** Raw timecode as it appeared in the input (e.g. "0:00", "1:23:45"). */
time: string;
/** Entire label portion after the timecode (trimmed). */
rawLabel: string;
/** Keyword that the label was classified as, if any. */
keyword?: TimelineKeyword;
/** Ordinal number when the keyword supports one (e.g. Chapter 3 -> 3). */
number?: number;
/** Trailing text after the keyword+number, if any (preserved for context). */
rest?: string;
}
// Regex for extracting time + label from a line. Accepts MM:SS or HH:MM:SS.
const LINE_RE = /^\s*((?:\d{1,2}:)?\d{1,2}:\d{2})\s+(.+?)\s*$/;
// Keyword patterns. Order matters — "final boss" must be tried before "boss".
// Each regex captures the optional number group when applicable.
interface KeywordPattern {
re: RegExp;
keyword: TimelineKeyword;
hasNumber: boolean;
}
const KEYWORD_PATTERNS: KeywordPattern[] = [
// Final boss (multi-language, no number). Must come BEFORE "boss".
{
re: /^(final\s+boss|boss\s+cuối\s+cùng|boss\s+cuối|ラスボス|最終\s*ボス|jefe\s+final|최종\s*보스|最终\s*boss|最终\s*首领)(.*)$/i,
keyword: "final_boss",
hasNumber: false,
},
// Chapter — captures various CJK/Latin forms
{
re: /^(?:chapter|chap\.?|chương|chuong|capítulo|capitulo|第\s*(\d+)\s*章|제\s*(\d+)\s*장|章|장)\s*(\d+)?(.*)$/i,
keyword: "chapter",
hasNumber: true,
},
// Part
{
re: /^(?:part|phần|phan|パート|parte|파트|第\s*(\d+)\s*部|部分)\s*(\d+)?(.*)$/i,
keyword: "part",
hasNumber: true,
},
// Boss (single, with optional number)
{
re: /^(?:boss|ボス|jefe|보스)\s*(\d+)?(.*)$/i,
keyword: "boss",
hasNumber: true,
},
// Intro
{
re: /^(intro|introduction|mở\s+đầu|mo\s+dau|オープニング|オープン|introducción|introduccion|인트로|开场|序幕)(.*)$/i,
keyword: "intro",
hasNumber: false,
},
// Ending
{
re: /^(ending|kết\s+thúc|ket\s+thuc|エンディング|final|엔딩|结局|结尾)(.*)$/i,
keyword: "ending",
hasNumber: false,
},
// Tutorial
{
re: /^(tutorial|hướng\s+dẫn|huong\s+dan|チュートリアル|튜토리얼|教程)(.*)$/i,
keyword: "tutorial",
hasNumber: false,
},
// Credits
{
re: /^(credits|credit|クレジット|créditos|creditos|크레딧|片尾|职员表)(.*)$/i,
keyword: "credits",
hasNumber: false,
},
];
/**
* Parse a raw timestamp textarea value into structured entries.
*
* Each non-empty line is expected to start with a timecode. Lines that
* don't match the `time + label` shape are still preserved as entries
* with `time: ""` so the original text isn't lost.
*/
export function parseTimeline(raw: string): TimelineEntry[] {
const entries: TimelineEntry[] = [];
const lines = raw.split(/\r?\n/);
for (const line of lines) {
if (!line.trim()) continue;
const lineMatch = line.match(LINE_RE);
if (!lineMatch) {
// Not a `time label` line — keep the raw text so nothing disappears.
entries.push({ time: "", rawLabel: line.trim() });
continue;
}
const time = lineMatch[1] ?? "";
const label = lineMatch[2] ?? "";
const entry: TimelineEntry = { time, rawLabel: label };
for (const pattern of KEYWORD_PATTERNS) {
const m = label.match(pattern.re);
if (!m) continue;
entry.keyword = pattern.keyword;
if (pattern.hasNumber) {
// Scan every capture group for the first numeric one. Different
// alternatives (e.g. "第N章" vs "Chapter N") place the number in
// different group positions, so treat them uniformly.
for (let i = 1; i < m.length - 1; i++) {
const g = m[i];
if (g && /^\d+$/.test(g)) {
entry.number = parseInt(g, 10);
break;
}
}
}
const rest = m[m.length - 1];
if (rest && rest.trim()) {
entry.rest = rest.trim();
}
break;
}
entries.push(entry);
}
return entries;
}
/**
* Render parsed entries back into the timestamp block, translating
* recognized keywords into the requested language via i18next.
*
* Lines without a recognized keyword keep their original label so
* the user's free-form text is preserved.
*/
export function renderTimeline(
entries: TimelineEntry[],
_language: SupportedLanguage,
t: TranslationFn,
): string {
const rendered: string[] = [];
for (const entry of entries) {
if (!entry.time) {
rendered.push(entry.rawLabel);
continue;
}
if (!entry.keyword) {
rendered.push(`${entry.time} ${entry.rawLabel}`);
continue;
}
const numberVar = entry.number != null ? String(entry.number) : "";
const translated = t(`timeline.keywords.${entry.keyword}`, { n: numberVar });
const withRest = entry.rest ? `${translated} ${entry.rest}` : translated;
rendered.push(`${entry.time} ${withRest}`);
}
return rendered.join("\n");
}
+34 -2
View File
@@ -1,7 +1,32 @@
import type { GeneratorInput, TranslationFn, CharLimitWarning } from "./types";
import { YT_LIMITS } from "./types";
export function buildTitle(input: GeneratorInput, t: TranslationFn): string {
/**
* Compact "[2K 60FPS]" badge appended to the video-type segment when the
* recording quality is above the defaults (1080p / 60fps).
*
* Rules:
* - 1080p + 60fps → empty string (no badge, keeps the title short).
* - Resolution above 1080p → map 1440p to "2K"; 720p/4K pass through.
* - Non-default FPS → include the resolution alongside (e.g. "1080p 120FPS")
* so a lonely FPS number isn't ambiguous.
*/
export function buildQualityBadge(resolution?: string, fps?: string): string {
const res = resolution || "1080p";
const fpsValue = fps || "60";
const resDefault = res === "1080p";
const fpsDefault = fpsValue === "60";
if (resDefault && fpsDefault) return "";
const resLabel = res === "1440p" ? "2K" : res;
return fpsDefault ? resLabel : `${resLabel} ${fpsValue}FPS`;
}
export function buildTitle(
input: GeneratorInput,
t: TranslationFn,
showQualityBadge = true,
): string {
const separator = t("title.separator");
const suffix = t("title.suffix");
@@ -10,14 +35,21 @@ export function buildTitle(input: GeneratorInput, t: TranslationFn): string {
bossName: input.bossName ?? "",
dlcName: input.dlcName ?? "",
challengeName: input.challengeName ?? "",
modName: input.modName ?? "",
});
const gameName =
input.gameNameLocalized?.[input.language] ?? input.gameName;
const qualityBadge = showQualityBadge ? buildQualityBadge(input.resolution, input.fps) : "";
const parts = [gameName];
if (videoTypeLabel) {
parts.push(videoTypeLabel);
parts.push(qualityBadge ? `${videoTypeLabel} [${qualityBadge}]` : videoTypeLabel);
} else if (qualityBadge) {
// Edge case: some video types render to empty string (e.g. "full").
// Still surface the quality badge as its own segment so viewers see it.
parts.push(`[${qualityBadge}]`);
}
parts.push(suffix);
+72
View File
@@ -0,0 +1,72 @@
import type { GeneratorInput, TranslationFn } from "./types";
import { buildQualityBadge } from "./title-builder";
export type TitleVariantId = "default" | "typeFirst" | "qualityFirst";
export interface TitleVariant {
id: TitleVariantId;
/** i18n key under `output.variants.*`. */
labelKey: string;
title: string;
}
/**
* Builds three alternative title phrasings so a creator can A/B test
* the same video. Reuses `buildQualityBadge` for consistency with the
* primary title builder — a title with the badge off in
* `useGeneratedOutput` will produce variants without the badge too.
*
* - default: Game — Type [2K 60FPS] — Gameplay No Commentary
* - typeFirst: Type — Game [2K 60FPS] — Gameplay No Commentary
* - qualityFirst: [2K 60FPS] Game — Type — Gameplay No Commentary
*
* When the badge is empty (1080p 60fps or toggle off), `qualityFirst`
* collapses to the default shape so callers don't see a duplicate.
*/
export function buildTitleVariants(
input: GeneratorInput,
t: TranslationFn,
showQualityBadge = true,
): TitleVariant[] {
const separator = t("title.separator");
const suffix = t("title.suffix");
const videoTypeLabel = t(`title.videoType.${input.videoType}`, {
partNumber: input.partNumber ?? "",
bossName: input.bossName ?? "",
dlcName: input.dlcName ?? "",
challengeName: input.challengeName ?? "",
modName: input.modName ?? "",
});
const gameName = input.gameNameLocalized?.[input.language] ?? input.gameName;
const badge = showQualityBadge ? buildQualityBadge(input.resolution, input.fps) : "";
const typeWithBadge = videoTypeLabel && badge ? `${videoTypeLabel} [${badge}]` : videoTypeLabel;
const gameWithBadge = badge ? `${gameName} [${badge}]` : gameName;
const joinNonEmpty = (parts: string[]): string =>
parts.filter((p) => p.length > 0).join(separator);
// Variant 1 — default (game [badge after type])
const defaultParts: string[] = [gameName];
if (typeWithBadge) defaultParts.push(typeWithBadge);
defaultParts.push(suffix);
// Variant 2 — type first, keeps the badge attached to the game name
const typeFirstParts: string[] = [];
if (videoTypeLabel) typeFirstParts.push(videoTypeLabel);
typeFirstParts.push(gameWithBadge);
typeFirstParts.push(suffix);
// Variant 3 — quality badge up front; falls back to default when
// there is no badge so we never render two identical variants.
const qualityFirstTitle = badge
? joinNonEmpty([`[${badge}] ${gameName}`, videoTypeLabel, suffix])
: joinNonEmpty(defaultParts);
return [
{ id: "default", labelKey: "output.variants.default", title: joinNonEmpty(defaultParts) },
{ id: "typeFirst", labelKey: "output.variants.typeFirst", title: joinNonEmpty(typeFirstParts) },
{ id: "qualityFirst", labelKey: "output.variants.qualityFirst", title: qualityFirstTitle },
];
}
+57 -4
View File
@@ -1,6 +1,8 @@
export type VideoType =
| "full"
| "part"
| "full_demo"
| "demo_part"
| "boss"
| "boss_nohit"
| "ending"
@@ -12,19 +14,35 @@ export type VideoType =
| "side_quest"
| "secret"
| "comparison"
| "guide";
| "guide"
| "mods"
| "collectibles";
export type Genre =
| "action"
| "hack_slash"
| "beatemup"
| "platformer"
| "horror"
| "survival_horror"
| "psychological_horror"
| "rpg"
| "jrpg"
| "action_rpg"
| "crpg"
| "fps"
| "arena_shooter"
| "tactical_fps"
| "boomer_shooter"
| "extraction_shooter"
| "shmup"
| "openworld"
| "indie"
| "soulslike"
| "racing"
| "story"
| "simulation"
| "city_builder"
| "fighting"
| "stealth"
| "survival_craft"
@@ -35,18 +53,41 @@ export type Genre =
| "puzzle"
| "tower_defense"
| "card_game"
| "deck_builder"
| "auto_battler"
| "battle_royale"
| "crpg"
| "tactical"
| "space"
| "farming";
| "farming"
| "fmv"
| "visual_novel";
/**
* Max number of genres a user can multi-select in the editor.
* Tag dedup already collapses overlap, but 3 keeps the UI tidy and
* prevents the tag pool from exploding.
*/
export const MAX_GENRES = 3;
export type SupportedLanguage = "en" | "vi" | "ja" | "es" | "ko" | "zh";
/**
* Pricing category of a store link. Decides the heading wording
* ("GET THE GAME" vs "DOWNLOAD THE GAME") and per-link suffix in the
* generated description.
*/
export type StoreLinkType = "paid" | "free" | "demo";
export interface GeneratorInput {
videoType: VideoType;
language: SupportedLanguage;
genre: Genre;
/**
* Selected genres in user-preferred order. The first entry drives the
* genre hashtag and the trending-tag template; the rest contribute
* extra tags through the genre registry (dedup strips overlap).
* Consumers should assume at least one genre is present.
*/
genres: Genre[];
gameName: string;
gameNameLocalized?: Partial<Record<SupportedLanguage, string>>;
channelName: string;
@@ -55,15 +96,27 @@ export interface GeneratorInput {
bossName?: string;
dlcName?: string;
challengeName?: string;
modName?: string;
resolution?: string;
fps?: string;
graphicsPreset?: string;
timestamps?: string;
playlistLink?: string;
contactEmail?: string;
/**
* Music / sound attribution credit. Free-form multiline string.
* When set, adds a "🎵 MUSIC / SOUND" section to the description
* before the donate links.
*/
musicAttribution?: string;
spoilerWarning: boolean;
matureWarning: boolean;
storeLinks: Partial<Record<string, string>>;
/**
* Parallel map from the same platform id to a pricing category.
* Missing entries default to "paid" so pre-v0.4.0 drafts keep working.
*/
storeLinkTypes?: Partial<Record<string, StoreLinkType>>;
social: Partial<Record<string, string>>;
rig: Partial<Record<string, string>>;
}
+3 -1
View File
@@ -1,5 +1,6 @@
import { useState, useCallback, useRef } from "react";
import toast from "react-hot-toast";
import { logger } from "@utils/logger";
interface UseClipboardReturn {
copy: (text: string) => Promise<void>;
@@ -18,8 +19,9 @@ export function useClipboard(): UseClipboardReturn {
if (timeoutRef.current) clearTimeout(timeoutRef.current);
timeoutRef.current = setTimeout(() => setCopied(false), 2000);
} catch {
} catch (e) {
toast.error("Failed to copy");
logger.error("clipboard", "Failed to copy to clipboard", String(e));
}
}, []);
+30 -6
View File
@@ -1,5 +1,5 @@
import { useMemo } from "react";
import { useTranslation } from "react-i18next";
import i18n from "i18next";
import { useEditorStore } from "@store/editor-store";
import { useSettingsStore } from "@store/settings-store";
import { renderAll } from "@engine/template-renderer";
@@ -7,14 +7,20 @@ import type { GeneratorOutput, GeneratorInput } from "@engine/types";
export function useGeneratedOutput(): GeneratorOutput {
const state = useEditorStore();
const { includeMultilingualTags, includeTrendingTags, hashtagCount } = useSettingsStore();
const { t } = useTranslation("templates");
const {
includeMultilingualTags,
includeTrendingTags,
hashtagCount,
showQualityBadge,
showCopyright,
showUsagePolicy,
} = useSettingsStore();
const input: GeneratorInput = useMemo(
() => ({
videoType: state.videoType,
language: state.language,
genre: state.genre,
genres: state.genres,
gameName: state.gameName,
gameNameLocalized: state.gameNameLocalized,
channelName: state.channelName,
@@ -29,16 +35,18 @@ export function useGeneratedOutput(): GeneratorOutput {
timestamps: state.timestamps,
playlistLink: state.playlistLink,
contactEmail: state.contactEmail,
musicAttribution: state.musicAttribution,
spoilerWarning: state.spoilerWarning,
matureWarning: state.matureWarning,
storeLinks: state.storeLinks,
storeLinkTypes: state.storeLinkTypes,
social: state.social,
rig: state.rig,
}),
[
state.videoType,
state.language,
state.genre,
state.genres,
state.gameName,
state.gameNameLocalized,
state.channelName,
@@ -53,21 +61,37 @@ export function useGeneratedOutput(): GeneratorOutput {
state.timestamps,
state.playlistLink,
state.contactEmail,
state.musicAttribution,
state.spoilerWarning,
state.matureWarning,
state.storeLinks,
state.storeLinkTypes,
state.social,
state.rig,
],
);
const t = useMemo(() => i18n.getFixedT(state.language, "templates"), [state.language]);
return useMemo(
() =>
renderAll(input, t, {
includeMultilingualTags,
includeTrendingTags,
hashtagCount,
showQualityBadge,
showCopyright,
showUsagePolicy,
}),
[input, t, includeMultilingualTags, includeTrendingTags, hashtagCount],
[
input,
t,
includeMultilingualTags,
includeTrendingTags,
hashtagCount,
showQualityBadge,
showCopyright,
showUsagePolicy,
],
);
}
+35
View File
@@ -0,0 +1,35 @@
import { useEffect } from "react";
import { logger } from "@utils/logger";
export function useGlobalErrorHandler() {
useEffect(() => {
const handleError = (event: ErrorEvent) => {
logger.error(
"runtime",
event.message || "Unknown error",
[
event.filename ? `${event.filename}:${event.lineno}:${event.colno}` : "",
event.error?.stack ?? "",
]
.filter(Boolean)
.join("\n"),
);
};
const handleUnhandledRejection = (event: PromiseRejectionEvent) => {
const reason = event.reason;
logger.error(
"promise",
reason instanceof Error ? reason.message : String(reason),
reason instanceof Error ? reason.stack : undefined,
);
};
window.addEventListener("error", handleError);
window.addEventListener("unhandledrejection", handleUnhandledRejection);
return () => {
window.removeEventListener("error", handleError);
window.removeEventListener("unhandledrejection", handleUnhandledRejection);
};
}, []);
}
+1 -1
View File
@@ -17,7 +17,7 @@ export function useKeyboardShortcuts({ onToggleHelp }: ShortcutOptions) {
const handleKeyDown = (e: KeyboardEvent) => {
const ctrl = e.ctrlKey || e.metaKey;
if (ctrl && e.key === "Enter") {
if (ctrl && (e.key === "Enter" || e.key === "g" || e.key === "G")) {
e.preventDefault();
navigate("/output");
} else if (ctrl && e.shiftKey && e.key === "C") {
+20 -3
View File
@@ -9,7 +9,14 @@ export function useMultilangOutput(
languages: SupportedLanguage[],
): Record<string, GeneratorOutput> {
const state = useEditorStore();
const { includeMultilingualTags, includeTrendingTags, hashtagCount } = useSettingsStore();
const {
includeMultilingualTags,
includeTrendingTags,
hashtagCount,
showQualityBadge,
showCopyright,
showUsagePolicy,
} = useSettingsStore();
return useMemo(() => {
const results: Record<string, GeneratorOutput> = {};
@@ -18,7 +25,7 @@ export function useMultilangOutput(
const input: GeneratorInput = {
videoType: state.videoType,
language: lang,
genre: state.genre,
genres: state.genres,
gameName: state.gameName,
gameNameLocalized: state.gameNameLocalized,
channelName: state.channelName,
@@ -33,9 +40,11 @@ export function useMultilangOutput(
timestamps: state.timestamps,
playlistLink: state.playlistLink,
contactEmail: state.contactEmail,
musicAttribution: state.musicAttribution,
spoilerWarning: state.spoilerWarning,
matureWarning: state.matureWarning,
storeLinks: state.storeLinks,
storeLinkTypes: state.storeLinkTypes,
social: state.social,
rig: state.rig,
};
@@ -43,13 +52,16 @@ export function useMultilangOutput(
includeMultilingualTags,
includeTrendingTags,
hashtagCount,
showQualityBadge,
showCopyright,
showUsagePolicy,
});
}
return results;
}, [
languages,
state.videoType,
state.genre,
state.genres,
state.gameName,
state.gameNameLocalized,
state.channelName,
@@ -64,13 +76,18 @@ export function useMultilangOutput(
state.timestamps,
state.playlistLink,
state.contactEmail,
state.musicAttribution,
state.spoilerWarning,
state.matureWarning,
state.storeLinks,
state.storeLinkTypes,
state.social,
state.rig,
includeMultilingualTags,
includeTrendingTags,
hashtagCount,
showQualityBadge,
showCopyright,
showUsagePolicy,
]);
}
+37 -17
View File
@@ -1,50 +1,70 @@
{
"ui": {
"app": ["title", "subtitle"],
"tabs": ["editor", "output", "profiles", "history", "settings", "batch"],
"tabs": ["editor", "output", "profiles", "history", "settings", "batch", "playlist", "logs"],
"editor.sections": ["gameInfo", "videoSettings", "contentDetails", "attribution", "rig", "storeAndSocial"],
"editor": [
"videoType", "language", "genre", "gameName", "gameNamePlaceholder",
"channelName", "channelNamePlaceholder", "platform",
"partNumber", "partNumberPlaceholder", "bossName", "bossNamePlaceholder",
"dlcName", "dlcNamePlaceholder", "challengeName", "challengeNamePlaceholder",
"modName", "modNamePlaceholder",
"resolution", "fps", "graphicsPreset",
"timestamps", "timestampsPlaceholder",
"storeLinks", "rig", "social", "warnings",
"storeLinks", "storeLinkType", "rig", "social", "warnings",
"spoilerWarning", "matureWarning",
"playlistLink", "playlistLinkPlaceholder",
"contactEmail", "contactEmailPlaceholder",
"videoSettings", "quickPreview",
"contactEmail", "contactEmailPlaceholder", "contactEmailHelp",
"musicAttribution", "musicAttributionPlaceholder",
"thumbnailText", "thumbnailTextPlaceholder",
"pinnedComment", "pinnedCommentPlaceholder",
"videoSettings", "quickPreview", "version",
"clearDraft", "draftSaved", "clearDraftConfirm"
],
"storeLinkTypes": ["paid", "free", "demo"],
"output": [
"title", "description", "tags",
"copyTitle", "copyDescription", "copyTags", "copyAll",
"copied", "charCount", "selectLanguages"
"copied", "charCount", "selectLanguages",
"thumbnailText", "copyThumbnailText",
"pinnedComment", "copyPinnedComment",
"generateAlternatives", "saveAsTemplate"
],
"output.variants": ["default", "typeFirst", "qualityFirst"],
"common": ["save", "cancel", "delete", "confirm", "export", "import", "reset", "search", "generate"],
"videoTypes": ["full", "part", "boss", "boss_nohit", "ending", "speedrun", "100percent", "dlc", "newgame_plus", "challenge", "side_quest", "secret", "comparison", "guide"],
"genres": ["action", "horror", "rpg", "fps", "openworld", "indie", "soulslike", "racing", "story", "simulation", "fighting", "stealth", "survival_craft", "roguelike", "metroidvania", "mmo", "rhythm", "puzzle", "tower_defense", "card_game", "battle_royale", "crpg", "tactical", "space", "farming"],
"rig": ["cpu", "gpu", "ram", "storage", "monitor", "capture", "motherboard", "controller"],
"social": ["kofi", "patreon", "buymeacoffee", "paypal", "github", "twitter", "discord", "website", "twitch", "tiktok", "instagram", "streamlabs"],
"videoTypes": ["full", "part", "full_demo", "demo_part", "boss", "boss_nohit", "ending", "speedrun", "100percent", "dlc", "newgame_plus", "challenge", "side_quest", "secret", "comparison", "guide", "mods", "collectibles"],
"genres": ["action", "hack_slash", "beatemup", "platformer", "horror", "survival_horror", "psychological_horror", "rpg", "jrpg", "action_rpg", "crpg", "fps", "arena_shooter", "tactical_fps", "boomer_shooter", "extraction_shooter", "shmup", "openworld", "indie", "soulslike", "racing", "story", "simulation", "city_builder", "fighting", "stealth", "survival_craft", "roguelike", "metroidvania", "mmo", "rhythm", "puzzle", "tower_defense", "card_game", "deck_builder", "auto_battler", "battle_royale", "tactical", "space", "farming", "fmv", "visual_novel"],
"rig": ["cpu", "gpu", "ram", "storage", "monitor", "capture", "motherboard", "controller", "video_editor"],
"social": ["kofi", "patreon", "buymeacoffee", "paypal", "github", "twitter", "discord", "website", "twitch", "tiktok", "instagram", "streamlabs", "bluesky", "mastodon", "facebook", "fb_page", "fb_group"],
"resolutions": ["720p", "1080p", "1440p", "4K"],
"fpsOptions": ["30", "60", "120", "144"],
"profiles": ["title", "createNew", "editProfile", "profileName", "profileNamePlaceholder", "loadProfile", "deleteConfirm", "emptyState", "exportProfiles", "importProfiles"],
"presets": ["title", "createNew", "editPreset", "loadPreset", "deleteConfirm", "emptyState", "selectPreset", "noPresets", "exportPresets", "importPresets"],
"templates": ["title", "createNew", "saveAsTemplate", "templateName", "templateNamePlaceholder", "loadTemplate", "deleteConfirm", "emptyState", "saveHint", "savedAs", "appliedToast", "exportTemplates", "importTemplates"],
"history": ["title", "emptyState", "clearAll", "clearConfirm", "searchPlaceholder"],
"settings": ["title", "appearance", "defaults", "editorSettings", "tagSettings", "historySettings", "theme", "defaultUILanguage", "defaultOutputLanguage", "defaultGenre", "autoSaveDraft", "showCharCount", "compactTagDisplay", "historyLimit", "multilingualTags", "trendingTags", "hashtagCount"],
"settings": ["title", "appearance", "defaults", "editorSettings", "tagSettings", "historySettings", "theme", "appLanguage", "defaultOutputLanguage", "defaultGenre", "autoSaveDraft", "showCharCount", "compactTagDisplay", "historyLimit", "multilingualTags", "trendingTags", "hashtagCount", "showQualityBadge", "showCopyright", "showUsagePolicy"],
"batch": ["title", "startPart", "endPart", "generateBatch", "copyAllBatch", "emptyState"],
"shortcuts": ["title", "generate", "copyAll", "saveDraft", "help", "close"]
"shortcuts": ["title", "generate", "copyAll", "saveDraft", "help", "close"],
"validation": ["emailInvalid", "emailMaxExceeded", "urlInvalid", "urlPrefixMismatch"],
"logs": ["title", "emptyState", "clearAll", "clearConfirm", "searchPlaceholder"],
"playlist": ["title", "status", "contentType", "totalVideos", "customNote", "generatePlaylist"]
},
"templates": {
"title": ["separator", "suffix"],
"title.videoType": ["full", "part", "boss", "boss_nohit", "ending", "speedrun", "100percent", "dlc", "newgame_plus", "challenge", "side_quest", "secret", "comparison", "guide"],
"description.intro": ["full", "part", "boss", "boss_nohit", "ending", "speedrun", "100percent", "dlc", "newgame_plus", "challenge", "side_quest", "secret", "comparison", "guide"],
"title.videoType": ["full", "part", "full_demo", "demo_part", "boss", "boss_nohit", "ending", "speedrun", "100percent", "dlc", "newgame_plus", "challenge", "side_quest", "secret", "comparison", "guide", "mods", "collectibles"],
"description.intro": ["full", "part", "full_demo", "demo_part", "boss", "boss_nohit", "ending", "speedrun", "100percent", "dlc", "newgame_plus", "challenge", "side_quest", "secret", "comparison", "guide", "mods", "collectibles"],
"description": ["noCommentaryLine"],
"description.sections": [
"timestamps", "storeLinks", "videoSettings", "rig",
"spoilerWarning", "matureWarning", "donate", "social",
"playlist", "contact", "cta"
"timestamps", "storeLinksBuy", "storeLinksDownload", "videoSettings", "rig",
"spoilerWarning", "matureWarning", "music", "donate", "social",
"playlist", "contact", "cta",
"copyright", "usagePolicyHeader", "usagePolicy"
],
"hashtags": ["gameplay", "noCommentary", "genre"]
"description.storeLinkSuffix": ["free", "demo"],
"hashtags": ["gameplay", "noCommentary", "genre"],
"playlist.status": ["completed", "dropped", "incomplete", "in_progress"],
"playlist": ["titleFormat", "videoCount", "storeSection", "footer"],
"playlist.description": ["full_gameplay", "boss_fights", "speedrun", "all_endings", "dlc", "100_percent", "guide", "highlights"],
"timeline.keywords": ["chapter", "part", "boss", "final_boss", "intro", "ending", "tutorial", "credits"]
}
}
+55 -4
View File
@@ -5,6 +5,8 @@
"videoType": {
"full": "",
"part": "Part {{partNumber}}",
"full_demo": "Demo",
"demo_part": "Demo Part {{partNumber}}",
"boss": "{{bossName}} Boss Fight",
"boss_nohit": "{{bossName}} Boss No Hit",
"ending": "Ending",
@@ -16,13 +18,17 @@
"side_quest": "Side Quest",
"secret": "Secret",
"comparison": "Comparison",
"guide": "Guide"
"guide": "Guide",
"mods": "{{modName}} Mods",
"collectibles": "All Collectibles"
}
},
"description": {
"intro": {
"full": "This video features the full gameplay of {{gameName}} on {{channelName}}.",
"part": "This video features Part {{partNumber}} of {{gameName}} on {{channelName}}.",
"full_demo": "This video features the full demo of {{gameName}} on {{channelName}}.",
"demo_part": "This video features Part {{partNumber}} of the {{gameName}} demo on {{channelName}}.",
"boss": "This video features the {{bossName}} boss fight from {{gameName}} on {{channelName}}.",
"boss_nohit": "This video features the {{bossName}} boss fight (No Hit) from {{gameName}} on {{channelName}}.",
"ending": "This video features the ending of {{gameName}} on {{channelName}}.",
@@ -34,26 +40,71 @@
"side_quest": "This video features side quests and optional content from {{gameName}} on {{channelName}}.",
"secret": "This video features secrets and hidden content from {{gameName}} on {{channelName}}.",
"comparison": "This video compares the graphics/performance of {{gameName}} on {{channelName}}.",
"guide": "This video is a silent guide for {{gameName}} on {{channelName}}."
"guide": "This video is a silent guide for {{gameName}} on {{channelName}}.",
"mods": "This video features the {{modName}} mod for {{gameName}} on {{channelName}}.",
"collectibles": "This video covers all collectibles and 100% completion of {{gameName}} on {{channelName}}."
},
"noCommentaryLine": "No Commentary — pure gameplay for your enjoyment.",
"storeLinkSuffix": {
"free": "free",
"demo": "free demo"
},
"sections": {
"timestamps": "⏱ TIMESTAMPS",
"storeLinks": "🎮 GET THE GAME",
"storeLinksBuy": "🎮 GET THE GAME (if you want to buy)",
"storeLinksDownload": "⬇️ DOWNLOAD THE GAME (if you want to play)",
"videoSettings": "🖥 VIDEO SETTINGS",
"rig": "💻 MY RIG",
"spoilerWarning": "⚠️ SPOILER WARNING: This video may contain spoilers. Watch at your own risk!",
"matureWarning": "🔞 MATURE CONTENT (18+): Contains violence / strong language / graphic content.",
"music": "🎵 MUSIC / SOUND",
"donate": "☕ SUPPORT THE CHANNEL",
"social": "🔗 FOLLOW ME",
"playlist": "▶️ Watch the full series: {{link}}",
"contact": "📧 Business inquiries: {{email}}",
"cta": "👍 Like | 🔔 Subscribe | ↗️ Share"
"cta": "👍 Like | 🔔 Subscribe | ↗️ Share",
"copyright": "© {{year}} {{channelName}}. All rights reserved.",
"usagePolicyHeader": "📋 USAGE POLICY",
"usagePolicy": "• Always credit with a link to the original video AND channel (at minimum in the description).\n• Don't re-upload the full video or large portions as your own content.\n• Don't monetize footage without explicit consent.\n• Don't edit footage to misrepresent the original content or creator.\n• Compilation, review, commentary, and reaction videos are OK — as long as you credit.\nIf in doubt, reach out via the social links or email in the description."
}
},
"hashtags": {
"gameplay": "#{{gameName}}",
"noCommentary": "#GameplayNoCommentary",
"genre": "#{{genre}}"
},
"playlist": {
"status": {
"completed": "✅ Completed",
"dropped": "❌ Dropped",
"incomplete": "🔄 Incomplete",
"in_progress": "▶️ In Progress"
},
"titleFormat": "{{status}} - {{gameName}}",
"videoCount": "📹 {{count}} video(s)",
"storeSection": "🎮 Get the game:",
"footer": "👍 Like | 🔔 Subscribe for more gameplay!",
"description": {
"full_gameplay": "This playlist contains the full gameplay of {{gameName}} on {{channelName}}.\nNo Commentary — pure gameplay experience.",
"boss_fights": "This playlist contains boss fights from {{gameName}} on {{channelName}}.\nNo Commentary — pure gameplay experience.",
"speedrun": "This playlist contains speedrun attempts of {{gameName}} on {{channelName}}.\nNo Commentary — pure gameplay experience.",
"all_endings": "This playlist contains all endings of {{gameName}} on {{channelName}}.\n⚠️ Contains spoilers.",
"dlc": "This playlist contains DLC gameplay of {{gameName}} on {{channelName}}.\nNo Commentary — pure gameplay experience.",
"100_percent": "This playlist contains the 100% completion run of {{gameName}} on {{channelName}}.\nNo Commentary — pure gameplay experience.",
"guide": "This playlist is a silent guide for {{gameName}} on {{channelName}}.\nNo Commentary — pure gameplay experience.",
"highlights": "This playlist contains gameplay highlights from {{gameName}} on {{channelName}}.\nNo Commentary — pure gameplay experience."
}
},
"timeline": {
"keywords": {
"chapter": "Chapter {{n}}",
"part": "Part {{n}}",
"boss": "Boss {{n}}",
"final_boss": "Final Boss",
"intro": "Intro",
"ending": "Ending",
"tutorial": "Tutorial",
"credits": "Credits"
}
}
}
+118 -15
View File
@@ -9,9 +9,19 @@
"profiles": "Profiles",
"history": "History",
"settings": "Settings",
"batch": "Batch"
"batch": "Batch",
"playlist": "Playlist",
"logs": "Logs"
},
"editor": {
"sections": {
"gameInfo": "Game Info",
"videoSettings": "Video Settings",
"contentDetails": "Content Details",
"attribution": "Attribution",
"rig": "My Rig",
"storeAndSocial": "Store & Social"
},
"videoType": "Video Type",
"language": "Output Language",
"genre": "Game Genre",
@@ -28,12 +38,15 @@
"dlcNamePlaceholder": "e.g. Shadow of the Erdtree",
"challengeName": "Challenge Name",
"challengeNamePlaceholder": "e.g. No Hit Run",
"modName": "Mod Name",
"modNamePlaceholder": "e.g. Requiem, NaturalVision Evolved",
"resolution": "Resolution",
"fps": "FPS",
"graphicsPreset": "Graphics Preset",
"timestamps": "Timestamps",
"timestampsPlaceholder": "0:00 Intro\n5:30 Chapter 1\n15:00 Boss Fight",
"storeLinks": "Store Links",
"storeLinkType": "Type",
"rig": "My Rig",
"social": "Social & Donate Links",
"warnings": "Warnings",
@@ -43,11 +56,19 @@
"playlistLinkPlaceholder": "https://youtube.com/playlist?list=...",
"contactEmail": "Contact Email",
"contactEmailPlaceholder": "business@example.com",
"musicAttribution": "Music / Sound Attribution",
"musicAttributionPlaceholder": "Music by Karl Casey @ White Bat Audio\nSFX from Freesound.org",
"thumbnailText": "Thumbnail Text",
"thumbnailTextPlaceholder": "e.g. SECRET BOSS NO HIT",
"pinnedComment": "Pinned Comment Template",
"pinnedCommentPlaceholder": "What should viewers do if they liked the video?",
"videoSettings": "Video Settings",
"quickPreview": "Quick Preview",
"version": "Version",
"clearDraft": "Clear Draft",
"draftSaved": "Draft saved",
"clearDraftConfirm": "Are you sure you want to clear all form data?"
"clearDraftConfirm": "Are you sure you want to clear all form data?",
"contactEmailHelp": "Up to 3 emails, comma-separated"
},
"output": {
"title": "Title",
@@ -59,7 +80,18 @@
"copyAll": "Copy All",
"copied": "Copied!",
"charCount": "{{count}}/{{limit}}",
"selectLanguages": "Select Languages"
"selectLanguages": "Select Languages",
"thumbnailText": "Thumbnail Text",
"copyThumbnailText": "Copy thumbnail text",
"pinnedComment": "Pinned Comment",
"copyPinnedComment": "Copy pinned comment",
"generateAlternatives": "Generate Alternatives",
"saveAsTemplate": "Save as Template",
"variants": {
"default": "Default",
"typeFirst": "Type First",
"qualityFirst": "Quality First"
}
},
"common": {
"save": "Save",
@@ -75,6 +107,8 @@
"videoTypes": {
"full": "Full Gameplay",
"part": "Gameplay Part",
"full_demo": "Full Demo",
"demo_part": "Demo Part",
"boss": "Boss Fight",
"boss_nohit": "Boss No Hit",
"ending": "Ending / All Endings",
@@ -86,19 +120,35 @@
"side_quest": "Side Quests",
"secret": "Secrets / Hidden",
"comparison": "Graphics Comparison",
"guide": "Silent Guide"
"guide": "Silent Guide",
"mods": "Modded Gameplay",
"collectibles": "All Collectibles"
},
"genres": {
"action": "Action / Adventure",
"hack_slash": "Hack & Slash",
"beatemup": "Beat 'em Up",
"platformer": "Platformer",
"horror": "Horror / Survival",
"rpg": "RPG / JRPG",
"survival_horror": "Survival Horror",
"psychological_horror": "Psychological Horror",
"rpg": "RPG",
"jrpg": "JRPG",
"action_rpg": "Action RPG",
"crpg": "CRPG / Isometric",
"fps": "FPS / Shooter",
"arena_shooter": "Arena Shooter",
"tactical_fps": "Tactical FPS",
"boomer_shooter": "Boomer Shooter",
"extraction_shooter": "Extraction Shooter",
"shmup": "SHMUP / Bullet Hell",
"openworld": "Open World / Sandbox",
"indie": "Indie / Platformer",
"indie": "Indie",
"soulslike": "Souls-like",
"racing": "Racing / Sports",
"story": "Story / Visual Novel",
"story": "Story / Narrative",
"simulation": "Simulation / Strategy",
"city_builder": "City Builder",
"fighting": "Fighting",
"stealth": "Stealth / Espionage",
"survival_craft": "Survival / Crafting",
@@ -108,12 +158,15 @@
"rhythm": "Rhythm / Music",
"puzzle": "Puzzle",
"tower_defense": "Tower Defense",
"card_game": "Card / Deck Builder",
"card_game": "Card Game",
"deck_builder": "Deck Builder",
"auto_battler": "Auto Battler",
"battle_royale": "Battle Royale",
"crpg": "CRPG / Isometric",
"tactical": "Tactical / Turn-based",
"space": "Space / Sci-Fi",
"farming": "Farming / Life Sim"
"farming": "Farming / Life Sim",
"fmv": "FMV / Interactive Movie",
"visual_novel": "Visual Novel"
},
"rig": {
"cpu": "CPU",
@@ -123,7 +176,8 @@
"monitor": "Monitor",
"capture": "Capture Software",
"motherboard": "Motherboard",
"controller": "Controller"
"controller": "Controller",
"video_editor": "Video Editor"
},
"social": {
"kofi": "Ko-fi",
@@ -137,7 +191,12 @@
"twitch": "Twitch",
"tiktok": "TikTok",
"instagram": "Instagram",
"streamlabs": "Streamlabs"
"streamlabs": "Streamlabs",
"bluesky": "Bluesky",
"mastodon": "Mastodon",
"facebook": "Facebook",
"fb_page": "Facebook Page",
"fb_group": "Facebook Group"
},
"resolutions": {
"720p": "720p",
@@ -175,6 +234,21 @@
"exportPresets": "Export Presets",
"importPresets": "Import Presets"
},
"templates": {
"title": "Templates",
"createNew": "Create Template",
"saveAsTemplate": "Save as Template",
"templateName": "Template Name",
"templateNamePlaceholder": "e.g. Elden Ring Boss Run",
"loadTemplate": "Apply",
"deleteConfirm": "Are you sure you want to delete this template?",
"emptyState": "No templates yet. Save your current form as a template to reuse later.",
"saveHint": "Saves every field in the editor so you can restore the exact state later.",
"savedAs": "Saved as '{{name}}'",
"appliedToast": "Applied '{{name}}'",
"exportTemplates": "Export Templates",
"importTemplates": "Import Templates"
},
"history": {
"title": "History",
"emptyState": "No generation history yet.",
@@ -190,16 +264,19 @@
"tagSettings": "Tags",
"historySettings": "History",
"theme": "Theme",
"defaultUILanguage": "Default UI Language",
"appLanguage": "App Language",
"defaultOutputLanguage": "Default Output Language",
"defaultGenre": "Default Genre",
"defaultGenre": "Default Genres",
"autoSaveDraft": "Auto-save Draft",
"showCharCount": "Show Character Count",
"compactTagDisplay": "Compact Tag Display",
"historyLimit": "History Limit",
"multilingualTags": "Include Multilingual Tags",
"trendingTags": "Include Trending Tags",
"hashtagCount": "Hashtag Count"
"hashtagCount": "Hashtag Count",
"showQualityBadge": "Show quality badge in title (e.g. [2K 60FPS])",
"showCopyright": "Append © copyright line to description",
"showUsagePolicy": "Append usage policy block to description"
},
"batch": {
"title": "Batch Mode",
@@ -216,5 +293,31 @@
"saveDraft": "Save Draft",
"help": "Show Shortcuts",
"close": "Close Modal"
},
"validation": {
"emailInvalid": "Invalid email: {{email}}",
"emailMaxExceeded": "Maximum {{max}} emails allowed (currently {{count}})",
"urlInvalid": "Invalid URL. Must start with https://",
"urlPrefixMismatch": "Expected URL starting with {{expected}}"
},
"storeLinkTypes": {
"paid": "Paid",
"free": "Free",
"demo": "Free Demo"
},
"playlist": {
"title": "Playlist Generator",
"status": "Status",
"contentType": "Content Type",
"totalVideos": "Total Videos",
"customNote": "Custom Note",
"generatePlaylist": "Generate Playlist"
},
"logs": {
"title": "Logs",
"emptyState": "No log entries yet.",
"clearAll": "Clear All",
"clearConfirm": "Are you sure you want to clear all logs?",
"searchPlaceholder": "Search logs..."
}
}
+55 -4
View File
@@ -5,6 +5,8 @@
"videoType": {
"full": "",
"part": "Parte {{partNumber}}",
"full_demo": "Demo Completa",
"demo_part": "Demo Parte {{partNumber}}",
"boss": "{{bossName}} Pelea de Jefe",
"boss_nohit": "{{bossName}} Jefe Sin Golpes",
"ending": "Final",
@@ -16,13 +18,17 @@
"side_quest": "Misiones Secundarias",
"secret": "Secretos",
"comparison": "Comparación de Gráficos",
"guide": "Guía Silenciosa"
"guide": "Guía Silenciosa",
"mods": "Mod {{modName}}",
"collectibles": "Todos los Coleccionables"
}
},
"description": {
"intro": {
"full": "Este video presenta el gameplay completo de {{gameName}} en {{channelName}}.",
"part": "Este video presenta la Parte {{partNumber}} de {{gameName}} en {{channelName}}.",
"full_demo": "Este video presenta la demo completa de {{gameName}} en {{channelName}}.",
"demo_part": "Este video presenta la Parte {{partNumber}} de la demo de {{gameName}} en {{channelName}}.",
"boss": "Este video presenta la pelea del jefe {{bossName}} de {{gameName}} en {{channelName}}.",
"boss_nohit": "Este video presenta la pelea del jefe {{bossName}} (Sin Golpes) de {{gameName}} en {{channelName}}.",
"ending": "Este video presenta el final de {{gameName}} en {{channelName}}.",
@@ -34,26 +40,71 @@
"side_quest": "Este video presenta misiones secundarias y contenido opcional de {{gameName}} en {{channelName}}.",
"secret": "Este video presenta secretos y contenido oculto de {{gameName}} en {{channelName}}.",
"comparison": "Este video presenta una comparación de gráficos de {{gameName}} en {{channelName}}.",
"guide": "Este video presenta una guía silenciosa de {{gameName}} en {{channelName}}."
"guide": "Este video presenta una guía silenciosa de {{gameName}} en {{channelName}}.",
"mods": "Este video presenta el mod {{modName}} para {{gameName}} en {{channelName}}.",
"collectibles": "Este video cubre todos los coleccionables y el 100% de {{gameName}} en {{channelName}}."
},
"noCommentaryLine": "Sin Comentarios — gameplay puro para tu disfrute.",
"storeLinkSuffix": {
"free": "gratis",
"demo": "demo gratis"
},
"sections": {
"timestamps": "⏱ MARCAS DE TIEMPO",
"storeLinks": "🎮 CONSIGUE EL JUEGO",
"storeLinksBuy": "🎮 CONSIGUE EL JUEGO (si quieres comprarlo)",
"storeLinksDownload": "⬇️ DESCARGA EL JUEGO (si quieres jugar)",
"videoSettings": "🖥 AJUSTES DE VIDEO",
"rig": "💻 MI EQUIPO",
"spoilerWarning": "⚠️ ADVERTENCIA DE SPOILERS: Este video puede contener spoilers. ¡Míralo bajo tu propio riesgo!",
"matureWarning": "🔞 CONTENIDO PARA ADULTOS (18+): Contiene violencia / lenguaje fuerte / contenido gráfico.",
"music": "🎵 MÚSICA / SONIDO",
"donate": "☕ APOYA EL CANAL",
"social": "🔗 SÍGUEME",
"playlist": "▶️ Ver la serie completa: {{link}}",
"contact": "📧 Consultas comerciales: {{email}}",
"cta": "👍 Me gusta | 🔔 Suscríbete | ↗️ Comparte"
"cta": "👍 Me gusta | 🔔 Suscríbete | ↗️ Comparte",
"copyright": "© {{year}} {{channelName}}. Todos los derechos reservados.",
"usagePolicyHeader": "📋 POLÍTICA DE USO",
"usagePolicy": "• Siempre acredita con un enlace al vídeo original Y al canal (al menos en la descripción).\n• No reuploadees el vídeo completo ni porciones grandes como contenido propio.\n• No monetices el material sin consentimiento explícito.\n• No edites el material de forma que tergiverse el contenido original o al creador.\n• Compilaciones, reseñas, comentarios y reacciones están OK — siempre que acredites.\nSi tienes dudas, contáctame por las redes sociales o el email de la descripción."
}
},
"hashtags": {
"gameplay": "#{{gameName}}",
"noCommentary": "#GameplayNoCommentary",
"genre": "#{{genre}}"
},
"playlist": {
"status": {
"completed": "✅ Completado",
"dropped": "❌ Abandonado",
"incomplete": "🔄 Incompleto",
"in_progress": "▶️ En progreso"
},
"titleFormat": "{{status}} - {{gameName}}",
"videoCount": "📹 {{count}} video(s)",
"storeSection": "🎮 Obtener el juego:",
"footer": "👍 Me gusta | 🔔 ¡Suscríbete para más gameplay!",
"description": {
"full_gameplay": "Esta playlist contiene el gameplay completo de {{gameName}} en {{channelName}}.\nSin comentarios — experiencia de juego pura.",
"boss_fights": "Esta playlist contiene todas las peleas de jefes de {{gameName}} en {{channelName}}.\nSin comentarios.",
"speedrun": "Esta playlist contiene el speedrun de {{gameName}} en {{channelName}}.\nSin comentarios.",
"all_endings": "Esta playlist contiene todos los finales de {{gameName}} en {{channelName}}.\n⚠️ Contiene spoilers.",
"dlc": "Esta playlist contiene el gameplay del DLC de {{gameName}} en {{channelName}}.\nSin comentarios.",
"100_percent": "Esta playlist contiene la partida al 100% de {{gameName}} en {{channelName}}.\nSin comentarios.",
"guide": "Esta playlist es una guía silenciosa de {{gameName}} en {{channelName}}.\nSin comentarios.",
"highlights": "Esta playlist contiene los momentos destacados de {{gameName}} en {{channelName}}.\nSin comentarios."
}
},
"timeline": {
"keywords": {
"chapter": "Capítulo {{n}}",
"part": "Parte {{n}}",
"boss": "Jefe {{n}}",
"final_boss": "Jefe Final",
"intro": "Introducción",
"ending": "Final",
"tutorial": "Tutorial",
"credits": "Créditos"
}
}
}
+117 -14
View File
@@ -9,9 +9,19 @@
"profiles": "Perfiles",
"history": "Historial",
"settings": "Ajustes",
"batch": "Lote"
"batch": "Lote",
"playlist": "Playlist",
"logs": "Registros"
},
"editor": {
"sections": {
"gameInfo": "Info del Juego",
"videoSettings": "Ajustes de Video",
"contentDetails": "Detalles del Contenido",
"attribution": "Créditos",
"rig": "Mi Equipo",
"storeAndSocial": "Tiendas y Social"
},
"videoType": "Tipo de Video",
"language": "Idioma de Salida",
"genre": "Género del Juego",
@@ -28,12 +38,15 @@
"dlcNamePlaceholder": "ej. Shadow of the Erdtree",
"challengeName": "Nombre del Desafío",
"challengeNamePlaceholder": "ej. Sin Golpes",
"modName": "Nombre del Mod",
"modNamePlaceholder": "ej. Requiem, NaturalVision Evolved",
"resolution": "Resolución",
"fps": "FPS",
"graphicsPreset": "Calidad Gráfica",
"timestamps": "Marcas de Tiempo",
"timestampsPlaceholder": "0:00 Intro\n5:30 Capítulo 1\n15:00 Pelea de Jefe",
"storeLinks": "Enlaces de Tienda",
"storeLinkType": "Tipo",
"rig": "Mi Equipo",
"social": "Redes Sociales y Donaciones",
"warnings": "Advertencias",
@@ -43,11 +56,19 @@
"playlistLinkPlaceholder": "https://youtube.com/playlist?list=...",
"contactEmail": "Correo de Contacto",
"contactEmailPlaceholder": "negocios@ejemplo.com",
"musicAttribution": "Crédito Musical / Sonidos",
"musicAttributionPlaceholder": "Música: Karl Casey @ White Bat Audio\nEfectos: Freesound.org",
"thumbnailText": "Texto de Miniatura",
"thumbnailTextPlaceholder": "ej. JEFE SECRETO SIN GOLPES",
"pinnedComment": "Plantilla de Comentario Fijado",
"pinnedCommentPlaceholder": "Contenido del comentario fijado...",
"videoSettings": "Ajustes de Video",
"quickPreview": "Vista Previa Rápida",
"version": "Versión",
"clearDraft": "Limpiar Borrador",
"draftSaved": "Borrador guardado",
"clearDraftConfirm": "¿Estás seguro de que quieres borrar todos los datos del formulario?"
"clearDraftConfirm": "¿Estás seguro de que quieres borrar todos los datos del formulario?",
"contactEmailHelp": "Hasta 3 emails, separados por comas"
},
"output": {
"title": "Título",
@@ -59,7 +80,18 @@
"copyAll": "Copiar Todo",
"copied": "¡Copiado!",
"charCount": "{{count}}/{{limit}}",
"selectLanguages": "Seleccionar Idiomas"
"selectLanguages": "Seleccionar Idiomas",
"thumbnailText": "Texto de Miniatura",
"copyThumbnailText": "Copiar texto de miniatura",
"pinnedComment": "Comentario Fijado",
"copyPinnedComment": "Copiar comentario fijado",
"generateAlternatives": "Generar Alternativas",
"saveAsTemplate": "Guardar como Plantilla",
"variants": {
"default": "Predeterminado",
"typeFirst": "Tipo Primero",
"qualityFirst": "Calidad Primero"
}
},
"common": {
"save": "Guardar",
@@ -75,6 +107,8 @@
"videoTypes": {
"full": "Gameplay Completo",
"part": "Gameplay Parte",
"full_demo": "Demo Completa",
"demo_part": "Demo Parte",
"boss": "Pelea de Jefe",
"boss_nohit": "Jefe Sin Golpes",
"ending": "Final / Todos los Finales",
@@ -86,19 +120,35 @@
"side_quest": "Misiones Secundarias",
"secret": "Secretos / Ocultos",
"comparison": "Comparación de Gráficos",
"guide": "Guía Silenciosa"
"guide": "Guía Silenciosa",
"mods": "Gameplay con Mods",
"collectibles": "Todos los Coleccionables"
},
"genres": {
"action": "Acción / Aventura",
"hack_slash": "Hack & Slash",
"beatemup": "Beat 'em Up",
"platformer": "Plataformas",
"horror": "Horror / Supervivencia",
"rpg": "RPG / JRPG",
"survival_horror": "Survival Horror",
"psychological_horror": "Terror Psicológico",
"rpg": "RPG",
"jrpg": "JRPG",
"action_rpg": "Action RPG",
"crpg": "CRPG / Isométrico",
"fps": "FPS / Shooter",
"arena_shooter": "Shooter de Arena",
"tactical_fps": "FPS Táctico",
"boomer_shooter": "Boomer Shooter",
"extraction_shooter": "Extraction Shooter",
"shmup": "SHMUP / Bullet Hell",
"openworld": "Mundo Abierto / Sandbox",
"indie": "Indie / Plataformas",
"indie": "Indie",
"soulslike": "Souls-like",
"racing": "Carreras / Deportes",
"story": "Historia / Novela Visual",
"story": "Historia / Narrativa",
"simulation": "Simulación / Estrategia",
"city_builder": "Constructor de Ciudades",
"fighting": "Lucha",
"stealth": "Sigilo / Espionaje",
"survival_craft": "Supervivencia / Crafting",
@@ -109,11 +159,14 @@
"puzzle": "Rompecabezas",
"tower_defense": "Tower Defense",
"card_game": "Juego de Cartas",
"deck_builder": "Deck Builder",
"auto_battler": "Auto Battler",
"battle_royale": "Battle Royale",
"crpg": "CRPG / Isométrico",
"tactical": "Táctico / Por Turnos",
"space": "Espacio / Sci-Fi",
"farming": "Granja / Life Sim"
"farming": "Granja / Life Sim",
"fmv": "FMV / Película Interactiva",
"visual_novel": "Novela Visual"
},
"rig": {
"cpu": "CPU",
@@ -123,7 +176,8 @@
"monitor": "Monitor",
"capture": "Software de Captura",
"motherboard": "Placa Base",
"controller": "Mando"
"controller": "Mando",
"video_editor": "Editor de Video"
},
"social": {
"kofi": "Ko-fi",
@@ -137,7 +191,12 @@
"twitch": "Twitch",
"tiktok": "TikTok",
"instagram": "Instagram",
"streamlabs": "Streamlabs"
"streamlabs": "Streamlabs",
"bluesky": "Bluesky",
"mastodon": "Mastodon",
"facebook": "Facebook",
"fb_page": "Página de Facebook",
"fb_group": "Grupo de Facebook"
},
"resolutions": {
"720p": "720p",
@@ -163,6 +222,21 @@
"exportProfiles": "Exportar Perfiles",
"importProfiles": "Importar Perfiles"
},
"templates": {
"title": "Plantillas",
"createNew": "Crear Plantilla",
"saveAsTemplate": "Guardar como Plantilla",
"templateName": "Nombre de Plantilla",
"templateNamePlaceholder": "ej. Elden Ring Boss Run",
"loadTemplate": "Aplicar",
"deleteConfirm": "¿Seguro que quieres eliminar esta plantilla?",
"emptyState": "Aún no hay plantillas. Guarda el formulario actual para reutilizarlo más tarde.",
"saveHint": "Guarda todos los campos del editor para restaurar el estado exacto después.",
"savedAs": "Guardado como '{{name}}'",
"appliedToast": "Aplicado '{{name}}'",
"exportTemplates": "Exportar Plantillas",
"importTemplates": "Importar Plantillas"
},
"presets": {
"title": "Preajustes de Juego",
"createNew": "Crear Preajuste",
@@ -190,16 +264,19 @@
"tagSettings": "Ajustes de Etiquetas",
"historySettings": "Ajustes del Historial",
"theme": "Tema",
"defaultUILanguage": "Idioma de Interfaz Predeterminado",
"appLanguage": "Idioma de la App",
"defaultOutputLanguage": "Idioma de Salida Predeterminado",
"defaultGenre": "Género Predeterminado",
"defaultGenre": "Géneros Predeterminados",
"autoSaveDraft": "Guardar Borrador Automáticamente",
"showCharCount": "Mostrar Contador de Caracteres",
"compactTagDisplay": "Vista Compacta de Etiquetas",
"historyLimit": "Límite de Historial",
"multilingualTags": "Etiquetas Multilingües",
"trendingTags": "Etiquetas Tendencia",
"hashtagCount": "Cantidad de Hashtags"
"hashtagCount": "Cantidad de Hashtags",
"showQualityBadge": "Mostrar insignia de calidad en el título (ej. [2K 60FPS])",
"showCopyright": "Agregar línea de © copyright a la descripción",
"showUsagePolicy": "Agregar bloque de política de uso a la descripción"
},
"batch": {
"title": "Generación por Lote",
@@ -216,5 +293,31 @@
"saveDraft": "Guardar Borrador",
"help": "Ayuda",
"close": "Cerrar"
},
"validation": {
"emailInvalid": "Email inválido: {{email}}",
"emailMaxExceeded": "Máximo {{max}} emails permitidos (actualmente {{count}})",
"urlInvalid": "URL inválida. Debe comenzar con https://",
"urlPrefixMismatch": "Se espera URL que comience con {{expected}}"
},
"storeLinkTypes": {
"paid": "De pago",
"free": "Gratis",
"demo": "Demo gratis"
},
"playlist": {
"title": "Generador de Playlist",
"status": "Estado",
"contentType": "Tipo de Contenido",
"totalVideos": "Total de Videos",
"customNote": "Nota Personal",
"generatePlaylist": "Generar Playlist"
},
"logs": {
"title": "Registros",
"emptyState": "No hay registros.",
"clearAll": "Borrar Todo",
"clearConfirm": "¿Estás seguro de borrar todos los registros?",
"searchPlaceholder": "Buscar registros..."
}
}
+55 -4
View File
@@ -5,6 +5,8 @@
"videoType": {
"full": "",
"part": "パート{{partNumber}}",
"full_demo": "体験版フルプレイ",
"demo_part": "体験版 パート{{partNumber}}",
"boss": "{{bossName}} ボス戦",
"boss_nohit": "{{bossName}} ボス ノーヒット",
"ending": "エンディング",
@@ -16,13 +18,17 @@
"side_quest": "サブクエスト",
"secret": "隠し要素",
"comparison": "グラフィック比較",
"guide": "攻略ガイド"
"guide": "攻略ガイド",
"mods": "{{modName}} MOD",
"collectibles": "全コレクション"
}
},
"description": {
"intro": {
"full": "この動画は{{channelName}}による{{gameName}}のフルゲームプレイです。",
"part": "この動画は{{channelName}}による{{gameName}}のパート{{partNumber}}です。",
"full_demo": "この動画は{{channelName}}による{{gameName}}体験版のフルプレイです。",
"demo_part": "この動画は{{channelName}}による{{gameName}}体験版のパート{{partNumber}}です。",
"boss": "この動画は{{channelName}}による{{gameName}}の{{bossName}}ボス戦です。",
"boss_nohit": "この動画は{{channelName}}による{{gameName}}の{{bossName}}ボス戦(ノーヒット)です。",
"ending": "この動画は{{channelName}}による{{gameName}}のエンディングです。",
@@ -34,26 +40,71 @@
"side_quest": "この動画は{{channelName}}による{{gameName}}のサブクエストです。",
"secret": "この動画は{{channelName}}による{{gameName}}の隠し要素です。",
"comparison": "この動画は{{channelName}}による{{gameName}}のグラフィック比較です。",
"guide": "この動画は{{channelName}}による{{gameName}}の攻略ガイドです。"
"guide": "この動画は{{channelName}}による{{gameName}}の攻略ガイドです。",
"mods": "この動画は{{channelName}}による{{gameName}}の{{modName}} MODプレイです。",
"collectibles": "この動画は{{channelName}}による{{gameName}}のコレクション完全攻略です。"
},
"noCommentaryLine": "実況なし — 純粋なゲームプレイをお楽しみください。",
"storeLinkSuffix": {
"free": "無料",
"demo": "無料体験版"
},
"sections": {
"timestamps": "⏱ タイムスタンプ",
"storeLinks": "🎮 ゲームを購入",
"storeLinksBuy": "🎮 ゲームを購入 (応援したい方へ)",
"storeLinksDownload": "⬇️ ゲームをダウンロード (遊びたい方へ)",
"videoSettings": "🖥 動画設定",
"rig": "💻 PC構成",
"spoilerWarning": "⚠️ ネタバレ注意:この動画にはネタバレが含まれている可能性があります。自己責任でご視聴ください!",
"matureWarning": "🔞 成人向けコンテンツ (18+):暴力 / 強い言葉 / グラフィックコンテンツを含みます。",
"music": "🎵 音楽・サウンド",
"donate": "☕ チャンネルを応援",
"social": "🔗 フォローする",
"playlist": "▶️ シリーズ全体を見る:{{link}}",
"contact": "📧 お仕事の依頼:{{email}}",
"cta": "👍 いいね | 🔔 チャンネル登録 | ↗️ シェア"
"cta": "👍 いいね | 🔔 チャンネル登録 | ↗️ シェア",
"copyright": "© {{year}} {{channelName}}. All rights reserved.",
"usagePolicyHeader": "📋 動画利用ポリシー",
"usagePolicy": "• 元動画のリンクとチャンネル名を必ずクレジットしてください(最低でも説明欄に)。\n• 動画全体または大部分の再アップロードは禁止です。\n• 明示的な許可なしに収益化しないでください。\n• 元の内容や制作者を歪曲するような編集は禁止です。\n• クレジットを明記すれば、コンピレーション、レビュー、解説、リアクション動画はOKです。\n不明な点があれば、説明欄のソーシャルアカウントまたはメールでご連絡ください。"
}
},
"hashtags": {
"gameplay": "#{{gameName}}",
"noCommentary": "#GameplayNoCommentary",
"genre": "#{{genre}}"
},
"playlist": {
"status": {
"completed": "✅ クリア済み",
"dropped": "❌ 中断",
"incomplete": "🔄 未完了",
"in_progress": "▶️ プレイ中"
},
"titleFormat": "{{status}} - {{gameName}}",
"videoCount": "📹 {{count}}本の動画",
"storeSection": "🎮 ゲーム購入:",
"footer": "👍 高評価 | 🔔 チャンネル登録お願いします!",
"description": {
"full_gameplay": "このプレイリストは{{channelName}}での{{gameName}}のフルゲームプレイです。\n解説なし — 純粋なゲームプレイ体験。",
"boss_fights": "このプレイリストは{{channelName}}での{{gameName}}のボス戦集です。\n解説なし — 純粋なゲームプレイ体験。",
"speedrun": "このプレイリストは{{channelName}}での{{gameName}}のスピードランです。\n解説なし — 純粋なゲームプレイ体験。",
"all_endings": "このプレイリストは{{channelName}}での{{gameName}}の全エンディング集です。\n⚠️ ネタバレを含みます。",
"dlc": "このプレイリストは{{channelName}}での{{gameName}}のDLCゲームプレイです。\n解説なし — 純粋なゲームプレイ体験。",
"100_percent": "このプレイリストは{{channelName}}での{{gameName}}の100%クリアです。\n解説なし — 純粋なゲームプレイ体験。",
"guide": "このプレイリストは{{channelName}}での{{gameName}}の攻略ガイドです。\n解説なし — 純粋なゲームプレイ体験。",
"highlights": "このプレイリストは{{channelName}}での{{gameName}}のハイライト集です。\n解説なし — 純粋なゲームプレイ体験。"
}
},
"timeline": {
"keywords": {
"chapter": "第{{n}}章",
"part": "パート{{n}}",
"boss": "ボス{{n}}",
"final_boss": "ラスボス",
"intro": "オープニング",
"ending": "エンディング",
"tutorial": "チュートリアル",
"credits": "クレジット"
}
}
}
+116 -13
View File
@@ -9,9 +9,19 @@
"profiles": "プロフィール",
"history": "履歴",
"settings": "設定",
"batch": "一括"
"batch": "一括",
"playlist": "プレイリスト",
"logs": "ログ"
},
"editor": {
"sections": {
"gameInfo": "ゲーム情報",
"videoSettings": "動画設定",
"contentDetails": "コンテンツ詳細",
"attribution": "クレジット",
"rig": "PCスペック",
"storeAndSocial": "ストア・SNS"
},
"videoType": "動画タイプ",
"language": "出力言語",
"genre": "ゲームジャンル",
@@ -28,12 +38,15 @@
"dlcNamePlaceholder": "例:Shadow of the Erdtree",
"challengeName": "チャレンジ名",
"challengeNamePlaceholder": "例:ノーヒットラン",
"modName": "MOD名",
"modNamePlaceholder": "例: Requiem, NaturalVision Evolved",
"resolution": "解像度",
"fps": "FPS",
"graphicsPreset": "グラフィック設定",
"timestamps": "タイムスタンプ",
"timestampsPlaceholder": "0:00 イントロ\n5:30 チャプター1\n15:00 ボス戦",
"storeLinks": "購入リンク",
"storeLinkType": "種別",
"rig": "PC構成",
"social": "SNS・寄付リンク",
"warnings": "警告",
@@ -43,11 +56,19 @@
"playlistLinkPlaceholder": "https://youtube.com/playlist?list=...",
"contactEmail": "連絡先メール",
"contactEmailPlaceholder": "business@example.com",
"musicAttribution": "音楽・サウンドクレジット",
"musicAttributionPlaceholder": "音楽: Karl Casey @ White Bat Audio\n効果音: Freesound.org",
"thumbnailText": "サムネイルテキスト",
"thumbnailTextPlaceholder": "例: 隠しボス ノーヒット",
"pinnedComment": "固定コメントのテンプレート",
"pinnedCommentPlaceholder": "固定コメントに載せたい内容...",
"videoSettings": "動画設定",
"quickPreview": "クイックプレビュー",
"version": "バージョン",
"clearDraft": "下書きをクリア",
"draftSaved": "下書き保存済み",
"clearDraftConfirm": "フォームデータをすべてクリアしますか?"
"clearDraftConfirm": "フォームデータをすべてクリアしますか?",
"contactEmailHelp": "最大3つのメール、カンマ区切り"
},
"output": {
"title": "タイトル",
@@ -59,7 +80,18 @@
"copyAll": "全てコピー",
"copied": "コピーしました!",
"charCount": "{{count}}/{{limit}}",
"selectLanguages": "言語を選択"
"selectLanguages": "言語を選択",
"thumbnailText": "サムネイルテキスト",
"copyThumbnailText": "サムネイルテキストをコピー",
"pinnedComment": "固定コメント",
"copyPinnedComment": "固定コメントをコピー",
"generateAlternatives": "タイトル案を生成",
"saveAsTemplate": "テンプレートとして保存",
"variants": {
"default": "デフォルト",
"typeFirst": "タイプ優先",
"qualityFirst": "画質優先"
}
},
"common": {
"save": "保存",
@@ -75,6 +107,8 @@
"videoTypes": {
"full": "フルゲームプレイ",
"part": "ゲームプレイ パート",
"full_demo": "体験版フルプレイ",
"demo_part": "体験版 パート",
"boss": "ボス戦",
"boss_nohit": "ボス ノーヒット",
"ending": "エンディング",
@@ -86,19 +120,35 @@
"side_quest": "サブクエスト",
"secret": "隠し要素",
"comparison": "グラフィック比較",
"guide": "攻略ガイド"
"guide": "攻略ガイド",
"mods": "MODプレイ",
"collectibles": "全コレクション"
},
"genres": {
"action": "アクション / アドベンチャー",
"hack_slash": "ハック&スラッシュ",
"beatemup": "ベルトスクロール",
"platformer": "プラットフォーマー",
"horror": "ホラー / サバイバル",
"rpg": "RPG / JRPG",
"survival_horror": "サバイバルホラー",
"psychological_horror": "サイコホラー",
"rpg": "RPG",
"jrpg": "JRPG",
"action_rpg": "アクションRPG",
"crpg": "CRPG / アイソメトリック",
"fps": "FPS / シューター",
"arena_shooter": "アリーナシューター",
"tactical_fps": "タクティカルFPS",
"boomer_shooter": "ブーマーシューター",
"extraction_shooter": "脱出シューター",
"shmup": "シューティング / 弾幕",
"openworld": "オープンワールド / サンドボックス",
"indie": "インディー / プラットフォーマー",
"indie": "インディー",
"soulslike": "ソウルライク",
"racing": "レーシング / スポーツ",
"story": "ストーリー / ビジュアルノベル",
"story": "ストーリー / ナラティブ",
"simulation": "シミュレーション / ストラテジー",
"city_builder": "街づくり",
"fighting": "格闘ゲーム",
"stealth": "ステルス / スパイ",
"survival_craft": "サバイバル / クラフト",
@@ -109,11 +159,14 @@
"puzzle": "パズル",
"tower_defense": "タワーディフェンス",
"card_game": "カードゲーム",
"deck_builder": "デッキビルダー",
"auto_battler": "オートバトラー",
"battle_royale": "バトルロイヤル",
"crpg": "CRPG / アイソメトリック",
"tactical": "タクティカル / ターン制",
"space": "宇宙 / SF",
"farming": "農業 / ライフシム"
"farming": "農業 / ライフシム",
"fmv": "FMV / インタラクティブムービー",
"visual_novel": "ビジュアルノベル"
},
"rig": {
"cpu": "CPU",
@@ -123,7 +176,8 @@
"monitor": "モニター",
"capture": "キャプチャソフト",
"motherboard": "マザーボード",
"controller": "コントローラー"
"controller": "コントローラー",
"video_editor": "動画編集ソフト"
},
"social": {
"kofi": "Ko-fi",
@@ -137,7 +191,12 @@
"twitch": "Twitch",
"tiktok": "TikTok",
"instagram": "Instagram",
"streamlabs": "Streamlabs"
"streamlabs": "Streamlabs",
"bluesky": "Bluesky",
"mastodon": "Mastodon",
"facebook": "Facebook",
"fb_page": "Facebookページ",
"fb_group": "Facebookグループ"
},
"resolutions": {
"720p": "720p",
@@ -163,6 +222,21 @@
"exportProfiles": "プロフィールをエクスポート",
"importProfiles": "プロフィールをインポート"
},
"templates": {
"title": "テンプレート",
"createNew": "新規作成",
"saveAsTemplate": "テンプレートとして保存",
"templateName": "テンプレート名",
"templateNamePlaceholder": "例: エルデンリング ボス戦",
"loadTemplate": "適用",
"deleteConfirm": "このテンプレートを削除してもよろしいですか?",
"emptyState": "まだテンプレートがありません。現在のフォームを保存して再利用できます。",
"saveHint": "エディタの全フィールドを保存し、あとで同じ状態に戻せます。",
"savedAs": "'{{name}}' として保存しました",
"appliedToast": "'{{name}}' を適用しました",
"exportTemplates": "テンプレートをエクスポート",
"importTemplates": "テンプレートをインポート"
},
"presets": {
"title": "ゲームプリセット",
"createNew": "プリセット作成",
@@ -190,7 +264,7 @@
"tagSettings": "タグ",
"historySettings": "履歴",
"theme": "テーマ",
"defaultUILanguage": "デフォルトUI言語",
"appLanguage": "アプリの言語",
"defaultOutputLanguage": "デフォルト出力言語",
"defaultGenre": "デフォルトジャンル",
"autoSaveDraft": "下書き自動保存",
@@ -199,7 +273,10 @@
"historyLimit": "履歴上限",
"multilingualTags": "多言語タグを含む",
"trendingTags": "トレンドタグを含む",
"hashtagCount": "ハッシュタグ数"
"hashtagCount": "ハッシュタグ数",
"showQualityBadge": "タイトルに画質バッジを表示 (例: [2K 60FPS])",
"showCopyright": "説明欄に © 著作権行を追加",
"showUsagePolicy": "説明欄に動画利用ポリシーを追加"
},
"batch": {
"title": "一括モード",
@@ -216,5 +293,31 @@
"saveDraft": "下書き保存",
"help": "ショートカット表示",
"close": "モーダルを閉じる"
},
"validation": {
"emailInvalid": "無効なメール: {{email}}",
"emailMaxExceeded": "最大{{max}}件のメール (現在{{count}}件)",
"urlInvalid": "無効なURL。https://で始める必要があります",
"urlPrefixMismatch": "{{expected}}で始まるURLが必要です"
},
"storeLinkTypes": {
"paid": "有料",
"free": "無料",
"demo": "無料体験版"
},
"playlist": {
"title": "プレイリスト生成",
"status": "ステータス",
"contentType": "コンテンツタイプ",
"totalVideos": "動画総数",
"customNote": "カスタムノート",
"generatePlaylist": "プレイリスト生成"
},
"logs": {
"title": "ログ",
"emptyState": "ログはありません。",
"clearAll": "すべて削除",
"clearConfirm": "すべてのログを削除しますか?",
"searchPlaceholder": "ログを検索..."
}
}
+55 -4
View File
@@ -5,6 +5,8 @@
"videoType": {
"full": "",
"part": "파트 {{partNumber}}",
"full_demo": "전체 데모",
"demo_part": "데모 파트 {{partNumber}}",
"boss": "{{bossName}} 보스전",
"boss_nohit": "{{bossName}} 보스 노히트",
"ending": "엔딩",
@@ -16,13 +18,17 @@
"side_quest": "서브 퀘스트",
"secret": "비밀",
"comparison": "그래픽 비교",
"guide": "무음 가이드"
"guide": "무음 가이드",
"mods": "{{modName}} 모드",
"collectibles": "모든 수집품"
}
},
"description": {
"intro": {
"full": "이 영상은 {{channelName}}에서 {{gameName}}의 전체 게임플레이를 담고 있습니다.",
"part": "이 영상은 {{channelName}}에서 {{gameName}} 파트 {{partNumber}}를 담고 있습니다.",
"full_demo": "이 영상은 {{channelName}}에서 {{gameName}}의 전체 데모를 담고 있습니다.",
"demo_part": "이 영상은 {{channelName}}에서 {{gameName}} 데모 파트 {{partNumber}}를 담고 있습니다.",
"boss": "이 영상은 {{channelName}}에서 {{gameName}}의 {{bossName}} 보스전을 담고 있습니다.",
"boss_nohit": "이 영상은 {{channelName}}에서 {{gameName}}의 {{bossName}} 보스전 (노히트)을 담고 있습니다.",
"ending": "이 영상은 {{channelName}}에서 {{gameName}}의 엔딩을 담고 있습니다.",
@@ -34,26 +40,71 @@
"side_quest": "이 영상은 {{channelName}}에서 {{gameName}}의 서브 퀘스트와 선택 콘텐츠를 담고 있습니다.",
"secret": "이 영상은 {{channelName}}에서 {{gameName}}의 비밀과 숨겨진 요소를 담고 있습니다.",
"comparison": "이 영상은 {{channelName}}에서 {{gameName}}의 그래픽 비교를 담고 있습니다.",
"guide": "이 영상은 {{channelName}}에서 {{gameName}}의 무음 가이드를 담고 있습니다."
"guide": "이 영상은 {{channelName}}에서 {{gameName}}의 무음 가이드를 담고 있습니다.",
"mods": "이 영상은 {{channelName}}에서 {{gameName}}의 {{modName}} 모드 플레이를 담고 있습니다.",
"collectibles": "이 영상은 {{channelName}}에서 {{gameName}}의 모든 수집 요소와 100% 완료 플레이를 담고 있습니다."
},
"noCommentaryLine": "무음 플레이 — 순수한 게임플레이를 즐겨보세요.",
"storeLinkSuffix": {
"free": "무료",
"demo": "무료 데모"
},
"sections": {
"timestamps": "⏱ 타임스탬프",
"storeLinks": "🎮 게임 구매",
"storeLinksBuy": "🎮 게임 구매 (구매하고 싶다면)",
"storeLinksDownload": "⬇️ 게임 다운로드 (플레이하고 싶다면)",
"videoSettings": "🖥 영상 설정",
"rig": "💻 내 장비",
"spoilerWarning": "⚠️ 스포일러 경고: 이 영상에는 스포일러가 포함될 수 있습니다. 주의하여 시청하세요!",
"matureWarning": "🔞 성인 콘텐츠 (18+): 폭력 / 강한 언어 / 선정적 콘텐츠를 포함합니다.",
"music": "🎵 음악 / 사운드",
"donate": "☕ 채널 후원",
"social": "🔗 팔로우",
"playlist": "▶️ 전체 시리즈 보기: {{link}}",
"contact": "📧 비즈니스 문의: {{email}}",
"cta": "👍 좋아요 | 🔔 구독 | ↗️ 공유"
"cta": "👍 좋아요 | 🔔 구독 | ↗️ 공유",
"copyright": "© {{year}} {{channelName}}. All rights reserved.",
"usagePolicyHeader": "📋 영상 사용 정책",
"usagePolicy": "• 원본 영상 링크와 채널을 반드시 크레딧해주세요 (최소한 설명란에).\n• 전체 영상 또는 상당 부분을 본인 콘텐츠로 재업로드하지 마세요.\n• 명시적 동의 없이 수익화하지 마세요.\n• 원본 내용이나 제작자를 왜곡하는 방식으로 편집하지 마세요.\n• 컴필레이션, 리뷰, 해설, 리액션 영상은 크레딧만 하면 OK입니다.\n불확실한 경우 설명란의 소셜 계정이나 이메일로 연락주세요."
}
},
"hashtags": {
"gameplay": "#{{gameName}}",
"noCommentary": "#GameplayNoCommentary",
"genre": "#{{genre}}"
},
"playlist": {
"status": {
"completed": "✅ 완료",
"dropped": "❌ 중단",
"incomplete": "🔄 미완료",
"in_progress": "▶️ 진행 중"
},
"titleFormat": "{{status}} - {{gameName}}",
"videoCount": "📹 {{count}}개 영상",
"storeSection": "🎮 게임 구매:",
"footer": "👍 좋아요 | 🔔 구독 부탁드립니다!",
"description": {
"full_gameplay": "이 플레이리스트는 {{channelName}}에서 {{gameName}}의 전체 게임플레이입니다.\n해설 없음 — 순수한 게임플레이 경험.",
"boss_fights": "이 플레이리스트는 {{channelName}}에서 {{gameName}}의 모든 보스전을 담고 있습니다.\n해설 없음.",
"speedrun": "이 플레이리스트는 {{channelName}}에서 {{gameName}}의 스피드런을 담고 있습니다.\n해설 없음.",
"all_endings": "이 플레이리스트는 {{channelName}}에서 {{gameName}}의 모든 엔딩을 담고 있습니다.\n⚠️ 스포일러 포함.",
"dlc": "이 플레이리스트는 {{channelName}}에서 {{gameName}}의 DLC 게임플레이를 담고 있습니다.\n해설 없음.",
"100_percent": "이 플레이리스트는 {{channelName}}에서 {{gameName}}의 100% 완료 플레이를 담고 있습니다.\n해설 없음.",
"guide": "이 플레이리스트는 {{channelName}}에서 {{gameName}}의 무음 가이드입니다.\n해설 없음.",
"highlights": "이 플레이리스트는 {{channelName}}에서 {{gameName}}의 하이라이트 모음입니다.\n해설 없음."
}
},
"timeline": {
"keywords": {
"chapter": "제{{n}}장",
"part": "파트 {{n}}",
"boss": "보스 {{n}}",
"final_boss": "최종 보스",
"intro": "인트로",
"ending": "엔딩",
"tutorial": "튜토리얼",
"credits": "크레딧"
}
}
}
+116 -13
View File
@@ -9,9 +9,19 @@
"profiles": "프로필",
"history": "기록",
"settings": "설정",
"batch": "일괄"
"batch": "일괄",
"playlist": "플레이리스트",
"logs": "로그"
},
"editor": {
"sections": {
"gameInfo": "게임 정보",
"videoSettings": "비디오 설정",
"contentDetails": "콘텐츠 상세",
"attribution": "크레딧",
"rig": "내 장비",
"storeAndSocial": "스토어 & 소셜"
},
"videoType": "영상 유형",
"language": "출력 언어",
"genre": "게임 장르",
@@ -28,12 +38,15 @@
"dlcNamePlaceholder": "예: Shadow of the Erdtree",
"challengeName": "챌린지 이름",
"challengeNamePlaceholder": "예: 노히트 런",
"modName": "모드 이름",
"modNamePlaceholder": "예: Requiem, NaturalVision Evolved",
"resolution": "해상도",
"fps": "FPS",
"graphicsPreset": "그래픽 프리셋",
"timestamps": "타임스탬프",
"timestampsPlaceholder": "0:00 인트로\n5:30 챕터 1\n15:00 보스전",
"storeLinks": "스토어 링크",
"storeLinkType": "유형",
"rig": "내 장비",
"social": "소셜 및 후원 링크",
"warnings": "경고",
@@ -43,11 +56,19 @@
"playlistLinkPlaceholder": "https://youtube.com/playlist?list=...",
"contactEmail": "문의 이메일",
"contactEmailPlaceholder": "business@example.com",
"musicAttribution": "음악 / 사운드 크레딧",
"musicAttributionPlaceholder": "음악: Karl Casey @ White Bat Audio\n효과음: Freesound.org",
"thumbnailText": "썸네일 텍스트",
"thumbnailTextPlaceholder": "예: 시크릿 보스 노히트",
"pinnedComment": "고정 댓글 템플릿",
"pinnedCommentPlaceholder": "고정 댓글 내용...",
"videoSettings": "영상 설정",
"quickPreview": "빠른 미리보기",
"version": "버전",
"clearDraft": "초안 지우기",
"draftSaved": "초안 저장됨",
"clearDraftConfirm": "모든 양식 데이터를 지우시겠습니까?"
"clearDraftConfirm": "모든 양식 데이터를 지우시겠습니까?",
"contactEmailHelp": "최대 3개 이메일, 쉼표로 구분"
},
"output": {
"title": "제목",
@@ -59,7 +80,18 @@
"copyAll": "전체 복사",
"copied": "복사 완료!",
"charCount": "{{count}}/{{limit}}",
"selectLanguages": "언어 선택"
"selectLanguages": "언어 선택",
"thumbnailText": "썸네일 텍스트",
"copyThumbnailText": "썸네일 텍스트 복사",
"pinnedComment": "고정 댓글",
"copyPinnedComment": "고정 댓글 복사",
"generateAlternatives": "제목 대안 생성",
"saveAsTemplate": "템플릿으로 저장",
"variants": {
"default": "기본",
"typeFirst": "유형 우선",
"qualityFirst": "화질 우선"
}
},
"common": {
"save": "저장",
@@ -75,6 +107,8 @@
"videoTypes": {
"full": "전체 게임플레이",
"part": "게임플레이 파트",
"full_demo": "전체 데모",
"demo_part": "데모 파트",
"boss": "보스전",
"boss_nohit": "보스 노히트",
"ending": "엔딩 / 모든 엔딩",
@@ -86,19 +120,35 @@
"side_quest": "서브 퀘스트",
"secret": "비밀 / 숨겨진 요소",
"comparison": "그래픽 비교",
"guide": "무음 가이드"
"guide": "무음 가이드",
"mods": "모드 플레이",
"collectibles": "모든 수집품"
},
"genres": {
"action": "액션 / 어드벤처",
"hack_slash": "핵앤슬래시",
"beatemup": "벨트스크롤 액션",
"platformer": "플랫포머",
"horror": "호러 / 서바이벌",
"rpg": "RPG / JRPG",
"survival_horror": "서바이벌 호러",
"psychological_horror": "심리 호러",
"rpg": "RPG",
"jrpg": "JRPG",
"action_rpg": "액션 RPG",
"crpg": "CRPG / 아이소메트릭",
"fps": "FPS / 슈터",
"arena_shooter": "아레나 슈터",
"tactical_fps": "택티컬 FPS",
"boomer_shooter": "부머 슈터",
"extraction_shooter": "익스트랙션 슈터",
"shmup": "슈팅 / 탄막",
"openworld": "오픈 월드 / 샌드박스",
"indie": "인디 / 플랫포머",
"indie": "인디",
"soulslike": "소울라이크",
"racing": "레이싱 / 스포츠",
"story": "스토리 / 비주얼 노벨",
"story": "스토리 / 내러티브",
"simulation": "시뮬레이션 / 전략",
"city_builder": "도시 건설",
"fighting": "격투",
"stealth": "잠입 / 첩보",
"survival_craft": "서바이벌 / 크래프팅",
@@ -109,11 +159,14 @@
"puzzle": "퍼즐",
"tower_defense": "타워 디펜스",
"card_game": "카드 게임",
"deck_builder": "덱 빌더",
"auto_battler": "오토 배틀러",
"battle_royale": "배틀로얄",
"crpg": "CRPG / 아이소메트릭",
"tactical": "전술 / 턴제",
"space": "우주 / SF",
"farming": "농장 / 라이프 시뮬"
"farming": "농장 / 라이프 시뮬",
"fmv": "FMV / 인터랙티브 무비",
"visual_novel": "비주얼 노벨"
},
"rig": {
"cpu": "CPU",
@@ -123,7 +176,8 @@
"monitor": "모니터",
"capture": "캡처 소프트웨어",
"motherboard": "메인보드",
"controller": "컨트롤러"
"controller": "컨트롤러",
"video_editor": "영상 편집 프로그램"
},
"social": {
"kofi": "Ko-fi",
@@ -137,7 +191,12 @@
"twitch": "Twitch",
"tiktok": "TikTok",
"instagram": "Instagram",
"streamlabs": "Streamlabs"
"streamlabs": "Streamlabs",
"bluesky": "Bluesky",
"mastodon": "Mastodon",
"facebook": "Facebook",
"fb_page": "Facebook 페이지",
"fb_group": "Facebook 그룹"
},
"resolutions": {
"720p": "720p",
@@ -163,6 +222,21 @@
"exportProfiles": "프로필 내보내기",
"importProfiles": "프로필 가져오기"
},
"templates": {
"title": "템플릿",
"createNew": "템플릿 만들기",
"saveAsTemplate": "템플릿으로 저장",
"templateName": "템플릿 이름",
"templateNamePlaceholder": "예: 엘든 링 보스전",
"loadTemplate": "적용",
"deleteConfirm": "이 템플릿을 삭제하시겠습니까?",
"emptyState": "아직 템플릿이 없습니다. 현재 폼을 저장하여 재사용하세요.",
"saveHint": "에디터의 모든 필드를 저장하여 나중에 동일한 상태로 복원할 수 있습니다.",
"savedAs": "'{{name}}'(으)로 저장됨",
"appliedToast": "'{{name}}' 적용됨",
"exportTemplates": "템플릿 내보내기",
"importTemplates": "템플릿 가져오기"
},
"presets": {
"title": "게임 프리셋",
"createNew": "프리셋 만들기",
@@ -190,7 +264,7 @@
"tagSettings": "태그 설정",
"historySettings": "기록 설정",
"theme": "테마",
"defaultUILanguage": "기본 UI 언어",
"appLanguage": "앱 언어",
"defaultOutputLanguage": "기본 출력 언어",
"defaultGenre": "기본 장르",
"autoSaveDraft": "초안 자동 저장",
@@ -199,7 +273,10 @@
"historyLimit": "기록 제한",
"multilingualTags": "다국어 태그",
"trendingTags": "인기 태그",
"hashtagCount": "해시태그 수"
"hashtagCount": "해시태그 수",
"showQualityBadge": "제목에 화질 배지 표시 (예: [2K 60FPS])",
"showCopyright": "설명란에 © 저작권 줄 추가",
"showUsagePolicy": "설명란에 영상 사용 정책 블록 추가"
},
"batch": {
"title": "일괄 생성",
@@ -216,5 +293,31 @@
"saveDraft": "초안 저장",
"help": "도움말",
"close": "닫기"
},
"validation": {
"emailInvalid": "잘못된 이메일: {{email}}",
"emailMaxExceeded": "최대 {{max}}개 이메일 허용 (현재 {{count}}개)",
"urlInvalid": "잘못된 URL입니다. https://로 시작해야 합니다",
"urlPrefixMismatch": "{{expected}}로 시작하는 URL이 필요합니다"
},
"storeLinkTypes": {
"paid": "유료",
"free": "무료",
"demo": "무료 데모"
},
"playlist": {
"title": "플레이리스트 생성기",
"status": "상태",
"contentType": "콘텐츠 유형",
"totalVideos": "총 영상 수",
"customNote": "사용자 메모",
"generatePlaylist": "플레이리스트 생성"
},
"logs": {
"title": "로그",
"emptyState": "로그가 없습니다.",
"clearAll": "모두 삭제",
"clearConfirm": "모든 로그를 삭제하시겠습니까?",
"searchPlaceholder": "로그 검색..."
}
}
+55 -4
View File
@@ -5,6 +5,8 @@
"videoType": {
"full": "",
"part": "Phần {{partNumber}}",
"full_demo": "Bản Demo",
"demo_part": "Demo Phần {{partNumber}}",
"boss": "{{bossName}} Boss Fight",
"boss_nohit": "{{bossName}} Boss No Hit",
"ending": "Kết thúc",
@@ -16,13 +18,17 @@
"side_quest": "Nhiệm vụ phụ",
"secret": "Bí mật",
"comparison": "So sánh",
"guide": "Hướng dẫn"
"guide": "Hướng dẫn",
"mods": "Mod {{modName}}",
"collectibles": "Tất cả Sưu tầm"
}
},
"description": {
"intro": {
"full": "Video này là full gameplay của {{gameName}} trên kênh {{channelName}}.",
"part": "Video này là Phần {{partNumber}} của {{gameName}} trên kênh {{channelName}}.",
"full_demo": "Video này là bản demo đầy đủ của {{gameName}} trên kênh {{channelName}}.",
"demo_part": "Video này là Phần {{partNumber}} của bản demo {{gameName}} trên kênh {{channelName}}.",
"boss": "Video này là trận đánh boss {{bossName}} trong {{gameName}} trên kênh {{channelName}}.",
"boss_nohit": "Video này là trận đánh boss {{bossName}} (No Hit) trong {{gameName}} trên kênh {{channelName}}.",
"ending": "Video này là phần kết thúc của {{gameName}} trên kênh {{channelName}}.",
@@ -34,26 +40,71 @@
"side_quest": "Video này là các nhiệm vụ phụ trong {{gameName}} trên kênh {{channelName}}.",
"secret": "Video này là nội dung bí mật và ẩn trong {{gameName}} trên kênh {{channelName}}.",
"comparison": "Video này so sánh đồ họa/hiệu suất của {{gameName}} trên kênh {{channelName}}.",
"guide": "Video này là hướng dẫn không lời cho {{gameName}} trên kênh {{channelName}}."
"guide": "Video này là hướng dẫn không lời cho {{gameName}} trên kênh {{channelName}}.",
"mods": "Video này showcase mod {{modName}} cho {{gameName}} trên kênh {{channelName}}.",
"collectibles": "Video này gom đủ mọi vật phẩm sưu tầm và 100% completion trong {{gameName}} trên kênh {{channelName}}."
},
"noCommentaryLine": "Không bình luận — gameplay thuần túy để bạn thưởng thức.",
"storeLinkSuffix": {
"free": "miễn phí",
"demo": "demo miễn phí"
},
"sections": {
"timestamps": "⏱ MỐC THỜI GIAN",
"storeLinks": "🎮 MUA GAME",
"storeLinksBuy": "🎮 MUA GAME (nếu bạn muốn ủng hộ)",
"storeLinksDownload": "⬇️ TẢI GAME (nếu bạn muốn chơi)",
"videoSettings": "🖥 CÀI ĐẶT VIDEO",
"rig": "💻 CẤU HÌNH MÁY",
"spoilerWarning": "⚠️ CẢNH BÁO SPOILER: Video này có thể chứa nội dung spoiler. Xem theo ý muốn của bạn!",
"matureWarning": "🔞 NỘI DUNG NGƯỜI LỚN (18+): Chứa bạo lực / ngôn ngữ mạnh / nội dung nhạy cảm.",
"music": "🎵 NHẠC / ÂM THANH",
"donate": "☕ ỦNG HỘ KÊNH",
"social": "🔗 THEO DÕI MÌNH",
"playlist": "▶️ Xem toàn bộ series: {{link}}",
"contact": "📧 Liên hệ hợp tác: {{email}}",
"cta": "👍 Like | 🔔 Đăng ký | ↗️ Chia sẻ"
"cta": "👍 Like | 🔔 Đăng ký | ↗️ Chia sẻ",
"copyright": "© {{year}} {{channelName}}. Đã đăng ký bản quyền.",
"usagePolicyHeader": "📋 ĐIỀU KIỆN DÙNG VIDEO",
"usagePolicy": "• Luôn luôn ghi credit kèm link video gốc VÀ kênh (tối thiểu trong phần mô tả).\n• Không re-upload toàn bộ video hoặc phần lớn nội dung dưới dạng content của bạn.\n• Không kiếm tiền từ footage mà chưa có sự đồng ý rõ ràng.\n• Không chỉnh sửa footage theo cách xuyên tạc nội dung gốc hoặc người tạo.\n• Compilation, review, commentary, reaction video đều OK miễn là có credit.\nNếu không chắc, liên hệ qua các kênh social hoặc email ở phần mô tả."
}
},
"hashtags": {
"gameplay": "#{{gameName}}",
"noCommentary": "#GameplayNoCommentary",
"genre": "#{{genre}}"
},
"playlist": {
"status": {
"completed": "✅ Hoàn thành",
"dropped": "❌ Bỏ dở",
"incomplete": "🔄 Chưa hoàn thành",
"in_progress": "▶️ Đang chơi"
},
"titleFormat": "{{status}} - {{gameName}}",
"videoCount": "📹 {{count}} video",
"storeSection": "🎮 Tải / mua game:",
"footer": "👍 Like | 🔔 Subscribe để xem thêm gameplay!",
"description": {
"full_gameplay": "Playlist này là toàn bộ gameplay của game {{gameName}} trên kênh {{channelName}}.\nKhông bình luận — chỉ có gameplay thuần túy.",
"boss_fights": "Playlist này là tổng hợp các trận đánh boss trong {{gameName}} trên kênh {{channelName}}.\nKhông bình luận — chỉ có gameplay thuần túy.",
"speedrun": "Playlist này là speedrun của {{gameName}} trên kênh {{channelName}}.\nKhông bình luận — chỉ có gameplay thuần túy.",
"all_endings": "Playlist này là tất cả các kết thúc của {{gameName}} trên kênh {{channelName}}.\n⚠️ Có chứa spoiler.",
"dlc": "Playlist này là gameplay DLC của {{gameName}} trên kênh {{channelName}}.\nKhông bình luận — chỉ có gameplay thuần túy.",
"100_percent": "Playlist này là 100% completion của {{gameName}} trên kênh {{channelName}}.\nKhông bình luận — chỉ có gameplay thuần túy.",
"guide": "Playlist này là hướng dẫn không lời cho {{gameName}} trên kênh {{channelName}}.\nKhông bình luận — chỉ có gameplay thuần túy.",
"highlights": "Playlist này là tổng hợp khoảnh khắc hay nhất của {{gameName}} trên kênh {{channelName}}.\nKhông bình luận — chỉ có gameplay thuần túy."
}
},
"timeline": {
"keywords": {
"chapter": "Chương {{n}}",
"part": "Phần {{n}}",
"boss": "Boss {{n}}",
"final_boss": "Boss cuối",
"intro": "Mở đầu",
"ending": "Kết thúc",
"tutorial": "Hướng dẫn",
"credits": "Credits"
}
}
}
+116 -13
View File
@@ -9,9 +9,19 @@
"profiles": "Hồ sơ",
"history": "Lịch sử",
"settings": "Cài đặt",
"batch": "Hàng loạt"
"batch": "Hàng loạt",
"playlist": "Playlist",
"logs": "Nhật ký"
},
"editor": {
"sections": {
"gameInfo": "Thông tin game",
"videoSettings": "Cài đặt video",
"contentDetails": "Nội dung video",
"attribution": "Credit / Ghi chú",
"rig": "Cấu hình máy",
"storeAndSocial": "Store & Mạng xã hội"
},
"videoType": "Loại Video",
"language": "Ngôn ngữ đầu ra",
"genre": "Thể loại Game",
@@ -28,12 +38,15 @@
"dlcNamePlaceholder": "VD: Shadow of the Erdtree",
"challengeName": "Tên Challenge",
"challengeNamePlaceholder": "VD: No Hit Run",
"modName": "Tên Mod",
"modNamePlaceholder": "vd: Requiem, NaturalVision Evolved",
"resolution": "Độ phân giải",
"fps": "FPS",
"graphicsPreset": "Cài đặt đồ họa",
"timestamps": "Mốc thời gian",
"timestampsPlaceholder": "0:00 Giới thiệu\n5:30 Chương 1\n15:00 Đánh Boss",
"storeLinks": "Link mua game",
"storeLinkType": "Loại",
"rig": "Cấu hình máy",
"social": "Mạng xã hội & Donate",
"warnings": "Cảnh báo",
@@ -43,11 +56,19 @@
"playlistLinkPlaceholder": "https://youtube.com/playlist?list=...",
"contactEmail": "Email liên hệ",
"contactEmailPlaceholder": "business@example.com",
"musicAttribution": "Credit nhạc / âm thanh",
"musicAttributionPlaceholder": "Nhạc: Karl Casey @ White Bat Audio\nSFX: Freesound.org",
"thumbnailText": "Text thumbnail",
"thumbnailTextPlaceholder": "vd: SECRET BOSS NO HIT",
"pinnedComment": "Bình luận ghim",
"pinnedCommentPlaceholder": "Nội dung bình luận ghim cho video...",
"videoSettings": "Cài đặt Video",
"quickPreview": "Xem trước nhanh",
"version": "Phiên bản",
"clearDraft": "Xóa bản nháp",
"draftSaved": "Đã lưu nháp",
"clearDraftConfirm": "Bạn có chắc muốn xóa toàn bộ dữ liệu form?"
"clearDraftConfirm": "Bạn có chắc muốn xóa toàn bộ dữ liệu form?",
"contactEmailHelp": "Tối đa 3 email, cách nhau bằng dấu phẩy"
},
"output": {
"title": "Tiêu đề",
@@ -59,7 +80,18 @@
"copyAll": "Sao chép tất cả",
"copied": "Đã sao chép!",
"charCount": "{{count}}/{{limit}}",
"selectLanguages": "Chọn ngôn ngữ"
"selectLanguages": "Chọn ngôn ngữ",
"thumbnailText": "Text thumbnail",
"copyThumbnailText": "Sao chép text thumbnail",
"pinnedComment": "Bình luận ghim",
"copyPinnedComment": "Sao chép bình luận ghim",
"generateAlternatives": "Tạo biến thể tiêu đề",
"saveAsTemplate": "Lưu thành template",
"variants": {
"default": "Mặc định",
"typeFirst": "Loại video trước",
"qualityFirst": "Chất lượng trước"
}
},
"common": {
"save": "Lưu",
@@ -75,6 +107,8 @@
"videoTypes": {
"full": "Full Gameplay",
"part": "Gameplay Phần",
"full_demo": "Bản Demo đầy đủ",
"demo_part": "Demo Phần",
"boss": "Boss Fight",
"boss_nohit": "Boss No Hit",
"ending": "Kết thúc",
@@ -86,19 +120,35 @@
"side_quest": "Nhiệm vụ phụ",
"secret": "Bí mật / Ẩn",
"comparison": "So sánh đồ họa",
"guide": "Hướng dẫn"
"guide": "Hướng dẫn",
"mods": "Chơi với Mod",
"collectibles": "Full Sưu Tầm"
},
"genres": {
"action": "Hành động / Phiêu lưu",
"hack_slash": "Chặt chém (Hack & Slash)",
"beatemup": "Đấm đá (Beat 'em Up)",
"platformer": "Platformer",
"horror": "Kinh dị / Sinh tồn",
"rpg": "RPG / JRPG",
"survival_horror": "Kinh dị sinh tồn",
"psychological_horror": "Kinh dị tâm lý",
"rpg": "RPG",
"jrpg": "JRPG",
"action_rpg": "Action RPG",
"crpg": "CRPG / Isometric",
"fps": "FPS / Bắn súng",
"arena_shooter": "Bắn súng đấu trường",
"tactical_fps": "FPS chiến thuật",
"boomer_shooter": "Boomer Shooter",
"extraction_shooter": "Extraction Shooter",
"shmup": "Shoot 'em Up / Bullet Hell",
"openworld": "Thế giới mở / Sandbox",
"indie": "Indie / Platformer",
"indie": "Indie",
"soulslike": "Souls-like",
"racing": "Đua xe / Thể thao",
"story": "Cốt truyện / Visual Novel",
"story": "Cốt truyện",
"simulation": "Mô phỏng / Chiến thuật",
"city_builder": "Xây dựng thành phố",
"fighting": "Đối kháng",
"stealth": "Hành động lén",
"survival_craft": "Sinh tồn / Chế tạo",
@@ -109,11 +159,14 @@
"puzzle": "Giải đố",
"tower_defense": "Tower Defense",
"card_game": "Game thẻ bài",
"deck_builder": "Xây dựng bộ bài",
"auto_battler": "Auto Battler",
"battle_royale": "Battle Royale",
"crpg": "CRPG / Isometric",
"tactical": "Chiến thuật",
"space": "Vũ trụ / Sci-Fi",
"farming": "Nông trại / Life Sim"
"farming": "Nông trại / Life Sim",
"fmv": "FMV / Phim tương tác",
"visual_novel": "Visual Novel"
},
"rig": {
"cpu": "CPU",
@@ -123,7 +176,8 @@
"monitor": "Màn hình",
"capture": "Phần mềm quay",
"motherboard": "Bo mạch chủ",
"controller": "Tay cầm"
"controller": "Tay cầm",
"video_editor": "Phần mềm dựng video"
},
"social": {
"kofi": "Ko-fi",
@@ -137,7 +191,12 @@
"twitch": "Twitch",
"tiktok": "TikTok",
"instagram": "Instagram",
"streamlabs": "Streamlabs"
"streamlabs": "Streamlabs",
"bluesky": "Bluesky",
"mastodon": "Mastodon",
"facebook": "Facebook",
"fb_page": "Facebook Page",
"fb_group": "Facebook Group"
},
"resolutions": {
"720p": "720p",
@@ -163,6 +222,21 @@
"exportProfiles": "Xuất hồ sơ",
"importProfiles": "Nhập hồ sơ"
},
"templates": {
"title": "Template",
"createNew": "Tạo template",
"saveAsTemplate": "Lưu thành template",
"templateName": "Tên template",
"templateNamePlaceholder": "vd: Elden Ring Boss Run",
"loadTemplate": "Áp dụng",
"deleteConfirm": "Bạn có chắc muốn xoá template này?",
"emptyState": "Chưa có template nào. Lưu form hiện tại để tái sử dụng.",
"saveHint": "Lưu toàn bộ field editor để sau này khôi phục đúng trạng thái.",
"savedAs": "Đã lưu '{{name}}'",
"appliedToast": "Đã áp dụng '{{name}}'",
"exportTemplates": "Xuất template",
"importTemplates": "Nhập template"
},
"presets": {
"title": "Cài đặt Game",
"createNew": "Tạo preset",
@@ -190,7 +264,7 @@
"tagSettings": "Tags",
"historySettings": "Lịch sử",
"theme": "Giao diện",
"defaultUILanguage": "Ngôn ngữ giao diện",
"appLanguage": "Ngôn ngữ ứng dụng",
"defaultOutputLanguage": "Ngôn ngữ đầu ra",
"defaultGenre": "Thể loại mặc định",
"autoSaveDraft": "Tự động lưu nháp",
@@ -199,7 +273,10 @@
"historyLimit": "Giới hạn lịch sử",
"multilingualTags": "Tags đa ngôn ngữ",
"trendingTags": "Tags xu hướng",
"hashtagCount": "Số hashtag"
"hashtagCount": "Số hashtag",
"showQualityBadge": "Hiện badge chất lượng trong tiêu đề (vd: [2K 60FPS])",
"showCopyright": "Gắn dòng © copyright vào description",
"showUsagePolicy": "Gắn khối quy định sử dụng video vào description"
},
"batch": {
"title": "Chế độ hàng loạt",
@@ -216,5 +293,31 @@
"saveDraft": "Lưu nháp",
"help": "Hiện phím tắt",
"close": "Đóng"
},
"validation": {
"emailInvalid": "Email không hợp lệ: {{email}}",
"emailMaxExceeded": "Tối đa {{max}} email (hiện tại {{count}})",
"urlInvalid": "URL không hợp lệ. Phải bắt đầu bằng https://",
"urlPrefixMismatch": "URL nên bắt đầu bằng {{expected}}"
},
"storeLinkTypes": {
"paid": "Trả phí",
"free": "Miễn phí",
"demo": "Demo miễn phí"
},
"playlist": {
"title": "Tạo Playlist",
"status": "Trạng thái",
"contentType": "Loại nội dung",
"totalVideos": "Tổng video",
"customNote": "Ghi chú",
"generatePlaylist": "Tạo Playlist"
},
"logs": {
"title": "Nhật ký",
"emptyState": "Chưa có nhật ký.",
"clearAll": "Xóa tất cả",
"clearConfirm": "Bạn có chắc muốn xóa toàn bộ nhật ký?",
"searchPlaceholder": "Tìm kiếm nhật ký..."
}
}
+55 -4
View File
@@ -5,6 +5,8 @@
"videoType": {
"full": "",
"part": "第{{partNumber}}集",
"full_demo": "完整试玩",
"demo_part": "试玩第{{partNumber}}集",
"boss": "{{bossName}} Boss战",
"boss_nohit": "{{bossName}} Boss无伤",
"ending": "结局",
@@ -16,13 +18,17 @@
"side_quest": "支线任务",
"secret": "秘密",
"comparison": "画质对比",
"guide": "无声攻略"
"guide": "无声攻略",
"mods": "{{modName}} Mod",
"collectibles": "全收集要素"
}
},
"description": {
"intro": {
"full": "本视频展示了{{channelName}}的{{gameName}}完整游戏实况。",
"part": "本视频展示了{{channelName}}的{{gameName}}第{{partNumber}}集。",
"full_demo": "本视频展示了{{channelName}}的{{gameName}}完整试玩。",
"demo_part": "本视频展示了{{channelName}}的{{gameName}}试玩第{{partNumber}}集。",
"boss": "本视频展示了{{channelName}}的{{gameName}}中{{bossName}} Boss战。",
"boss_nohit": "本视频展示了{{channelName}}的{{gameName}}中{{bossName}} Boss战(无伤)。",
"ending": "本视频展示了{{channelName}}的{{gameName}}结局。",
@@ -34,26 +40,71 @@
"side_quest": "本视频展示了{{channelName}}的{{gameName}}支线任务与可选内容。",
"secret": "本视频展示了{{channelName}}的{{gameName}}秘密与隐藏内容。",
"comparison": "本视频展示了{{channelName}}的{{gameName}}画质对比。",
"guide": "本视频展示了{{channelName}}的{{gameName}}无声攻略。"
"guide": "本视频展示了{{channelName}}的{{gameName}}无声攻略。",
"mods": "本视频展示了{{channelName}}的{{gameName}}之{{modName}} Mod游玩。",
"collectibles": "本视频展示了{{channelName}}的{{gameName}}全收集要素与100%完成度。"
},
"noCommentaryLine": "无解说 — 纯粹的游戏体验,尽情享受。",
"storeLinkSuffix": {
"free": "免费",
"demo": "免费试玩"
},
"sections": {
"timestamps": "⏱ 时间戳",
"storeLinks": "🎮 获取游戏",
"storeLinksBuy": "🎮 获取游戏 (如果你想购买)",
"storeLinksDownload": "⬇️ 下载游戏 (如果你想游玩)",
"videoSettings": "🖥 视频设置",
"rig": "💻 我的配置",
"spoilerWarning": "⚠️ 剧透警告:本视频可能包含剧透内容,请自行斟酌观看!",
"matureWarning": "🔞 成人内容 (18+):包含暴力 / 强烈语言 / 血腥内容。",
"music": "🎵 音乐 / 音效",
"donate": "☕ 支持频道",
"social": "🔗 关注我",
"playlist": "▶️ 观看完整系列:{{link}}",
"contact": "📧 商务合作:{{email}}",
"cta": "👍 点赞 | 🔔 订阅 | ↗️ 分享"
"cta": "👍 点赞 | 🔔 订阅 | ↗️ 分享",
"copyright": "© {{year}} {{channelName}}. 版权所有。",
"usagePolicyHeader": "📋 视频使用规则",
"usagePolicy": "• 请务必附上原视频链接和频道的 credit(至少在描述中)。\n• 请勿将完整视频或大部分内容作为自己的内容重新上传。\n• 未经明确同意,请勿对素材进行商业化。\n• 请勿以歪曲原内容或创作者的方式剪辑素材。\n• 合集、评测、解说、反应视频均可 — 只要标明出处。\n如有疑问,请通过描述中的社交账号或邮箱联系我。"
}
},
"hashtags": {
"gameplay": "#{{gameName}}",
"noCommentary": "#GameplayNoCommentary",
"genre": "#{{genre}}"
},
"playlist": {
"status": {
"completed": "✅ 已完成",
"dropped": "❌ 已放弃",
"incomplete": "🔄 未完成",
"in_progress": "▶️ 进行中"
},
"titleFormat": "{{status}} - {{gameName}}",
"videoCount": "📹 {{count}}个视频",
"storeSection": "🎮 获取游戏:",
"footer": "👍 点赞 | 🔔 订阅获取更多游戏实况!",
"description": {
"full_gameplay": "本播放列表包含{{channelName}}的{{gameName}}完整游戏实况。\n无解说 — 纯粹的游戏体验。",
"boss_fights": "本播放列表包含{{channelName}}的{{gameName}}全部Boss战。\n无解说。",
"speedrun": "本播放列表包含{{channelName}}的{{gameName}}速通。\n无解说。",
"all_endings": "本播放列表包含{{channelName}}的{{gameName}}全部结局。\n⚠️ 含有剧透。",
"dlc": "本播放列表包含{{channelName}}的{{gameName}} DLC游戏实况。\n无解说。",
"100_percent": "本播放列表包含{{channelName}}的{{gameName}} 100%完成实况。\n无解说。",
"guide": "本播放列表是{{channelName}}的{{gameName}}无声攻略。\n无解说。",
"highlights": "本播放列表包含{{channelName}}的{{gameName}}精彩集锦。\n无解说。"
}
},
"timeline": {
"keywords": {
"chapter": "第{{n}}章",
"part": "第{{n}}部分",
"boss": "Boss {{n}}",
"final_boss": "最终Boss",
"intro": "开场",
"ending": "结局",
"tutorial": "教程",
"credits": "片尾"
}
}
}
+116 -13
View File
@@ -9,9 +9,19 @@
"profiles": "配置",
"history": "历史",
"settings": "设置",
"batch": "批量"
"batch": "批量",
"playlist": "播放列表",
"logs": "日志"
},
"editor": {
"sections": {
"gameInfo": "游戏信息",
"videoSettings": "视频设置",
"contentDetails": "内容详情",
"attribution": "署名",
"rig": "我的配置",
"storeAndSocial": "商店与社交"
},
"videoType": "视频类型",
"language": "输出语言",
"genre": "游戏类型",
@@ -28,12 +38,15 @@
"dlcNamePlaceholder": "例如:Shadow of the Erdtree",
"challengeName": "挑战名称",
"challengeNamePlaceholder": "例如:无伤通关",
"modName": "Mod 名称",
"modNamePlaceholder": "如:Requiem, NaturalVision Evolved",
"resolution": "分辨率",
"fps": "帧率",
"graphicsPreset": "画质预设",
"timestamps": "时间戳",
"timestampsPlaceholder": "0:00 开场\n5:30 第一章\n15:00 Boss战",
"storeLinks": "商店链接",
"storeLinkType": "类型",
"rig": "我的配置",
"social": "社交与赞助链接",
"warnings": "警告",
@@ -43,11 +56,19 @@
"playlistLinkPlaceholder": "https://youtube.com/playlist?list=...",
"contactEmail": "联系邮箱",
"contactEmailPlaceholder": "business@example.com",
"musicAttribution": "音乐 / 音效署名",
"musicAttributionPlaceholder": "音乐:Karl Casey @ White Bat Audio\n音效:Freesound.org",
"thumbnailText": "缩略图文字",
"thumbnailTextPlaceholder": "如:隐藏Boss无伤",
"pinnedComment": "置顶评论模板",
"pinnedCommentPlaceholder": "置顶评论内容...",
"videoSettings": "视频设置",
"quickPreview": "快速预览",
"version": "版本",
"clearDraft": "清除草稿",
"draftSaved": "草稿已保存",
"clearDraftConfirm": "确定要清除所有表单数据吗?"
"clearDraftConfirm": "确定要清除所有表单数据吗?",
"contactEmailHelp": "最多3个邮箱,用逗号分隔"
},
"output": {
"title": "标题",
@@ -59,7 +80,18 @@
"copyAll": "复制全部",
"copied": "已复制!",
"charCount": "{{count}}/{{limit}}",
"selectLanguages": "选择语言"
"selectLanguages": "选择语言",
"thumbnailText": "缩略图文字",
"copyThumbnailText": "复制缩略图文字",
"pinnedComment": "置顶评论",
"copyPinnedComment": "复制置顶评论",
"generateAlternatives": "生成标题备选",
"saveAsTemplate": "保存为模板",
"variants": {
"default": "默认",
"typeFirst": "类型优先",
"qualityFirst": "画质优先"
}
},
"common": {
"save": "保存",
@@ -75,6 +107,8 @@
"videoTypes": {
"full": "完整游戏实况",
"part": "游戏实况分集",
"full_demo": "完整试玩",
"demo_part": "试玩分集",
"boss": "Boss战",
"boss_nohit": "Boss无伤",
"ending": "结局 / 全结局",
@@ -86,19 +120,35 @@
"side_quest": "支线任务",
"secret": "秘密 / 隐藏内容",
"comparison": "画质对比",
"guide": "无声攻略"
"guide": "无声攻略",
"mods": "Mod 游玩",
"collectibles": "全收集要素"
},
"genres": {
"action": "动作 / 冒险",
"hack_slash": "砍杀 (Hack & Slash)",
"beatemup": "清版动作",
"platformer": "平台跳跃",
"horror": "恐怖 / 生存",
"rpg": "RPG / JRPG",
"survival_horror": "生存恐怖",
"psychological_horror": "心理恐怖",
"rpg": "RPG",
"jrpg": "JRPG",
"action_rpg": "动作RPG",
"crpg": "CRPG / 等距视角",
"fps": "FPS / 射击",
"arena_shooter": "竞技场射击",
"tactical_fps": "战术FPS",
"boomer_shooter": "怀旧射击",
"extraction_shooter": "撤离射击",
"shmup": "弹幕射击",
"openworld": "开放世界 / 沙盒",
"indie": "独立 / 平台跳跃",
"indie": "独立游戏",
"soulslike": "魂系",
"racing": "竞速 / 体育",
"story": "剧情 / 视觉小说",
"story": "剧情 / 叙事",
"simulation": "模拟 / 策略",
"city_builder": "城市建造",
"fighting": "格斗",
"stealth": "潜行 / 谍战",
"survival_craft": "生存 / 建造",
@@ -109,11 +159,14 @@
"puzzle": "解谜",
"tower_defense": "塔防",
"card_game": "卡牌游戏",
"deck_builder": "卡组构筑",
"auto_battler": "自走棋",
"battle_royale": "大逃杀",
"crpg": "CRPG / 等距视角",
"tactical": "战术 / 回合制",
"space": "太空 / 科幻",
"farming": "农场 / 生活模拟"
"farming": "农场 / 生活模拟",
"fmv": "FMV / 互动电影",
"visual_novel": "视觉小说"
},
"rig": {
"cpu": "CPU",
@@ -123,7 +176,8 @@
"monitor": "显示器",
"capture": "录制软件",
"motherboard": "主板",
"controller": "手柄"
"controller": "手柄",
"video_editor": "视频编辑软件"
},
"social": {
"kofi": "Ko-fi",
@@ -137,7 +191,12 @@
"twitch": "Twitch",
"tiktok": "TikTok",
"instagram": "Instagram",
"streamlabs": "Streamlabs"
"streamlabs": "Streamlabs",
"bluesky": "Bluesky",
"mastodon": "Mastodon",
"facebook": "Facebook",
"fb_page": "Facebook主页",
"fb_group": "Facebook群组"
},
"resolutions": {
"720p": "720p",
@@ -163,6 +222,21 @@
"exportProfiles": "导出配置",
"importProfiles": "导入配置"
},
"templates": {
"title": "模板",
"createNew": "创建模板",
"saveAsTemplate": "保存为模板",
"templateName": "模板名称",
"templateNamePlaceholder": "如:艾尔登法环 Boss 战",
"loadTemplate": "应用",
"deleteConfirm": "确定要删除此模板吗?",
"emptyState": "还没有模板。保存当前表单以便复用。",
"saveHint": "保存编辑器中的所有字段,以便之后恢复到完全相同的状态。",
"savedAs": "已保存为 '{{name}}'",
"appliedToast": "已应用 '{{name}}'",
"exportTemplates": "导出模板",
"importTemplates": "导入模板"
},
"presets": {
"title": "游戏预设",
"createNew": "创建预设",
@@ -190,7 +264,7 @@
"tagSettings": "标签设置",
"historySettings": "历史记录设置",
"theme": "主题",
"defaultUILanguage": "默认界面语言",
"appLanguage": "应用语言",
"defaultOutputLanguage": "默认输出语言",
"defaultGenre": "默认类型",
"autoSaveDraft": "自动保存草稿",
@@ -199,7 +273,10 @@
"historyLimit": "历史记录上限",
"multilingualTags": "多语言标签",
"trendingTags": "热门标签",
"hashtagCount": "话题标签数量"
"hashtagCount": "话题标签数量",
"showQualityBadge": "在标题中显示画质标签 (如:[2K 60FPS])",
"showCopyright": "在描述中添加 © 版权行",
"showUsagePolicy": "在描述中添加视频使用规则块"
},
"batch": {
"title": "批量生成",
@@ -216,5 +293,31 @@
"saveDraft": "保存草稿",
"help": "帮助",
"close": "关闭"
},
"validation": {
"emailInvalid": "无效邮箱: {{email}}",
"emailMaxExceeded": "最多允许{{max}}个邮箱 (当前{{count}}个)",
"urlInvalid": "无效URL。必须以https://开头",
"urlPrefixMismatch": "URL应以{{expected}}开头"
},
"storeLinkTypes": {
"paid": "付费",
"free": "免费",
"demo": "免费试玩"
},
"playlist": {
"title": "播放列表生成器",
"status": "状态",
"contentType": "内容类型",
"totalVideos": "视频总数",
"customNote": "自定义备注",
"generatePlaylist": "生成播放列表"
},
"logs": {
"title": "日志",
"emptyState": "暂无日志。",
"clearAll": "清除全部",
"clearConfirm": "确定要清除所有日志吗?",
"searchPlaceholder": "搜索日志..."
}
}
+133 -48
View File
@@ -7,56 +7,102 @@ import { CopyButton } from "@components/output/CopyButton";
import { CharCounter } from "@components/output/CharCounter";
import { useEditorStore } from "@store/editor-store";
import { useSettingsStore } from "@store/settings-store";
import { SUPPORTED_LANGUAGES } from "@i18n/index";
import { renderAll } from "@engine/template-renderer";
import { YT_LIMITS } from "@engine/types";
import type { GeneratorInput, GeneratorOutput } from "@engine/types";
import type { GeneratorInput, GeneratorOutput, SupportedLanguage } from "@engine/types";
import clsx from "clsx";
interface BatchResult {
partNumber: string;
languages: { language: SupportedLanguage; output: GeneratorOutput }[];
}
export function BatchPage() {
const { t } = useTranslation("ui");
const state = useEditorStore();
const { includeMultilingualTags, includeTrendingTags, hashtagCount } = useSettingsStore();
const {
includeMultilingualTags,
includeTrendingTags,
hashtagCount,
showQualityBadge,
showCopyright,
showUsagePolicy,
} = useSettingsStore();
const [startPart, setStartPart] = useState("1");
const [endPart, setEndPart] = useState("5");
const [results, setResults] = useState<GeneratorOutput[]>([]);
const [selectedLangs, setSelectedLangs] = useState<SupportedLanguage[]>([state.language]);
const [results, setResults] = useState<BatchResult[]>([]);
const toggleLang = (lang: SupportedLanguage) => {
setSelectedLangs((prev) => {
if (prev.includes(lang)) {
return prev.length <= 1 ? prev : prev.filter((l) => l !== lang);
}
return [...prev, lang];
});
};
const handleGenerate = () => {
const start = parseInt(startPart) || 1;
const end = parseInt(endPart) || start;
const tFn = i18n.getFixedT(state.language, "templates");
const outputs: GeneratorOutput[] = [];
const outputs: BatchResult[] = [];
for (let i = start; i <= Math.min(end, start + 99); i++) {
const input: GeneratorInput = {
videoType: "part",
language: state.language,
genre: state.genre,
gameName: state.gameName,
gameNameLocalized: state.gameNameLocalized,
channelName: state.channelName,
platform: state.platform,
partNumber: String(i),
bossName: state.bossName,
dlcName: state.dlcName,
challengeName: state.challengeName,
resolution: state.resolution,
fps: state.fps,
graphicsPreset: state.graphicsPreset,
timestamps: "",
playlistLink: state.playlistLink,
contactEmail: state.contactEmail,
spoilerWarning: state.spoilerWarning,
matureWarning: state.matureWarning,
storeLinks: state.storeLinks,
social: state.social,
rig: state.rig,
};
outputs.push(renderAll(input, tFn, { includeMultilingualTags, includeTrendingTags, hashtagCount }));
const languages = selectedLangs.map((lang) => {
const tFn = i18n.getFixedT(lang, "templates");
const input: GeneratorInput = {
videoType: "part",
language: lang,
genres: state.genres,
gameName: state.gameName,
gameNameLocalized: state.gameNameLocalized,
channelName: state.channelName,
platform: state.platform,
partNumber: String(i),
bossName: state.bossName,
dlcName: state.dlcName,
challengeName: state.challengeName,
resolution: state.resolution,
fps: state.fps,
graphicsPreset: state.graphicsPreset,
timestamps: "",
playlistLink: state.playlistLink,
contactEmail: state.contactEmail,
musicAttribution: state.musicAttribution,
spoilerWarning: state.spoilerWarning,
matureWarning: state.matureWarning,
storeLinks: state.storeLinks,
storeLinkTypes: state.storeLinkTypes,
social: state.social,
rig: state.rig,
};
return {
language: lang,
output: renderAll(input, tFn, {
includeMultilingualTags,
includeTrendingTags,
hashtagCount,
showQualityBadge,
showCopyright,
showUsagePolicy,
}),
};
});
outputs.push({ partNumber: String(i), languages });
}
setResults(outputs);
};
const allCombined = useMemo(
() => results.map((r) => `${r.title}\n\n${r.description}`).join("\n\n---\n\n"),
() =>
results
.map((r) =>
r.languages
.map((l) => `[${l.language.toUpperCase()}]\n${l.output.title}\n\n${l.output.description}`)
.join("\n\n---\n\n"),
)
.join("\n\n===\n\n"),
[results],
);
@@ -64,6 +110,29 @@ export function BatchPage() {
<div className="mx-auto max-w-4xl p-6">
<h1 className="mb-4 text-lg font-bold text-text-primary">{t("batch.title")}</h1>
{/* Language selector */}
<div className="mb-4">
<span className="mb-2 block text-sm font-medium text-text-secondary">
{t("output.selectLanguages")}
</span>
<div className="flex flex-wrap gap-2">
{SUPPORTED_LANGUAGES.map((lang) => (
<button
key={lang.id}
onClick={() => toggleLang(lang.id as SupportedLanguage)}
className={clsx(
"rounded-lg px-3 py-1.5 text-sm font-medium transition-colors",
selectedLangs.includes(lang.id as SupportedLanguage)
? "bg-accent text-white"
: "bg-surface-2 text-text-muted hover:text-text-primary",
)}
>
{lang.flag} {lang.nativeName}
</button>
))}
</div>
</div>
<div className="mb-6 flex items-end gap-4">
<Input
label={t("batch.startPart")}
@@ -89,25 +158,41 @@ export function BatchPage() {
) : (
<>
<div className="mb-4 flex items-center justify-between">
<span className="text-sm text-text-secondary">{results.length} results</span>
<span className="text-sm text-text-secondary">
{results.length} parts x {selectedLangs.length} languages
</span>
<CopyButton text={allCombined} label={t("batch.copyAllBatch")} />
</div>
<div className="flex flex-col gap-3">
{results.map((result, i) => (
<div key={i} className="rounded-lg border border-border bg-surface-1 p-4">
<div className="mb-2 flex items-center justify-between">
<h3 className="text-sm font-medium text-text-primary">{result.title}</h3>
<div className="flex items-center gap-2">
<CharCounter text={result.title} limit={YT_LIMITS.TITLE_MAX} />
<CopyButton text={result.title} label={t("output.copyTitle")} />
</div>
</div>
<pre className="mb-2 max-h-24 overflow-y-auto whitespace-pre-wrap rounded bg-surface-2 p-2 font-sans text-xs text-text-secondary">
{result.description.slice(0, 300)}...
</pre>
<div className="flex gap-2">
<CopyButton text={result.description} label={t("output.copyDescription")} />
<CopyButton text={result.tagString} label={t("output.copyTags")} />
<div className="flex flex-col gap-4">
{results.map((result) => (
<div key={result.partNumber} className="rounded-lg border border-border bg-surface-1 p-4">
<h3 className="mb-3 text-sm font-semibold text-text-primary">
Part {result.partNumber}
</h3>
<div className="flex flex-col gap-3">
{result.languages.map((lang) => (
<div key={lang.language} className="rounded-lg bg-surface-2 p-3">
<div className="mb-1 flex items-center justify-between">
<span className="text-xs font-medium uppercase text-text-muted">
{lang.language.toUpperCase()}
</span>
<div className="flex items-center gap-2">
<CharCounter text={lang.output.title} limit={YT_LIMITS.TITLE_MAX} />
<CopyButton text={lang.output.title} label={t("output.copyTitle")} />
</div>
</div>
<p className="mb-2 text-sm font-medium text-text-primary">
{lang.output.title}
</p>
<pre className="mb-2 max-h-20 overflow-y-auto whitespace-pre-wrap font-sans text-xs text-text-secondary">
{lang.output.description.slice(0, 200)}...
</pre>
<div className="flex gap-2">
<CopyButton text={lang.output.description} label={t("output.copyDescription")} />
<CopyButton text={lang.output.tagString} label={t("output.copyTags")} />
</div>
</div>
))}
</div>
</div>
))}
+94 -27
View File
@@ -2,32 +2,43 @@ import { VideoTypeSelector } from "@components/editor/VideoTypeSelector";
import { LanguageSelector } from "@components/editor/LanguageSelector";
import { GenreSelector } from "@components/editor/GenreSelector";
import { GameInfoForm } from "@components/editor/GameInfoForm";
import { ExtraFieldsInput } from "@components/editor/ExtraFieldsInput";
import { VideoSettingsForm } from "@components/editor/VideoSettingsForm";
import { TimestampEditor } from "@components/editor/TimestampEditor";
import { StoreLinkEditor } from "@components/editor/StoreLinkEditor";
import { RigEditor } from "@components/editor/RigEditor";
import { SocialEditor } from "@components/editor/SocialEditor";
import { WarningToggles } from "@components/editor/WarningToggles";
import { ThumbnailHelper } from "@components/editor/ThumbnailHelper";
import { PinnedCommentEditor } from "@components/editor/PinnedCommentEditor";
import { MusicAttributionEditor } from "@components/editor/MusicAttributionEditor";
import { QuickPreview } from "@components/editor/QuickPreview";
import { DraftIndicator } from "@components/editor/DraftIndicator";
import { PresetSelector } from "@components/presets/PresetSelector";
import { Input } from "@components/ui/Input";
import { ValidatedInput } from "@components/ui/ValidatedInput";
import { Button } from "@components/ui/Button";
import { ConfirmDialog } from "@components/ui/ConfirmDialog";
import { Accordion } from "@components/ui/Accordion";
import { useEditorStore } from "@store/editor-store";
import { useSettingsStore } from "@store/settings-store";
import { useTranslation } from "react-i18next";
import { validateEmails, validateUrl } from "@utils/validation";
import { RotateCcw } from "lucide-react";
import { useState } from "react";
export function EditorPage() {
const { t } = useTranslation("ui");
const store = useEditorStore();
const accordion = useSettingsStore((s) => s.editorAccordionState);
const toggleAccordion = useSettingsStore((s) => s.toggleEditorAccordion);
const [showClearDraft, setShowClearDraft] = useState(false);
const isOpen = (id: string): boolean => accordion[id] ?? false;
return (
<div className="mx-auto flex max-w-6xl flex-col gap-6 p-6 lg:flex-row">
{/* Form */}
<div className="flex flex-1 flex-col gap-6">
<div className="flex flex-1 flex-col gap-4">
<div className="flex items-center justify-between">
<DraftIndicator />
<Button variant="ghost" size="sm" onClick={() => setShowClearDraft(true)}>
@@ -46,34 +57,90 @@ export function EditorPage() {
message={t("editor.clearDraftConfirm")}
variant="danger"
/>
<VideoTypeSelector />
<div className="grid grid-cols-2 gap-4">
<Accordion
id="gameInfo"
title={t("editor.sections.gameInfo")}
icon="🎮"
open={isOpen("gameInfo")}
onToggle={() => toggleAccordion("gameInfo")}
>
<LanguageSelector />
<div />
</div>
<GenreSelector />
<PresetSelector />
<GameInfoForm />
<VideoSettingsForm />
<TimestampEditor />
<GenreSelector />
<PresetSelector />
<GameInfoForm />
</Accordion>
<Input
label={t("editor.playlistLink")}
placeholder={t("editor.playlistLinkPlaceholder")}
value={store.playlistLink ?? ""}
onChange={(e) => store.set("playlistLink", e.target.value)}
/>
<Input
label={t("editor.contactEmail")}
placeholder={t("editor.contactEmailPlaceholder")}
value={store.contactEmail ?? ""}
onChange={(e) => store.set("contactEmail", e.target.value)}
/>
<Accordion
id="videoSettings"
title={t("editor.sections.videoSettings")}
icon="🎬"
open={isOpen("videoSettings")}
onToggle={() => toggleAccordion("videoSettings")}
>
<VideoTypeSelector />
<ExtraFieldsInput />
<VideoSettingsForm />
</Accordion>
<WarningToggles />
<StoreLinkEditor />
<RigEditor />
<SocialEditor />
<Accordion
id="contentDetails"
title={t("editor.sections.contentDetails")}
icon="⏱"
open={isOpen("contentDetails")}
onToggle={() => toggleAccordion("contentDetails")}
>
<TimestampEditor />
<WarningToggles />
<ValidatedInput
label={t("editor.playlistLink")}
placeholder={t("editor.playlistLinkPlaceholder")}
value={store.playlistLink ?? ""}
onChange={(v) => store.set("playlistLink", v)}
validate={validateUrl}
/>
<ValidatedInput
label={t("editor.contactEmail")}
placeholder={t("editor.contactEmailPlaceholder")}
value={store.contactEmail ?? ""}
onChange={(v) => store.set("contactEmail", v)}
validate={validateEmails}
helpText={t("editor.contactEmailHelp")}
/>
</Accordion>
<Accordion
id="attribution"
title={t("editor.sections.attribution")}
icon="🎵"
open={isOpen("attribution")}
onToggle={() => toggleAccordion("attribution")}
>
<MusicAttributionEditor />
<ThumbnailHelper />
<PinnedCommentEditor />
</Accordion>
<Accordion
id="rig"
title={t("editor.sections.rig")}
icon="💻"
open={isOpen("rig")}
onToggle={() => toggleAccordion("rig")}
>
<RigEditor />
</Accordion>
<Accordion
id="storeAndSocial"
title={t("editor.sections.storeAndSocial")}
icon="🔗"
open={isOpen("storeAndSocial")}
onToggle={() => toggleAccordion("storeAndSocial")}
>
<StoreLinkEditor />
<SocialEditor />
</Accordion>
</div>
{/* Sidebar: Quick Preview */}
+137
View File
@@ -0,0 +1,137 @@
import { useState, useRef, useEffect } from "react";
import { useTranslation } from "react-i18next";
import { Trash2 } from "lucide-react";
import { Input } from "@components/ui/Input";
import { Button } from "@components/ui/Button";
import { ConfirmDialog } from "@components/ui/ConfirmDialog";
import { LogEntryCard } from "@components/logs/LogEntry";
import { useLogStore, type LogLevel } from "@store/log-store";
import clsx from "clsx";
const LEVEL_FILTERS: Array<{ value: LogLevel | "all"; label: string; color: string }> = [
{ value: "all", label: "All", color: "" },
{ value: "error", label: "Error", color: "text-red-400" },
{ value: "warn", label: "Warn", color: "text-yellow-400" },
{ value: "info", label: "Info", color: "text-blue-400" },
{ value: "debug", label: "Debug", color: "text-gray-400" },
];
export function LogPage() {
const { t } = useTranslation("ui");
const { entries, clearAll } = useLogStore();
const [search, setSearch] = useState("");
const [levelFilter, setLevelFilter] = useState<LogLevel | "all">("all");
const [showClearAll, setShowClearAll] = useState(false);
const [autoScroll, setAutoScroll] = useState(true);
const listRef = useRef<HTMLDivElement>(null);
const filtered = entries.filter((e) => {
if (levelFilter !== "all" && e.level !== levelFilter) return false;
if (search) {
const q = search.toLowerCase();
return (
e.message.toLowerCase().includes(q) ||
e.source.toLowerCase().includes(q) ||
(e.details?.toLowerCase().includes(q) ?? false)
);
}
return true;
});
const errorCount = entries.filter((e) => e.level === "error").length;
const warnCount = entries.filter((e) => e.level === "warn").length;
useEffect(() => {
if (autoScroll && listRef.current) {
listRef.current.scrollTop = 0;
}
}, [entries.length, autoScroll]);
return (
<div className="mx-auto max-w-4xl p-6">
<div className="mb-4 flex items-center justify-between">
<div className="flex items-center gap-3">
<h1 className="text-lg font-bold text-text-primary">{t("logs.title")}</h1>
<span className="text-xs text-text-muted">
{entries.length} entries
{errorCount > 0 && (
<span className="ml-1 text-red-400">({errorCount} errors)</span>
)}
{warnCount > 0 && (
<span className="ml-1 text-yellow-400">({warnCount} warnings)</span>
)}
</span>
</div>
<div className="flex items-center gap-2">
<label className="flex items-center gap-1.5 text-xs text-text-muted">
<input
type="checkbox"
checked={autoScroll}
onChange={(e) => setAutoScroll(e.target.checked)}
className="rounded"
/>
Auto-scroll
</label>
{entries.length > 0 && (
<Button variant="ghost" size="sm" onClick={() => setShowClearAll(true)}>
<Trash2 className="h-3.5 w-3.5" />
{t("logs.clearAll")}
</Button>
)}
</div>
</div>
{/* Filters */}
<div className="mb-4 flex flex-col gap-3 sm:flex-row sm:items-center">
<div className="flex gap-1 rounded-lg bg-surface-1 p-1">
{LEVEL_FILTERS.map((f) => (
<button
key={f.value}
onClick={() => setLevelFilter(f.value)}
className={clsx(
"rounded-md px-3 py-1 text-xs font-medium transition-colors",
levelFilter === f.value
? "bg-accent text-white"
: clsx("text-text-muted hover:text-text-primary", f.color),
)}
>
{f.label}
</button>
))}
</div>
<div className="flex-1">
<Input
placeholder={t("logs.searchPlaceholder")}
value={search}
onChange={(e) => setSearch(e.target.value)}
/>
</div>
</div>
{/* Log entries */}
{filtered.length === 0 ? (
<p className="rounded-lg border border-dashed border-border py-12 text-center text-sm text-text-muted">
{t("logs.emptyState")}
</p>
) : (
<div ref={listRef} className="flex max-h-[65vh] flex-col gap-1.5 overflow-y-auto">
{filtered.map((entry) => (
<LogEntryCard key={entry.id} entry={entry} />
))}
</div>
)}
<ConfirmDialog
open={showClearAll}
onConfirm={() => {
clearAll();
setShowClearAll(false);
}}
onCancel={() => setShowClearAll(false)}
title={t("logs.clearAll")}
message={t("logs.clearConfirm")}
variant="danger"
/>
</div>
);
}
+46 -21
View File
@@ -1,7 +1,12 @@
import { useEffect, useRef, useState, useMemo } from "react";
import { useTranslation } from "react-i18next";
import { Shuffle, Bookmark } from "lucide-react";
import { Button } from "@components/ui/Button";
import { OutputPreview } from "@components/output/OutputPreview";
import { OutputExtras } from "@components/output/OutputExtras";
import { CopyAllBar } from "@components/output/CopyAllBar";
import { VariantPicker } from "@components/output/VariantPicker";
import { TemplateSaveForm } from "@components/templates/TemplateSaveForm";
import { useGeneratedOutput } from "@hooks/use-generated-output";
import { useMultilangOutput } from "@hooks/use-multilang-output";
import { useEditorStore } from "@store/editor-store";
@@ -14,13 +19,15 @@ import clsx from "clsx";
export function OutputPage() {
const { t } = useTranslation("ui");
const defaultOutput = useGeneratedOutput();
const { gameName, videoType, language, genre } = useEditorStore();
const { gameName, videoType, language, genres } = useEditorStore();
const addEntry = useHistoryStore((s) => s.addEntry);
const historyLimit = useSettingsStore((s) => s.historyLimit);
const savedRef = useRef<string>("");
const [selectedLangs, setSelectedLangs] = useState<SupportedLanguage[]>([language]);
const [activeTab, setActiveTab] = useState<SupportedLanguage>(language);
const [showVariants, setShowVariants] = useState(false);
const [showSaveTemplate, setShowSaveTemplate] = useState(false);
const isMultiLang = selectedLangs.length > 1;
const multilangOutputs = useMultilangOutput(isMultiLang ? selectedLangs : []);
@@ -49,14 +56,14 @@ export function OutputPage() {
gameName,
videoType,
language,
genre,
genres,
title: defaultOutput.title,
description: defaultOutput.description,
tags: defaultOutput.tagString,
},
historyLimit,
);
}, [gameName, videoType, language, genre, defaultOutput.title, defaultOutput.description, defaultOutput.tagString, addEntry, historyLimit]);
}, [gameName, videoType, language, genres, defaultOutput.title, defaultOutput.description, defaultOutput.tagString, addEntry, historyLimit]);
const allLangsCombined = useMemo(() => {
if (!isMultiLang) return "";
@@ -72,25 +79,37 @@ export function OutputPage() {
return (
<div className="flex flex-1 flex-col">
<div className="mx-auto w-full max-w-4xl flex-1 p-6">
<div className="mb-4">
<span className="mb-2 block text-sm font-medium text-text-secondary">
{t("output.selectLanguages")}
</span>
<div className="mb-4 flex flex-wrap items-start justify-between gap-3">
<div className="flex-1">
<span className="mb-2 block text-sm font-medium text-text-secondary">
{t("output.selectLanguages")}
</span>
<div className="flex flex-wrap gap-2">
{SUPPORTED_LANGUAGES.map((lang) => (
<button
key={lang.id}
onClick={() => toggleLang(lang.id as SupportedLanguage)}
className={clsx(
"rounded-lg px-3 py-1.5 text-sm font-medium transition-colors",
selectedLangs.includes(lang.id as SupportedLanguage)
? "bg-accent text-white"
: "bg-surface-2 text-text-muted hover:text-text-primary",
)}
>
{lang.flag} {lang.nativeName}
</button>
))}
</div>
</div>
<div className="flex flex-wrap gap-2">
{SUPPORTED_LANGUAGES.map((lang) => (
<button
key={lang.id}
onClick={() => toggleLang(lang.id as SupportedLanguage)}
className={clsx(
"rounded-lg px-3 py-1.5 text-sm font-medium transition-colors",
selectedLangs.includes(lang.id as SupportedLanguage)
? "bg-accent text-white"
: "bg-surface-2 text-text-muted hover:text-text-primary",
)}
>
{lang.flag} {lang.nativeName}
</button>
))}
<Button variant="ghost" size="sm" onClick={() => setShowVariants(true)} disabled={!gameName}>
<Shuffle className="h-3.5 w-3.5" />
{t("output.generateAlternatives")}
</Button>
<Button variant="ghost" size="sm" onClick={() => setShowSaveTemplate(true)} disabled={!gameName}>
<Bookmark className="h-3.5 w-3.5" />
{t("output.saveAsTemplate")}
</Button>
</div>
</div>
@@ -114,8 +133,14 @@ export function OutputPage() {
)}
{currentOutput && <OutputPreview output={isMultiLang ? currentOutput : undefined} />}
<div className="mt-6">
<OutputExtras />
</div>
</div>
<CopyAllBar extraText={isMultiLang ? allLangsCombined : undefined} />
<VariantPicker open={showVariants} onClose={() => setShowVariants(false)} />
<TemplateSaveForm open={showSaveTemplate} onClose={() => setShowSaveTemplate(false)} />
</div>
);
}
+155
View File
@@ -0,0 +1,155 @@
import { useState, useMemo } from "react";
import { useTranslation } from "react-i18next";
import i18n from "i18next";
import { Input } from "@components/ui/Input";
import { Textarea } from "@components/ui/Textarea";
import { Button } from "@components/ui/Button";
import { ChipGroup } from "@components/ui/ChipGroup";
import { Select } from "@components/ui/Select";
import { CopyButton } from "@components/output/CopyButton";
import { useEditorStore } from "@store/editor-store";
import { SUPPORTED_LANGUAGES } from "@i18n/index";
import {
buildPlaylistTitle,
buildPlaylistDescription,
type PlaylistStatus,
type PlaylistContentType,
type PlaylistInput,
} from "@engine/playlist-builder";
import type { SupportedLanguage } from "@engine/types";
const STATUS_OPTIONS = [
{ id: "completed", label: "✅ Completed", icon: "" },
{ id: "dropped", label: "❌ Dropped", icon: "" },
{ id: "incomplete", label: "🔄 Incomplete", icon: "" },
{ id: "in_progress", label: "▶️ In Progress", icon: "" },
] as const;
const CONTENT_TYPE_OPTIONS = [
{ id: "full_gameplay", label: "Full Gameplay", icon: "🎮" },
{ id: "boss_fights", label: "Boss Fights", icon: "👹" },
{ id: "speedrun", label: "Speedrun", icon: "⚡" },
{ id: "all_endings", label: "All Endings", icon: "🏁" },
{ id: "dlc", label: "DLC", icon: "📦" },
{ id: "100_percent", label: "100%", icon: "💯" },
{ id: "guide", label: "Guide", icon: "📘" },
{ id: "highlights", label: "Highlights", icon: "⭐" },
] as const;
export function PlaylistPage() {
const { t } = useTranslation("ui");
const editor = useEditorStore();
const [status, setStatus] = useState<PlaylistStatus>("completed");
const [contentType, setContentType] = useState<PlaylistContentType>("full_gameplay");
const [totalVideos, setTotalVideos] = useState("");
const [customNote, setCustomNote] = useState("");
const [language, setLanguage] = useState<SupportedLanguage>(editor.language);
const langOptions = SUPPORTED_LANGUAGES.map((l) => ({
value: l.id,
label: `${l.flag} ${l.nativeName}`,
}));
const playlistInput: PlaylistInput = useMemo(
() => ({
gameName: editor.gameName,
channelName: editor.channelName,
status,
contentType,
totalVideos: totalVideos ? parseInt(totalVideos) : undefined,
storeLinks: editor.storeLinks,
playlistNote: customNote,
}),
[editor.gameName, editor.channelName, status, contentType, totalVideos, editor.storeLinks, customNote],
);
const output = useMemo(() => {
const tFn = i18n.getFixedT(language, "templates");
return {
title: buildPlaylistTitle(playlistInput, tFn),
description: buildPlaylistDescription(playlistInput, tFn),
};
}, [playlistInput, language]);
return (
<div className="mx-auto flex max-w-5xl flex-col gap-6 p-6 lg:flex-row">
{/* Form */}
<div className="flex flex-1 flex-col gap-5">
<h1 className="text-lg font-bold text-text-primary">{t("playlist.title")}</h1>
<Select
label={t("editor.language")}
options={langOptions}
value={language}
onChange={(v) => setLanguage(v as SupportedLanguage)}
/>
<ChipGroup
label={t("playlist.status")}
options={STATUS_OPTIONS}
value={status}
onChange={(v) => setStatus(v as PlaylistStatus)}
/>
<ChipGroup
label={t("playlist.contentType")}
options={CONTENT_TYPE_OPTIONS}
value={contentType}
onChange={(v) => setContentType(v as PlaylistContentType)}
/>
<Input
label={t("playlist.totalVideos")}
type="number"
placeholder="e.g. 25"
value={totalVideos}
onChange={(e) => setTotalVideos(e.target.value)}
/>
<Textarea
label={t("playlist.customNote")}
placeholder="Optional note..."
value={customNote}
onChange={(e) => setCustomNote(e.target.value)}
rows={3}
/>
</div>
{/* Output */}
<div className="w-full shrink-0 lg:w-96">
<div className="sticky top-6 flex flex-col gap-4 rounded-lg border border-border bg-surface-1 p-4">
<div>
<div className="mb-1 flex items-center justify-between">
<span className="text-xs font-medium uppercase text-text-muted">
{t("output.title")}
</span>
<CopyButton text={output.title} label={t("output.copyTitle")} />
</div>
<p className="text-sm font-medium text-text-primary">{output.title || "..."}</p>
</div>
<div>
<div className="mb-1 flex items-center justify-between">
<span className="text-xs font-medium uppercase text-text-muted">
{t("output.description")}
</span>
<CopyButton text={output.description} label={t("output.copyDescription")} />
</div>
<pre className="max-h-64 overflow-y-auto whitespace-pre-wrap rounded bg-surface-2 p-2 font-sans text-xs text-text-secondary">
{output.description || "..."}
</pre>
</div>
<Button
onClick={() => {
navigator.clipboard.writeText(`${output.title}\n\n${output.description}`);
}}
>
{t("output.copyAll")}
</Button>
</div>
</div>
</div>
);
}
+39 -5
View File
@@ -4,19 +4,22 @@ import { Download, Upload } from "lucide-react";
import { Button } from "@components/ui/Button";
import { ProfileList } from "@components/profiles/ProfileList";
import { PresetList } from "@components/presets/PresetList";
import { TemplateList } from "@components/templates/TemplateList";
import { useProfileStore, type Profile } from "@store/profile-store";
import { usePresetStore, type GamePreset } from "@store/preset-store";
import { useTemplateStore, type EditorTemplate } from "@store/template-store";
import { exportToJsonFile, importFromJsonFile } from "@utils/import-export";
import toast from "react-hot-toast";
import clsx from "clsx";
type Tab = "profiles" | "presets";
type Tab = "profiles" | "presets" | "templates";
export function ProfilesPage() {
const { t } = useTranslation("ui");
const [tab, setTab] = useState<Tab>("profiles");
const { profiles, importProfiles } = useProfileStore();
const { presets, importPresets } = usePresetStore();
const { templates, importTemplates } = useTemplateStore();
const handleExportProfiles = () => {
exportToJsonFile(profiles, "ytdescgen-profiles.json");
@@ -50,11 +53,27 @@ export function ProfilesPage() {
}
};
const handleExportTemplates = () => {
exportToJsonFile(templates, "ytdescgen-templates.json");
toast.success("Exported!");
};
const handleImportTemplates = async () => {
try {
const data = await importFromJsonFile<EditorTemplate[]>();
if (!Array.isArray(data)) throw new Error("Invalid format");
importTemplates(data);
toast.success("Imported!");
} catch {
toast.error("Import failed");
}
};
return (
<div className="mx-auto max-w-3xl p-6">
<div className="mb-6 flex items-center justify-between">
<div className="flex gap-1 rounded-lg bg-surface-1 p-1">
{(["profiles", "presets"] as const).map((t2) => (
{(["profiles", "presets", "templates"] as const).map((t2) => (
<button
key={t2}
onClick={() => setTab(t2)}
@@ -70,7 +89,7 @@ export function ProfilesPage() {
))}
</div>
<div className="flex gap-2">
{tab === "profiles" ? (
{tab === "profiles" && (
<>
<Button variant="ghost" size="sm" onClick={handleExportProfiles}>
<Download className="h-3.5 w-3.5" />
@@ -81,7 +100,8 @@ export function ProfilesPage() {
{t("profiles.importProfiles")}
</Button>
</>
) : (
)}
{tab === "presets" && (
<>
<Button variant="ghost" size="sm" onClick={handleExportPresets}>
<Download className="h-3.5 w-3.5" />
@@ -93,10 +113,24 @@ export function ProfilesPage() {
</Button>
</>
)}
{tab === "templates" && (
<>
<Button variant="ghost" size="sm" onClick={handleExportTemplates}>
<Download className="h-3.5 w-3.5" />
{t("templates.exportTemplates")}
</Button>
<Button variant="ghost" size="sm" onClick={handleImportTemplates}>
<Upload className="h-3.5 w-3.5" />
{t("templates.importTemplates")}
</Button>
</>
)}
</div>
</div>
{tab === "profiles" ? <ProfileList /> : <PresetList />}
{tab === "profiles" && <ProfileList />}
{tab === "presets" && <PresetList />}
{tab === "templates" && <TemplateList />}
</div>
);
}
+85 -17
View File
@@ -1,13 +1,51 @@
import { useTranslation } from "react-i18next";
import { FolderOpen, Save } from "lucide-react";
import { Toggle } from "@components/ui/Toggle";
import { Select } from "@components/ui/Select";
import { Input } from "@components/ui/Input";
import { Button } from "@components/ui/Button";
import { ChipGroup } from "@components/ui/ChipGroup";
import { SUPPORTED_LANGUAGES } from "@i18n/index";
import { GENRES } from "@config/genres";
import { GENRES, type GenreId } from "@config/genres";
import { useSettingsStore } from "@store/settings-store";
import { IS_TAURI } from "@utils/platform";
import { MAX_GENRES, type SupportedLanguage } from "@engine/types";
import toast from "react-hot-toast";
import { logger } from "@utils/logger";
async function openSettingsFolder() {
try {
const { appDataDir } = await import("@tauri-apps/api/path");
const { openPath } = await import("@tauri-apps/plugin-opener");
const dir = await appDataDir();
await openPath(dir);
} catch (e) {
toast.error("Could not open settings folder");
logger.error("settings", "Failed to open settings folder", String(e));
}
}
async function exportSettingsToFile() {
try {
const { save } = await import("@tauri-apps/plugin-dialog");
const { invoke } = await import("@tauri-apps/api/core");
const { appDataDir } = await import("@tauri-apps/api/path");
const dir = await appDataDir();
const srcPath = `${dir}settings.json`;
const content: string = await invoke("read_from_file", { path: srcPath });
const destPath = await save({ defaultPath: "ytdescgen-settings.json" });
if (destPath) {
await invoke("save_to_file", { path: destPath, content });
toast.success("Settings exported!");
}
} catch (e) {
toast.error("Export failed");
logger.error("settings", "Failed to export settings", String(e));
}
}
export function SettingsPage() {
const { t } = useTranslation("ui");
const { t, i18n } = useTranslation("ui");
const settings = useSettingsStore();
const langOptions = SUPPORTED_LANGUAGES.map((l) => ({
@@ -16,8 +54,9 @@ export function SettingsPage() {
}));
const genreOptions = GENRES.map((g) => ({
value: g.id,
label: `${g.icon} ${t(g.labelKey)}`,
id: g.id,
label: t(g.labelKey),
icon: g.icon,
}));
const hashtagOptions = [
@@ -28,10 +67,23 @@ export function SettingsPage() {
return (
<div className="mx-auto max-w-2xl p-6">
<h1 className="mb-6 text-lg font-bold text-text-primary">{t("settings.title")}</h1>
<div className="mb-6 flex items-center justify-between">
<h1 className="text-lg font-bold text-text-primary">{t("settings.title")}</h1>
{IS_TAURI && (
<div className="flex gap-2">
<Button variant="ghost" size="sm" onClick={openSettingsFolder}>
<FolderOpen className="h-3.5 w-3.5" />
Open Folder
</Button>
<Button variant="ghost" size="sm" onClick={exportSettingsToFile}>
<Save className="h-3.5 w-3.5" />
Export
</Button>
</div>
)}
</div>
<div className="flex flex-col gap-8">
{/* Appearance */}
<section className="flex flex-col gap-3">
<h2 className="text-sm font-semibold text-text-secondary">{t("settings.appearance")}</h2>
<Toggle
@@ -41,30 +93,33 @@ export function SettingsPage() {
/>
</section>
{/* Defaults */}
<section className="flex flex-col gap-3">
<h2 className="text-sm font-semibold text-text-secondary">{t("settings.defaults")}</h2>
<Select
label={t("settings.defaultUILanguage")}
label={t("settings.appLanguage")}
options={langOptions}
value={settings.defaultLanguage}
onChange={(v) => settings.setDefaultLanguage(v)}
value={settings.appLanguage}
onChange={(v) => {
settings.setAppLanguage(v as SupportedLanguage);
i18n.changeLanguage(v);
}}
/>
<Select
label={t("settings.defaultOutputLanguage")}
options={langOptions}
value={settings.defaultOutputLanguage}
onChange={(v) => settings.setDefaultOutputLanguage(v as typeof settings.defaultOutputLanguage)}
onChange={(v) => settings.setDefaultOutputLanguage(v as SupportedLanguage)}
/>
<Select
<ChipGroup
label={t("settings.defaultGenre")}
multiple
max={MAX_GENRES}
options={genreOptions}
value={settings.defaultGenre}
onChange={(v) => settings.setDefaultGenre(v as typeof settings.defaultGenre)}
value={settings.defaultGenres}
onChange={(next) => settings.setDefaultGenres(next as GenreId[])}
/>
</section>
{/* Editor */}
<section className="flex flex-col gap-3">
<h2 className="text-sm font-semibold text-text-secondary">{t("settings.editorSettings")}</h2>
<Toggle
@@ -84,7 +139,6 @@ export function SettingsPage() {
/>
</section>
{/* Tags */}
<section className="flex flex-col gap-3">
<h2 className="text-sm font-semibold text-text-secondary">{t("settings.tagSettings")}</h2>
<Toggle
@@ -97,6 +151,21 @@ export function SettingsPage() {
checked={settings.includeTrendingTags}
onChange={(v) => settings.setSetting("includeTrendingTags", v)}
/>
<Toggle
label={t("settings.showQualityBadge")}
checked={settings.showQualityBadge}
onChange={(v) => settings.setSetting("showQualityBadge", v)}
/>
<Toggle
label={t("settings.showCopyright")}
checked={settings.showCopyright}
onChange={(v) => settings.setSetting("showCopyright", v)}
/>
<Toggle
label={t("settings.showUsagePolicy")}
checked={settings.showUsagePolicy}
onChange={(v) => settings.setSetting("showUsagePolicy", v)}
/>
<Select
label={t("settings.hashtagCount")}
options={hashtagOptions}
@@ -105,7 +174,6 @@ export function SettingsPage() {
/>
</section>
{/* History */}
<section className="flex flex-col gap-3">
<h2 className="text-sm font-semibold text-text-secondary">{t("settings.historySettings")}</h2>
<Input
+38 -4
View File
@@ -1,12 +1,12 @@
import { create } from "zustand";
import { persist, createJSONStorage } from "zustand/middleware";
import type { VideoType, Genre, SupportedLanguage } from "@engine/types";
import type { VideoType, Genre, SupportedLanguage, StoreLinkType } from "@engine/types";
import { DEFAULTS } from "@config/defaults";
interface EditorData {
videoType: VideoType;
language: SupportedLanguage;
genre: Genre;
genres: Genre[];
gameName: string;
gameNameLocalized: Record<string, string>;
channelName: string;
@@ -15,15 +15,20 @@ interface EditorData {
bossName: string;
dlcName: string;
challengeName: string;
modName: string;
resolution: string;
fps: string;
graphicsPreset: string;
timestamps: string;
playlistLink: string;
contactEmail: string;
musicAttribution: string;
thumbnailText: string;
pinnedComment: string;
spoilerWarning: boolean;
matureWarning: boolean;
storeLinks: Record<string, string>;
storeLinkTypes: Record<string, StoreLinkType>;
social: Record<string, string>;
rig: Record<string, string>;
}
@@ -35,6 +40,7 @@ interface EditorActions {
key: string,
value: string,
) => void;
setStoreLinkType: (platformId: string, type: StoreLinkType) => void;
loadProfile: (profile: Partial<EditorData>) => void;
loadPreset: (preset: Partial<EditorData>) => void;
reset: () => void;
@@ -45,7 +51,7 @@ type EditorState = EditorData & EditorActions;
const initialState: EditorData = {
videoType: DEFAULTS.editor.videoType as VideoType,
language: DEFAULTS.editor.language as SupportedLanguage,
genre: DEFAULTS.editor.genre as Genre,
genres: [...DEFAULTS.editor.genres] as Genre[],
gameName: DEFAULTS.editor.gameName,
gameNameLocalized: { ...DEFAULTS.editor.gameNameLocalized },
channelName: DEFAULTS.editor.channelName,
@@ -54,15 +60,20 @@ const initialState: EditorData = {
bossName: DEFAULTS.editor.bossName,
dlcName: DEFAULTS.editor.dlcName,
challengeName: DEFAULTS.editor.challengeName,
modName: DEFAULTS.editor.modName,
resolution: DEFAULTS.editor.resolution,
fps: DEFAULTS.editor.fps,
graphicsPreset: DEFAULTS.editor.graphicsPreset,
timestamps: DEFAULTS.editor.timestamps,
playlistLink: DEFAULTS.editor.playlistLink,
contactEmail: DEFAULTS.editor.contactEmail,
musicAttribution: DEFAULTS.editor.musicAttribution,
thumbnailText: DEFAULTS.editor.thumbnailText,
pinnedComment: DEFAULTS.editor.pinnedComment,
spoilerWarning: DEFAULTS.editor.spoilerWarning,
matureWarning: DEFAULTS.editor.matureWarning,
storeLinks: { ...DEFAULTS.editor.storeLinks },
storeLinkTypes: { ...DEFAULTS.editor.storeLinkTypes },
social: { ...DEFAULTS.editor.social },
rig: { ...DEFAULTS.editor.rig },
};
@@ -79,6 +90,11 @@ export const useEditorStore = create<EditorState>()(
[group]: { ...state[group], [key]: value },
})),
setStoreLinkType: (platformId, type) =>
set((state) => ({
storeLinkTypes: { ...state.storeLinkTypes, [platformId]: type },
})),
loadProfile: (profile) => set((state) => ({ ...state, ...profile })),
loadPreset: (preset) => set((state) => ({ ...state, ...preset })),
@@ -88,10 +104,23 @@ export const useEditorStore = create<EditorState>()(
{
name: "ytdescgen-editor-draft",
storage: createJSONStorage(() => localStorage),
// v1 → v2 upgrade: `genre: Genre` became `genres: Genre[]` in v0.5.
// Old drafts still round-trip by wrapping the single value.
version: 2,
migrate: (persistedState: unknown, version: number): EditorData => {
if (version < 2 && persistedState && typeof persistedState === "object") {
const state = persistedState as Record<string, unknown> & { genre?: unknown };
if (typeof state.genre === "string" && !Array.isArray(state.genres)) {
state.genres = [state.genre];
delete state.genre;
}
}
return persistedState as EditorData;
},
partialize: (state) => ({
videoType: state.videoType,
language: state.language,
genre: state.genre,
genres: state.genres,
gameName: state.gameName,
gameNameLocalized: state.gameNameLocalized,
channelName: state.channelName,
@@ -100,15 +129,20 @@ export const useEditorStore = create<EditorState>()(
bossName: state.bossName,
dlcName: state.dlcName,
challengeName: state.challengeName,
modName: state.modName,
resolution: state.resolution,
fps: state.fps,
graphicsPreset: state.graphicsPreset,
timestamps: state.timestamps,
playlistLink: state.playlistLink,
contactEmail: state.contactEmail,
musicAttribution: state.musicAttribution,
thumbnailText: state.thumbnailText,
pinnedComment: state.pinnedComment,
spoilerWarning: state.spoilerWarning,
matureWarning: state.matureWarning,
storeLinks: state.storeLinks,
storeLinkTypes: state.storeLinkTypes,
social: state.social,
rig: state.rig,
}),
+28 -1
View File
@@ -1,6 +1,7 @@
import { create } from "zustand";
import { persist, createJSONStorage } from "zustand/middleware";
import { generateId } from "@utils/uuid";
import { saveSettings } from "@utils/storage-adapter";
import type { VideoType, Genre, SupportedLanguage } from "@engine/types";
export interface HistoryEntry {
@@ -8,7 +9,7 @@ export interface HistoryEntry {
gameName: string;
videoType: VideoType;
language: SupportedLanguage;
genre: Genre;
genres: Genre[];
title: string;
description: string;
tags: string;
@@ -22,6 +23,17 @@ interface HistoryState {
clearAll: () => void;
}
type LegacyEntry = Omit<HistoryEntry, "genres"> & { genre?: Genre; genres?: Genre[] };
function normaliseEntry(e: LegacyEntry): HistoryEntry {
const { genre, ...rest } = e;
if (Array.isArray(rest.genres) && rest.genres.length > 0) {
return rest as HistoryEntry;
}
const fallback = genre ?? "action";
return { ...rest, genres: [fallback] } as HistoryEntry;
}
export const useHistoryStore = create<HistoryState>()(
persist(
(set) => ({
@@ -48,7 +60,22 @@ export const useHistoryStore = create<HistoryState>()(
{
name: "ytdescgen-history",
storage: createJSONStorage(() => localStorage),
// v1 → v2 upgrade: HistoryEntry.genre (single) became genres[] in v0.5.
version: 2,
migrate: (persistedState: unknown, version: number) => {
if (version < 2 && persistedState && typeof persistedState === "object") {
const state = persistedState as { entries?: LegacyEntry[] };
if (Array.isArray(state.entries)) {
state.entries = state.entries.map(normaliseEntry);
}
}
return persistedState as { entries: HistoryEntry[] };
},
partialize: (state) => ({ entries: state.entries }),
},
),
);
useHistoryStore.subscribe((state) => {
saveSettings("ytdescgen-history", { entries: state.entries });
});
+43
View File
@@ -0,0 +1,43 @@
import { create } from "zustand";
import { generateId } from "@utils/uuid";
export type LogLevel = "error" | "warn" | "info" | "debug";
export interface LogEntry {
id: string;
timestamp: string;
level: LogLevel;
source: string;
message: string;
details?: string;
}
interface LogState {
entries: LogEntry[];
addEntry: (data: Omit<LogEntry, "id" | "timestamp">) => void;
deleteEntry: (id: string) => void;
clearAll: () => void;
}
const MAX_ENTRIES = 500;
export const useLogStore = create<LogState>()((set) => ({
entries: [],
addEntry: (data) => {
const entry: LogEntry = {
...data,
id: generateId(),
timestamp: new Date().toISOString(),
};
set((state) => ({
entries: [entry, ...state.entries].slice(0, MAX_ENTRIES),
}));
},
deleteEntry: (id) => {
set((state) => ({ entries: state.entries.filter((e) => e.id !== id) }));
},
clearAll: () => set({ entries: [] }),
}));
+30 -2
View File
@@ -1,13 +1,14 @@
import { create } from "zustand";
import { persist, createJSONStorage } from "zustand/middleware";
import { generateId } from "@utils/uuid";
import { saveSettings } from "@utils/storage-adapter";
import type { Genre } from "@engine/types";
export interface GamePreset {
id: string;
gameName: string;
gameNameLocalized?: Record<string, string>;
genre: Genre;
genres: Genre[];
platform: string;
storeLinks: Record<string, string>;
spoilerWarning: boolean;
@@ -24,6 +25,17 @@ interface PresetState {
importPresets: (presets: GamePreset[]) => void;
}
type LegacyPreset = Omit<GamePreset, "genres"> & { genre?: Genre; genres?: Genre[] };
function normalisePreset(p: LegacyPreset): GamePreset {
const { genre, ...rest } = p;
if (Array.isArray(rest.genres) && rest.genres.length > 0) {
return rest as GamePreset;
}
const fallback = genre ?? "action";
return { ...rest, genres: [fallback] } as GamePreset;
}
export const usePresetStore = create<PresetState>()(
persist(
(set, get) => ({
@@ -53,7 +65,8 @@ export const usePresetStore = create<PresetState>()(
importPresets: (presets) => {
set((state) => {
const existingIds = new Set(state.presets.map((p) => p.id));
const newPresets = presets.filter((p) => !existingIds.has(p.id));
const normalised = presets.map((p) => normalisePreset(p as LegacyPreset));
const newPresets = normalised.filter((p) => !existingIds.has(p.id));
return { presets: [...state.presets, ...newPresets] };
});
},
@@ -61,7 +74,22 @@ export const usePresetStore = create<PresetState>()(
{
name: "ytdescgen-presets",
storage: createJSONStorage(() => localStorage),
// v1 → v2 upgrade: GamePreset.genre (single) became genres[] in v0.5.
version: 2,
migrate: (persistedState: unknown, version: number) => {
if (version < 2 && persistedState && typeof persistedState === "object") {
const state = persistedState as { presets?: LegacyPreset[] };
if (Array.isArray(state.presets)) {
state.presets = state.presets.map(normalisePreset);
}
}
return persistedState as { presets: GamePreset[] };
},
partialize: (state) => ({ presets: state.presets }),
},
),
);
usePresetStore.subscribe((state) => {
saveSettings("ytdescgen-presets", { presets: state.presets });
});
+5
View File
@@ -1,6 +1,7 @@
import { create } from "zustand";
import { persist, createJSONStorage } from "zustand/middleware";
import { generateId } from "@utils/uuid";
import { saveSettings } from "@utils/storage-adapter";
export interface Profile {
id: string;
@@ -69,3 +70,7 @@ export const useProfileStore = create<ProfileState>()(
},
),
);
useProfileStore.subscribe((state) => {
saveSettings("ytdescgen-profiles", { profiles: state.profiles });
});
+111 -17
View File
@@ -2,12 +2,13 @@ import { create } from "zustand";
import { persist, createJSONStorage } from "zustand/middleware";
import type { GenreId } from "@config/genres";
import type { SupportedLanguage } from "@engine/types";
import { saveSettings, loadSettings } from "@utils/storage-adapter";
interface SettingsState {
theme: "dark" | "light";
defaultLanguage: string;
appLanguage: SupportedLanguage;
defaultOutputLanguage: SupportedLanguage;
defaultGenre: GenreId;
defaultGenres: GenreId[];
theme: "dark" | "light";
autoSaveDraft: boolean;
showCharCount: boolean;
compactTagDisplay: boolean;
@@ -15,18 +16,23 @@ interface SettingsState {
includeMultilingualTags: boolean;
includeTrendingTags: boolean;
hashtagCount: number;
showQualityBadge: boolean;
showCopyright: boolean;
showUsagePolicy: boolean;
editorAccordionState: Record<string, boolean>;
setTheme: (theme: "dark" | "light") => void;
setDefaultLanguage: (lang: string) => void;
setAppLanguage: (lang: SupportedLanguage) => void;
setDefaultOutputLanguage: (lang: SupportedLanguage) => void;
setDefaultGenre: (genre: GenreId) => void;
setDefaultGenres: (genres: GenreId[]) => void;
setSetting: <K extends keyof SettingsData>(key: K, value: SettingsData[K]) => void;
toggleEditorAccordion: (id: string) => void;
}
interface SettingsData {
theme: "dark" | "light";
defaultLanguage: string;
appLanguage: SupportedLanguage;
defaultOutputLanguage: SupportedLanguage;
defaultGenre: GenreId;
defaultGenres: GenreId[];
theme: "dark" | "light";
autoSaveDraft: boolean;
showCharCount: boolean;
compactTagDisplay: boolean;
@@ -34,13 +40,25 @@ interface SettingsData {
includeMultilingualTags: boolean;
includeTrendingTags: boolean;
hashtagCount: number;
showQualityBadge: boolean;
showCopyright: boolean;
showUsagePolicy: boolean;
editorAccordionState: Record<string, boolean>;
}
const detectBrowserLanguage = (): SupportedLanguage => {
const lang = navigator.language.split("-")[0];
const supported: SupportedLanguage[] = ["en", "vi", "ja", "es", "ko", "zh"];
return (supported.find((s) => s === lang) ?? "en") as SupportedLanguage;
};
const detectedLang = detectBrowserLanguage();
const initialSettings: SettingsData = {
appLanguage: detectedLang,
defaultOutputLanguage: detectedLang,
defaultGenres: ["action"],
theme: "dark",
defaultLanguage: "en",
defaultOutputLanguage: "en",
defaultGenre: "action",
autoSaveDraft: true,
showCharCount: true,
compactTagDisplay: false,
@@ -48,8 +66,21 @@ const initialSettings: SettingsData = {
includeMultilingualTags: true,
includeTrendingTags: true,
hashtagCount: 3,
showQualityBadge: true,
showCopyright: true,
showUsagePolicy: false,
editorAccordionState: {
gameInfo: true,
videoSettings: true,
contentDetails: false,
attribution: false,
rig: false,
storeAndSocial: false,
},
};
const STORE_KEY = "ytdescgen-settings";
export const useSettingsStore = create<SettingsState>()(
persist(
(set) => ({
@@ -61,22 +92,43 @@ export const useSettingsStore = create<SettingsState>()(
set({ theme });
},
setDefaultLanguage: (lang) => set({ defaultLanguage: lang }),
setAppLanguage: (lang) => set({ appLanguage: lang }),
setDefaultOutputLanguage: (lang) => set({ defaultOutputLanguage: lang }),
setDefaultGenre: (genre) => set({ defaultGenre: genre }),
setDefaultGenres: (genres) => set({ defaultGenres: genres }),
setSetting: (key, value) => set({ [key]: value }),
toggleEditorAccordion: (id) =>
set((state) => ({
editorAccordionState: {
...state.editorAccordionState,
[id]: !state.editorAccordionState[id],
},
})),
}),
{
name: "ytdescgen-settings",
name: STORE_KEY,
storage: createJSONStorage(() => localStorage),
// v1 → v2 upgrade: `defaultGenre: GenreId` became
// `defaultGenres: GenreId[]` in v0.5.
version: 2,
migrate: (persistedState: unknown, version: number): SettingsData => {
if (version < 2 && persistedState && typeof persistedState === "object") {
const state = persistedState as Record<string, unknown> & { defaultGenre?: unknown };
if (typeof state.defaultGenre === "string" && !Array.isArray(state.defaultGenres)) {
state.defaultGenres = [state.defaultGenre];
delete state.defaultGenre;
}
}
return persistedState as SettingsData;
},
partialize: (state) => ({
theme: state.theme,
defaultLanguage: state.defaultLanguage,
appLanguage: state.appLanguage,
defaultOutputLanguage: state.defaultOutputLanguage,
defaultGenre: state.defaultGenre,
defaultGenres: state.defaultGenres,
theme: state.theme,
autoSaveDraft: state.autoSaveDraft,
showCharCount: state.showCharCount,
compactTagDisplay: state.compactTagDisplay,
@@ -84,7 +136,49 @@ export const useSettingsStore = create<SettingsState>()(
includeMultilingualTags: state.includeMultilingualTags,
includeTrendingTags: state.includeTrendingTags,
hashtagCount: state.hashtagCount,
showQualityBadge: state.showQualityBadge,
showCopyright: state.showCopyright,
showUsagePolicy: state.showUsagePolicy,
editorAccordionState: state.editorAccordionState,
}),
onRehydrateStorage: () => {
return () => {
loadSettings<SettingsData>(STORE_KEY, initialSettings).then((data) => {
if (data) {
// The file-backed copy may still be v1-shaped; normalise
// before piping into the store.
const maybeOld = data as SettingsData & { defaultGenre?: GenreId };
if (typeof maybeOld.defaultGenre === "string" && !Array.isArray(maybeOld.defaultGenres)) {
maybeOld.defaultGenres = [maybeOld.defaultGenre];
delete maybeOld.defaultGenre;
}
useSettingsStore.setState(data);
}
});
};
},
},
),
);
// Dual-write: also save to file on every change
useSettingsStore.subscribe((state) => {
const data: SettingsData = {
appLanguage: state.appLanguage,
defaultOutputLanguage: state.defaultOutputLanguage,
defaultGenres: state.defaultGenres,
theme: state.theme,
autoSaveDraft: state.autoSaveDraft,
showCharCount: state.showCharCount,
compactTagDisplay: state.compactTagDisplay,
historyLimit: state.historyLimit,
includeMultilingualTags: state.includeMultilingualTags,
includeTrendingTags: state.includeTrendingTags,
hashtagCount: state.hashtagCount,
showQualityBadge: state.showQualityBadge,
showCopyright: state.showCopyright,
showUsagePolicy: state.showUsagePolicy,
editorAccordionState: state.editorAccordionState,
};
saveSettings(STORE_KEY, data);
});
+110
View File
@@ -0,0 +1,110 @@
import { create } from "zustand";
import { persist, createJSONStorage } from "zustand/middleware";
import { generateId } from "@utils/uuid";
import { saveSettings } from "@utils/storage-adapter";
import type { VideoType, Genre, SupportedLanguage, StoreLinkType } from "@engine/types";
/**
* Full snapshot of the editor form. Matches the `partialize` output of
* editor-store so a template can be applied back via `loadProfile` /
* `loadPreset` (both accept `Partial<EditorData>`) and restore every
* field the creator had set.
*/
export interface TemplateSnapshot {
videoType: VideoType;
language: SupportedLanguage;
genres: Genre[];
gameName: string;
gameNameLocalized: Record<string, string>;
channelName: string;
platform: string;
partNumber: string;
bossName: string;
dlcName: string;
challengeName: string;
modName: string;
resolution: string;
fps: string;
graphicsPreset: string;
timestamps: string;
playlistLink: string;
contactEmail: string;
musicAttribution: string;
thumbnailText: string;
pinnedComment: string;
spoilerWarning: boolean;
matureWarning: boolean;
storeLinks: Record<string, string>;
storeLinkTypes: Record<string, StoreLinkType>;
social: Record<string, string>;
rig: Record<string, string>;
}
export interface EditorTemplate {
id: string;
name: string;
createdAt: string;
snapshot: TemplateSnapshot;
}
interface TemplateState {
templates: EditorTemplate[];
addTemplate: (name: string, snapshot: TemplateSnapshot) => string;
deleteTemplate: (id: string) => void;
renameTemplate: (id: string, name: string) => void;
getTemplate: (id: string) => EditorTemplate | undefined;
importTemplates: (templates: EditorTemplate[]) => void;
}
const STORE_KEY = "ytdescgen-templates";
export const useTemplateStore = create<TemplateState>()(
persist(
(set, get) => ({
templates: [],
addTemplate: (name, snapshot) => {
const id = generateId();
const template: EditorTemplate = {
id,
name: name.trim() || "Untitled",
createdAt: new Date().toISOString(),
snapshot,
};
set((state) => ({ templates: [...state.templates, template] }));
return id;
},
deleteTemplate: (id) => {
set((state) => ({ templates: state.templates.filter((tpl) => tpl.id !== id) }));
},
renameTemplate: (id, name) => {
set((state) => ({
templates: state.templates.map((tpl) =>
tpl.id === id ? { ...tpl, name: name.trim() || tpl.name } : tpl,
),
}));
},
getTemplate: (id) => get().templates.find((tpl) => tpl.id === id),
importTemplates: (templates) => {
set((state) => {
const existing = new Set(state.templates.map((tpl) => tpl.id));
const incoming = templates.filter((tpl) => !existing.has(tpl.id));
return { templates: [...state.templates, ...incoming] };
});
},
}),
{
name: STORE_KEY,
storage: createJSONStorage(() => localStorage),
partialize: (state) => ({ templates: state.templates }),
},
),
);
useTemplateStore.subscribe((state) => {
saveSettings(STORE_KEY, { templates: state.templates });
});
+16
View File
@@ -0,0 +1,16 @@
import { useLogStore, type LogLevel } from "@store/log-store";
function log(level: LogLevel, source: string, message: string, details?: string) {
useLogStore.getState().addEntry({ level, source, message, details });
}
export const logger = {
error: (source: string, message: string, details?: string) =>
log("error", source, message, details),
warn: (source: string, message: string, details?: string) =>
log("warn", source, message, details),
info: (source: string, message: string, details?: string) =>
log("info", source, message, details),
debug: (source: string, message: string, details?: string) =>
log("debug", source, message, details),
};
+26
View File
@@ -0,0 +1,26 @@
/**
* Strip every character that is not a Unicode letter or digit.
*
* Used to turn a free-form game name or genre id into a valid hashtag body.
* Spaces, punctuation, separators, and emoji are all removed; accented
* letters and non-Latin scripts are preserved via `\p{L}` / `\p{N}`.
*
* "S.T.A.L.K.E.R. 2" -> "STALKER2"
* "Yakuza: Like a Dragon"-> "YakuzaLikeaDragon"
* "visual_novel" -> "visualnovel"
* "仁王 2" -> "仁王2"
*/
export function sanitizeHashtag(name: string): string {
return name.normalize("NFC").replace(/[^\p{L}\p{N}]/gu, "");
}
/**
* Turn a snake_case identifier into a space-separated, human-readable form.
* Used for free-text tag strings where the id would otherwise leak as-is.
*
* "visual_novel" -> "visual novel"
* "survival_craft" -> "survival craft"
*/
export function humanizeId(id: string): string {
return id.replace(/_/g, " ");
}
+109
View File
@@ -0,0 +1,109 @@
import { IS_TAURI } from "./platform";
import { logger } from "./logger";
const SETTINGS_FILENAME = "settings.json";
async function getSettingsPath(): Promise<string> {
const { appDataDir } = await import("@tauri-apps/api/path");
const dir = await appDataDir();
return `${dir}${SETTINGS_FILENAME}`;
}
export async function loadSettings<T>(key: string, fallback: T): Promise<T> {
if (IS_TAURI) {
try {
const { invoke } = await import("@tauri-apps/api/core");
const path = await getSettingsPath();
const raw: string = await invoke("read_from_file", { path });
const allSettings = JSON.parse(raw) as Record<string, unknown>;
if (key in allSettings) return allSettings[key] as T;
} catch (e) {
logger.debug("storage", `Tauri file read failed for "${key}"`, String(e));
}
}
try {
const raw = localStorage.getItem(key);
if (raw) return JSON.parse(raw) as T;
} catch (e) {
logger.warn("storage", `localStorage parse failed for "${key}"`, String(e));
}
return fallback;
}
/**
* Check if the Tauri data file exists and is valid JSON.
* If missing or corrupt, recreate it from localStorage data.
* Returns a status message or null if not in Tauri / all good.
*/
export async function checkDataFileHealth(): Promise<string | null> {
if (!IS_TAURI) return null;
try {
const { invoke } = await import("@tauri-apps/api/core");
const path = await getSettingsPath();
try {
const raw: string = await invoke("read_from_file", { path });
JSON.parse(raw);
return null; // File exists and is valid
} catch {
// File missing or corrupt — rebuild from localStorage
const rebuilt: Record<string, unknown> = {};
const keys = [
"ytdescgen-settings",
"ytdescgen-profiles",
"ytdescgen-presets",
"ytdescgen-history",
"ytdescgen-editor-draft",
];
for (const key of keys) {
try {
const raw = localStorage.getItem(key);
if (raw) rebuilt[key] = JSON.parse(raw);
} catch {
// Skip corrupt entries
}
}
await invoke("save_to_file", {
path,
content: JSON.stringify(rebuilt, null, 2),
});
return "Data file was missing or corrupt. Restored from local cache.";
}
} catch {
return null;
}
}
export async function saveSettings<T>(key: string, value: T): Promise<void> {
try {
localStorage.setItem(key, JSON.stringify(value));
} catch (e) {
logger.warn("storage", `localStorage write failed for "${key}"`, String(e));
}
if (IS_TAURI) {
try {
const { invoke } = await import("@tauri-apps/api/core");
const path = await getSettingsPath();
let allSettings: Record<string, unknown> = {};
try {
const raw: string = await invoke("read_from_file", { path });
allSettings = JSON.parse(raw) as Record<string, unknown>;
} catch {
// File doesn't exist yet — start fresh
}
allSettings[key] = value;
await invoke("save_to_file", {
path,
content: JSON.stringify(allSettings, null, 2),
});
} catch (e) {
logger.warn("storage", `Tauri file write failed for "${key}"`, String(e));
}
}
}
+100
View File
@@ -0,0 +1,100 @@
const EMAIL_REGEX =
/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;
const URL_REGEX =
/^https?:\/\/[a-zA-Z0-9]([a-zA-Z0-9-]*[a-zA-Z0-9])?(\.[a-zA-Z0-9]([a-zA-Z0-9-]*[a-zA-Z0-9])?)+([/?#].*)?$/;
const MAX_EMAILS = 3;
export interface ValidationResult {
valid: boolean;
error?: string;
errorParams?: Record<string, string | number>;
}
export function validateEmails(input: string): ValidationResult {
const trimmed = input.trim();
if (!trimmed) return { valid: true };
const emails = trimmed
.split(",")
.map((e) => e.trim())
.filter(Boolean);
if (emails.length > MAX_EMAILS) {
return {
valid: false,
error: "validation.emailMaxExceeded",
errorParams: { max: MAX_EMAILS, count: emails.length },
};
}
for (const email of emails) {
if (!EMAIL_REGEX.test(email)) {
return {
valid: false,
error: "validation.emailInvalid",
errorParams: { email },
};
}
}
return { valid: true };
}
export function validateUrl(input: string): ValidationResult {
const trimmed = input.trim();
if (!trimmed) return { valid: true };
if (!URL_REGEX.test(trimmed)) {
return {
valid: false,
error: "validation.urlInvalid",
};
}
return { valid: true };
}
export function validateUrlWithPrefix(
input: string,
expectedPrefix: string,
): ValidationResult {
const baseResult = validateUrl(input);
if (!baseResult.valid) return baseResult;
const trimmed = input.trim();
if (!trimmed) return { valid: true };
if (expectedPrefix && !trimmed.startsWith(expectedPrefix)) {
return {
valid: true,
error: "validation.urlPrefixMismatch",
errorParams: { expected: expectedPrefix },
};
}
return { valid: true };
}
/**
* Validate a URL against a platform-specific RegExp. Unlike
* validateUrlWithPrefix, prefix-style mismatches are treated as hard
* errors so invalid links can be kept out of the output.
*/
export function validateUrlWithPattern(
input: string,
pattern: RegExp,
): ValidationResult {
const trimmed = input.trim();
if (!trimmed) return { valid: true };
const baseResult = validateUrl(trimmed);
if (!baseResult.valid) return baseResult;
if (!pattern.test(trimmed)) {
return { valid: false, error: "validation.urlInvalid" };
}
return { valid: true };
}
+210 -4
View File
@@ -7,7 +7,7 @@ function makeInput(overrides: Partial<GeneratorInput> = {}): GeneratorInput {
return {
videoType: "full",
language: "en",
genre: "action",
genres: ["action"],
gameName: "Elden Ring",
channelName: "TestChannel",
platform: "steam",
@@ -31,6 +31,34 @@ describe("buildDescription", () => {
expect(result).toContain("#EldenRing");
});
it("sanitises hashtags for game names with special characters", () => {
const t = createMockT("en");
const result = buildDescription(
makeInput({ gameName: "S.T.A.L.K.E.R. 2" }),
t,
);
expect(result).toContain("#STALKER2");
expect(result).not.toMatch(/#\s?S\./);
});
it("sanitises hashtags for snake_case genre ids (fixes #visual_novel bug)", () => {
const t = createMockT("en");
const result = buildDescription(makeInput({ genres: ["visual_novel"] }), t);
expect(result).toContain("#visualnovel");
expect(result).not.toContain("#visual_novel");
});
it("uses the first genre for the hashtag when multiple are selected", () => {
const t = createMockT("en");
const result = buildDescription(
makeInput({ genres: ["hack_slash", "action", "soulslike"] }),
t,
);
expect(result).toContain("#hackslash");
expect(result).not.toContain("#action");
expect(result).not.toContain("#soulslike");
});
it("includes timestamps when provided", () => {
const t = createMockT("en");
const result = buildDescription(
@@ -42,14 +70,97 @@ describe("buildDescription", () => {
expect(result).toContain("5:30 Boss");
});
it("includes store links when provided", () => {
it("includes store links when provided (paid default → Buy heading)", () => {
const t = createMockT("en");
const result = buildDescription(
makeInput({ storeLinks: { Steam: "https://store.steampowered.com/app/123" } }),
t,
);
expect(result).toContain("GET THE GAME");
expect(result).toContain("GET THE GAME (if you want to buy)");
expect(result).toContain("Steam: https://store.steampowered.com/app/123");
expect(result).not.toContain("DOWNLOAD THE GAME");
});
it("switches to Download heading when majority of links are free/demo", () => {
const t = createMockT("en");
const result = buildDescription(
makeInput({
storeLinks: {
steam: "https://store.steampowered.com/app/1",
itchio: "https://dev.itch.io/demo",
epic: "https://store.epicgames.com/freegame",
},
storeLinkTypes: {
steam: "paid",
itchio: "demo",
epic: "free",
},
}),
t,
);
expect(result).toContain("DOWNLOAD THE GAME (if you want to play)");
expect(result).not.toContain("GET THE GAME");
});
it("ties favour the Buy heading", () => {
const t = createMockT("en");
const result = buildDescription(
makeInput({
storeLinks: {
steam: "https://store.steampowered.com/app/1",
itchio: "https://dev.itch.io/game",
},
storeLinkTypes: { steam: "paid", itchio: "free" },
}),
t,
);
// 1 paid, 1 free → nonPaid (1) is NOT > entries.length/2 (1) → Buy
expect(result).toContain("GET THE GAME (if you want to buy)");
});
it("adds (free demo) suffix to demo links", () => {
const t = createMockT("en");
const result = buildDescription(
makeInput({
storeLinks: { itchio: "https://dev.itch.io/demo" },
storeLinkTypes: { itchio: "demo" },
}),
t,
);
expect(result).toContain("(free demo)");
});
it("adds (free) suffix to free links but not paid ones", () => {
const t = createMockT("en");
const result = buildDescription(
makeInput({
storeLinks: {
steam: "https://store.steampowered.com/app/1",
itchio: "https://dev.itch.io/game",
},
storeLinkTypes: { steam: "paid", itchio: "free" },
}),
t,
);
// Find the itchio line and make sure it has (free), Steam line does not
const lines = result.split("\n");
const itchLine = lines.find((l) => l.includes("itch.io"));
const steamLine = lines.find((l) => l.includes("steampowered"));
expect(itchLine).toContain("(free)");
expect(steamLine).not.toContain("(free)");
});
it("defaults unspecified link types to paid", () => {
const t = createMockT("en");
const result = buildDescription(
makeInput({
storeLinks: { steam: "https://store.steampowered.com/app/1" },
// storeLinkTypes omitted entirely
}),
t,
);
expect(result).toContain("GET THE GAME (if you want to buy)");
expect(result).not.toContain("(free)");
});
it("includes video settings", () => {
@@ -73,12 +184,107 @@ describe("buildDescription", () => {
expect(result).toContain("GPU: RTX 4090");
});
it("humanises snake_case rig keys (e.g. video_editor → VIDEO EDITOR)", () => {
const t = createMockT("en");
const result = buildDescription(
makeInput({ rig: { video_editor: "davinci_resolve_studio|19.1" } }),
t,
);
expect(result).toContain("VIDEO EDITOR: DaVinci Resolve Studio 19.1");
expect(result).not.toContain("VIDEO_EDITOR");
});
it("includes spoiler warning when enabled", () => {
const t = createMockT("en");
const result = buildDescription(makeInput({ spoilerWarning: true }), t);
expect(result).toContain("SPOILER WARNING");
});
it("includes music attribution section when provided", () => {
const t = createMockT("en");
const result = buildDescription(
makeInput({ musicAttribution: "Music by Karl Casey @ White Bat Audio" }),
t,
);
expect(result).toContain("🎵 MUSIC / SOUND");
expect(result).toContain("Music by Karl Casey @ White Bat Audio");
});
it("places music section before donate/social sections", () => {
const t = createMockT("en");
const result = buildDescription(
makeInput({
musicAttribution: "Music credit here",
social: { twitter: "https://x.com/me", kofi: "https://ko-fi.com/me" },
}),
t,
);
const musicIdx = result.indexOf("🎵 MUSIC / SOUND");
const donateIdx = result.indexOf("SUPPORT THE CHANNEL");
expect(musicIdx).toBeGreaterThan(-1);
expect(donateIdx).toBeGreaterThan(-1);
expect(musicIdx).toBeLessThan(donateIdx);
});
it("omits the music section when attribution is blank or whitespace", () => {
const t = createMockT("en");
const blank = buildDescription(makeInput({ musicAttribution: "" }), t);
const whitespace = buildDescription(makeInput({ musicAttribution: " \n " }), t);
expect(blank).not.toContain("🎵 MUSIC / SOUND");
expect(whitespace).not.toContain("🎵 MUSIC / SOUND");
});
it("renders copyright line when showCopyright is true and channelName is set", () => {
const t = createMockT("en");
const result = buildDescription(makeInput(), t, { showCopyright: true });
const year = new Date().getFullYear();
expect(result).toContain(`© ${year} TestChannel. All rights reserved.`);
});
it("skips copyright when channelName is blank even if toggle is on", () => {
const t = createMockT("en");
const result = buildDescription(makeInput({ channelName: "" }), t, {
showCopyright: true,
});
expect(result).not.toContain("All rights reserved");
});
it("skips copyright when the toggle is off", () => {
const t = createMockT("en");
const result = buildDescription(makeInput(), t, { showCopyright: false });
expect(result).not.toContain("All rights reserved");
});
it("renders the usage policy block when showUsagePolicy is true", () => {
const t = createMockT("en");
const result = buildDescription(makeInput(), t, { showUsagePolicy: true });
expect(result).toContain("📋 USAGE POLICY");
expect(result).toContain("Always credit");
expect(result).toContain("Compilation, review, commentary");
});
it("skips the usage policy when the toggle is off", () => {
const t = createMockT("en");
const result = buildDescription(makeInput(), t, { showUsagePolicy: false });
expect(result).not.toContain("📋 USAGE POLICY");
});
it("places copyright and usage policy between CTA and hashtags", () => {
const t = createMockT("en");
const result = buildDescription(makeInput(), t, {
showCopyright: true,
showUsagePolicy: true,
});
const ctaIdx = result.indexOf("Like | 🔔 Subscribe");
const copyrightIdx = result.indexOf("All rights reserved");
const policyIdx = result.indexOf("📋 USAGE POLICY");
const hashtagsIdx = result.indexOf("#EldenRing");
expect(ctaIdx).toBeGreaterThan(-1);
expect(copyrightIdx).toBeGreaterThan(ctaIdx);
expect(policyIdx).toBeGreaterThan(copyrightIdx);
expect(hashtagsIdx).toBeGreaterThan(policyIdx);
});
it("includes mature warning when enabled", () => {
const t = createMockT("en");
const result = buildDescription(makeInput({ matureWarning: true }), t);
@@ -92,7 +298,7 @@ describe("buildDescription", () => {
t,
);
expect(result).toContain("FOLLOW ME");
expect(result).toContain("twitter: https://x.com/test");
expect(result).toContain("Twitter / X: https://x.com/test");
});
it("includes playlist link when provided", () => {
+41
View File
@@ -0,0 +1,41 @@
import { describe, it, expect } from "vitest";
import { formatRigValue, RIG_FIELDS } from "@config/rig-fields";
describe("formatRigValue", () => {
it("passes text fields through unchanged", () => {
expect(formatRigValue("cpu", "Ryzen 9 7950X")).toBe("Ryzen 9 7950X");
});
it("formats dropdown_with_version with both parts", () => {
expect(formatRigValue("video_editor", "davinci_resolve_studio|19.1")).toBe(
"DaVinci Resolve Studio 19.1",
);
});
it("formats dropdown_with_version with no version", () => {
expect(formatRigValue("video_editor", "capcut|")).toBe("CapCut");
});
it("formats dropdown_with_version with only version", () => {
// Only a version with an empty option renders just the version —
// this is technically malformed input but we shouldn't crash.
expect(formatRigValue("video_editor", "|1.0")).toBe("1.0");
});
it("returns empty string when the whole value is blank", () => {
expect(formatRigValue("video_editor", "")).toBe("");
expect(formatRigValue("video_editor", "|")).toBe("");
});
it("falls back to the raw option id when unknown", () => {
expect(formatRigValue("video_editor", "unknown_tool|1.0")).toBe(
"unknown_tool 1.0",
);
});
it("includes a video_editor entry in RIG_FIELDS", () => {
const field = RIG_FIELDS.find((f) => f.id === "video_editor");
expect(field?.type).toBe("dropdown_with_version");
expect(field?.options?.length).toBeGreaterThan(3);
});
});
+48 -8
View File
@@ -6,7 +6,7 @@ function makeInput(overrides: Partial<GeneratorInput> = {}): GeneratorInput {
return {
videoType: "full",
language: "en",
genre: "action",
genres: ["action"],
gameName: "Elden Ring",
channelName: "TestChannel",
platform: "steam",
@@ -28,17 +28,17 @@ describe("generateTags", () => {
});
it("includes genre-specific tags for action", () => {
const tags = generateTags(makeInput({ genre: "action" }));
const tags = generateTags(makeInput({ genres: ["action"] }));
expect(tags.some((t) => t.toLowerCase().includes("action"))).toBe(true);
});
it("includes genre-specific tags for horror", () => {
const tags = generateTags(makeInput({ genre: "horror" }));
const tags = generateTags(makeInput({ genres: ["horror"] }));
expect(tags.some((t) => t.toLowerCase().includes("horror"))).toBe(true);
});
it("includes genre-specific tags for rpg", () => {
const tags = generateTags(makeInput({ genre: "rpg" }));
const tags = generateTags(makeInput({ genres: ["rpg"] }));
expect(tags.some((t) => t.toLowerCase().includes("rpg"))).toBe(true);
});
@@ -47,19 +47,59 @@ describe("generateTags", () => {
expect(tags.some((t) => t.toLowerCase().includes("boss"))).toBe(true);
});
it("includes video type tags for mods", () => {
const tags = generateTags(makeInput({ videoType: "mods" }));
expect(tags.some((t) => t.toLowerCase().includes("mod"))).toBe(true);
expect(tags).toContain("modded gameplay no commentary");
});
it("includes video type tags for collectibles", () => {
const tags = generateTags(makeInput({ videoType: "collectibles" }));
expect(tags.some((t) => t.toLowerCase().includes("collectibles"))).toBe(true);
expect(tags).toContain("Elden Ring all collectibles");
});
it("humanises snake_case genres in trending tags (fixes visual_novel leak)", () => {
const tags = generateTags(
makeInput({ genres: ["visual_novel"] }),
{ includeTrendingTags: true },
);
// No tag should contain the raw underscore form
expect(tags.every((t) => !t.includes("visual_novel"))).toBe(true);
// The humanised form should be present in the trending tags
const year = new Date().getFullYear().toString();
expect(tags.some((t) => t === `best visual novel games ${year}`)).toBe(true);
expect(tags.some((t) => t === `visual novel gameplay ${year}`)).toBe(true);
});
it("includes video type tags for speedrun", () => {
const tags = generateTags(makeInput({ videoType: "speedrun" }));
expect(tags.some((t) => t.toLowerCase().includes("speedrun"))).toBe(true);
});
it("includes multilingual tags (Japanese)", () => {
const tags = generateTags(makeInput());
it("includes multilingual tags only for the selected language (Japanese)", () => {
const tags = generateTags(makeInput({ language: "ja" }));
expect(tags.some((t) => t.includes("ゲームプレイ"))).toBe(true);
// Should NOT leak other languages
expect(tags.some((t) => t.includes("không bình luận"))).toBe(false);
expect(tags.some((t) => t.includes("게임플레이"))).toBe(false);
});
it("includes multilingual tags (Vietnamese)", () => {
const tags = generateTags(makeInput());
it("includes multilingual tags only for the selected language (Vietnamese)", () => {
const tags = generateTags(makeInput({ language: "vi" }));
expect(tags.some((t) => t.includes("không bình luận"))).toBe(true);
expect(tags.some((t) => t.includes("ゲームプレイ"))).toBe(false);
expect(tags.some((t) => t.includes("游戏实况"))).toBe(false);
});
it("includes visual novel tags for visual_novel genre", () => {
const tags = generateTags(makeInput({ genres: ["visual_novel"] }));
expect(tags.some((t) => t.toLowerCase().includes("visual novel"))).toBe(true);
});
it("includes full_demo tags for full_demo video type", () => {
const tags = generateTags(makeInput({ videoType: "full_demo" }));
expect(tags.some((t) => t.toLowerCase().includes("demo"))).toBe(true);
});
it("has no duplicate tags (case-insensitive)", () => {
+132
View File
@@ -0,0 +1,132 @@
import { describe, it, expect } from "vitest";
import { parseTimeline, renderTimeline } from "@engine/timeline-parser";
import type { TranslationFn } from "@engine/types";
// Minimal translation lookup keyed by (language, keyword id).
// Mirrors the shape of the real templates.json entries.
const DICT: Record<string, Record<string, string>> = {
en: {
chapter: "Chapter {{n}}",
part: "Part {{n}}",
boss: "Boss {{n}}",
final_boss: "Final Boss",
intro: "Intro",
ending: "Ending",
tutorial: "Tutorial",
credits: "Credits",
},
vi: {
chapter: "Chương {{n}}",
part: "Phần {{n}}",
boss: "Boss {{n}}",
final_boss: "Boss cuối",
intro: "Mở đầu",
ending: "Kết thúc",
tutorial: "Hướng dẫn",
credits: "Credits",
},
ja: {
chapter: "第{{n}}章",
part: "パート{{n}}",
boss: "ボス{{n}}",
final_boss: "ラスボス",
intro: "オープニング",
ending: "エンディング",
tutorial: "チュートリアル",
credits: "クレジット",
},
};
function makeT(lang: "en" | "vi" | "ja"): TranslationFn {
return (key, opts) => {
const id = key.replace("timeline.keywords.", "");
const template = DICT[lang][id] ?? id;
if (!opts) return template;
return template.replace(/\{\{(\w+)\}\}/g, (_, k) => opts[k] ?? "");
};
}
describe("parseTimeline", () => {
it("parses time + label into entries", () => {
const entries = parseTimeline("0:00 Intro\n5:30 Chapter 1\n15:00 Boss 2");
expect(entries).toHaveLength(3);
expect(entries[0].time).toBe("0:00");
expect(entries[0].keyword).toBe("intro");
expect(entries[1].keyword).toBe("chapter");
expect(entries[1].number).toBe(1);
expect(entries[2].keyword).toBe("boss");
expect(entries[2].number).toBe(2);
});
it("supports HH:MM:SS timecodes", () => {
const entries = parseTimeline("1:23:45 Chapter 7");
expect(entries[0].time).toBe("1:23:45");
expect(entries[0].keyword).toBe("chapter");
expect(entries[0].number).toBe(7);
});
it("recognizes final boss before boss", () => {
const entries = parseTimeline("10:00 Final Boss");
expect(entries[0].keyword).toBe("final_boss");
});
it("recognizes Vietnamese keywords", () => {
const entries = parseTimeline("0:00 Mở đầu\n5:00 Chương 3\n20:00 Boss cuối");
expect(entries[0].keyword).toBe("intro");
expect(entries[1].keyword).toBe("chapter");
expect(entries[1].number).toBe(3);
expect(entries[2].keyword).toBe("final_boss");
});
it("recognizes Japanese keywords", () => {
const entries = parseTimeline("0:00 オープニング\n5:00 パート 2\n20:00 ラスボス");
expect(entries[0].keyword).toBe("intro");
expect(entries[1].keyword).toBe("part");
expect(entries[1].number).toBe(2);
expect(entries[2].keyword).toBe("final_boss");
});
it("preserves lines that don't match a known keyword", () => {
const entries = parseTimeline("0:00 Random Stuff");
expect(entries[0].time).toBe("0:00");
expect(entries[0].keyword).toBeUndefined();
expect(entries[0].rawLabel).toBe("Random Stuff");
});
it("preserves lines without a time prefix", () => {
const entries = parseTimeline("Just a note");
expect(entries[0].time).toBe("");
expect(entries[0].rawLabel).toBe("Just a note");
});
it("skips blank lines", () => {
const entries = parseTimeline("\n0:00 Intro\n\n5:00 Chapter 1\n");
expect(entries).toHaveLength(2);
});
});
describe("renderTimeline", () => {
it("translates English input to Vietnamese", () => {
const entries = parseTimeline("0:00 Intro\n5:30 Chapter 1\n10:00 Boss 2\n20:00 Final Boss");
const out = renderTimeline(entries, "vi", makeT("vi"));
expect(out).toBe("0:00 Mở đầu\n5:30 Chương 1\n10:00 Boss 2\n20:00 Boss cuối");
});
it("translates English input to Japanese", () => {
const entries = parseTimeline("0:00 Intro\n5:30 Chapter 1");
const out = renderTimeline(entries, "ja", makeT("ja"));
expect(out).toBe("0:00 オープニング\n5:30 第1章");
});
it("keeps unrecognized labels verbatim", () => {
const entries = parseTimeline("0:00 Intro\n7:00 Random Stuff");
const out = renderTimeline(entries, "vi", makeT("vi"));
expect(out).toBe("0:00 Mở đầu\n7:00 Random Stuff");
});
it("renders English (identity) correctly", () => {
const entries = parseTimeline("0:00 Intro\n5:30 Chapter 1\n10:00 Boss 2");
const out = renderTimeline(entries, "en", makeT("en"));
expect(out).toBe("0:00 Intro\n5:30 Chapter 1\n10:00 Boss 2");
});
});
+92 -2
View File
@@ -1,5 +1,5 @@
import { describe, it, expect } from "vitest";
import { buildTitle, checkTitleWarning } from "@engine/title-builder";
import { buildTitle, buildQualityBadge, checkTitleWarning } from "@engine/title-builder";
import { createMockT } from "../helpers/mock-t";
import type { GeneratorInput } from "@engine/types";
@@ -7,7 +7,7 @@ function makeInput(overrides: Partial<GeneratorInput> = {}): GeneratorInput {
return {
videoType: "full",
language: "en",
genre: "action",
genres: ["action"],
gameName: "Elden Ring",
channelName: "TestChannel",
platform: "steam",
@@ -100,6 +100,96 @@ describe("buildTitle", () => {
const result = buildTitle(input, t);
expect(result).toBe("エルデンリング — Gameplay No Commentary");
});
it("appends quality badge after the video-type segment", () => {
const t = createMockT("en");
const result = buildTitle(
makeInput({ videoType: "part", partNumber: "5", resolution: "1440p", fps: "60" }),
t,
);
expect(result).toBe("Elden Ring — Part 5 [2K] — Gameplay No Commentary");
});
it("includes resolution alongside non-default FPS for clarity", () => {
const t = createMockT("en");
const result = buildTitle(
makeInput({ videoType: "part", partNumber: "1", resolution: "1080p", fps: "120" }),
t,
);
expect(result).toBe("Elden Ring — Part 1 [1080p 120FPS] — Gameplay No Commentary");
});
it("combines resolution and FPS when both are non-default", () => {
const t = createMockT("en");
const result = buildTitle(
makeInput({ resolution: "4K", fps: "120" }),
t,
);
// videoType "full" renders empty, so the badge becomes its own segment
expect(result).toBe("Elden Ring — [4K 120FPS] — Gameplay No Commentary");
});
it("omits the quality badge at defaults", () => {
const t = createMockT("en");
const result = buildTitle(
makeInput({ videoType: "part", partNumber: "2", resolution: "1080p", fps: "60" }),
t,
);
expect(result).toBe("Elden Ring — Part 2 — Gameplay No Commentary");
});
it("respects the showQualityBadge flag", () => {
const t = createMockT("en");
const result = buildTitle(
makeInput({ videoType: "boss", bossName: "Margit", resolution: "4K", fps: "60" }),
t,
false,
);
expect(result).toBe("Elden Ring — Margit Boss Fight — Gameplay No Commentary");
});
it("renders mods video type with mod name", () => {
const t = createMockT("en");
const result = buildTitle(
makeInput({ videoType: "mods", modName: "Requiem" }),
t,
);
expect(result).toBe("Elden Ring — Requiem Mods — Gameplay No Commentary");
});
it("renders collectibles video type", () => {
const t = createMockT("en");
const result = buildTitle(makeInput({ videoType: "collectibles" }), t);
expect(result).toBe("Elden Ring — All Collectibles — Gameplay No Commentary");
});
});
describe("buildQualityBadge", () => {
it("returns empty at defaults (1080p 60fps)", () => {
expect(buildQualityBadge("1080p", "60")).toBe("");
});
it("maps 1440p to 2K", () => {
expect(buildQualityBadge("1440p", "60")).toBe("2K");
});
it("keeps 720p and 4K as-is", () => {
expect(buildQualityBadge("720p", "60")).toBe("720p");
expect(buildQualityBadge("4K", "60")).toBe("4K");
});
it("joins resolution and non-default FPS", () => {
expect(buildQualityBadge("4K", "120")).toBe("4K 120FPS");
expect(buildQualityBadge("1440p", "144")).toBe("2K 144FPS");
});
it("includes default resolution when only FPS is non-default", () => {
expect(buildQualityBadge("1080p", "120")).toBe("1080p 120FPS");
});
it("falls back to defaults when inputs are undefined", () => {
expect(buildQualityBadge(undefined, undefined)).toBe("");
});
});
describe("checkTitleWarning", () => {
+79
View File
@@ -0,0 +1,79 @@
import { describe, it, expect } from "vitest";
import { buildTitleVariants } from "@engine/title-variants";
import { createMockT } from "../helpers/mock-t";
import type { GeneratorInput } from "@engine/types";
function makeInput(overrides: Partial<GeneratorInput> = {}): GeneratorInput {
return {
videoType: "part",
language: "en",
genres: ["action"],
gameName: "Elden Ring",
channelName: "TestChannel",
platform: "steam",
partNumber: "1",
resolution: "1440p",
fps: "60",
spoilerWarning: false,
matureWarning: false,
storeLinks: {},
social: {},
rig: {},
...overrides,
};
}
describe("buildTitleVariants", () => {
it("returns exactly 3 variants with the expected ids", () => {
const t = createMockT("en");
const variants = buildTitleVariants(makeInput(), t);
expect(variants).toHaveLength(3);
expect(variants.map((v) => v.id)).toEqual(["default", "typeFirst", "qualityFirst"]);
});
it("default variant matches the primary buildTitle output", () => {
const t = createMockT("en");
const [defaultVariant] = buildTitleVariants(makeInput(), t);
expect(defaultVariant!.title).toBe("Elden Ring — Part 1 [2K] — Gameplay No Commentary");
});
it("typeFirst swaps game name and video type, keeps badge on game", () => {
const t = createMockT("en");
const [, typeFirst] = buildTitleVariants(makeInput(), t);
expect(typeFirst!.title).toBe("Part 1 — Elden Ring [2K] — Gameplay No Commentary");
});
it("qualityFirst puts the badge at the start", () => {
const t = createMockT("en");
const [, , qualityFirst] = buildTitleVariants(makeInput(), t);
expect(qualityFirst!.title).toBe("[2K] Elden Ring — Part 1 — Gameplay No Commentary");
});
it("drops the badge entirely when showQualityBadge is false", () => {
const t = createMockT("en");
const variants = buildTitleVariants(makeInput(), t, false);
for (const v of variants) {
expect(v.title).not.toContain("[");
}
});
it("qualityFirst falls back to default when the badge is empty (1080p 60fps)", () => {
const t = createMockT("en");
const variants = buildTitleVariants(
makeInput({ resolution: "1080p", fps: "60" }),
t,
);
const defaultTitle = variants.find((v) => v.id === "default")!.title;
const qualityFirstTitle = variants.find((v) => v.id === "qualityFirst")!.title;
expect(qualityFirstTitle).toBe(defaultTitle);
});
it("renders the mod name in the type-first variant", () => {
const t = createMockT("en");
const [, typeFirst] = buildTitleVariants(
makeInput({ videoType: "mods", modName: "Requiem", resolution: "1080p", fps: "60" }),
t,
);
expect(typeFirst!.title).toContain("Requiem Mods");
});
});
+69
View File
@@ -0,0 +1,69 @@
import { describe, it, expect } from "vitest";
import { sanitizeHashtag, humanizeId } from "@utils/sanitize";
describe("sanitizeHashtag", () => {
it("drops spaces", () => {
expect(sanitizeHashtag("Elden Ring")).toBe("EldenRing");
});
it("drops periods and colons", () => {
expect(sanitizeHashtag("S.T.A.L.K.E.R. 2")).toBe("STALKER2");
expect(sanitizeHashtag("Yakuza: Like a Dragon")).toBe("YakuzaLikeaDragon");
});
it("drops apostrophes, hyphens, ampersands, parentheses", () => {
expect(sanitizeHashtag("Assassin's Creed")).toBe("AssassinsCreed");
expect(sanitizeHashtag("Spider-Man")).toBe("SpiderMan");
expect(sanitizeHashtag("Sonic & Knuckles")).toBe("SonicKnuckles");
expect(sanitizeHashtag("Prey (2017)")).toBe("Prey2017");
});
it("drops underscores (fixes #visual_novel bug)", () => {
expect(sanitizeHashtag("visual_novel")).toBe("visualnovel");
expect(sanitizeHashtag("survival_craft")).toBe("survivalcraft");
expect(sanitizeHashtag("tower_defense")).toBe("towerdefense");
});
it("keeps digits and letters intact", () => {
expect(sanitizeHashtag("Cyberpunk 2077")).toBe("Cyberpunk2077");
expect(sanitizeHashtag("100% Orange Juice")).toBe("100OrangeJuice");
});
it("preserves non-Latin scripts", () => {
expect(sanitizeHashtag("仁王 2")).toBe("仁王2");
expect(sanitizeHashtag("プレイ動画")).toBe("プレイ動画");
expect(sanitizeHashtag("게임 플레이")).toBe("게임플레이");
});
it("preserves accented characters", () => {
expect(sanitizeHashtag("Pokémon Violet")).toBe("PokémonViolet");
expect(sanitizeHashtag("Café World")).toBe("CaféWorld");
});
it("handles empty input", () => {
expect(sanitizeHashtag("")).toBe("");
expect(sanitizeHashtag(" ")).toBe("");
expect(sanitizeHashtag("!!!")).toBe("");
});
it("drops emojis", () => {
expect(sanitizeHashtag("🎮 Elden Ring 🔥")).toBe("EldenRing");
});
});
describe("humanizeId", () => {
it("replaces underscores with spaces", () => {
expect(humanizeId("visual_novel")).toBe("visual novel");
expect(humanizeId("survival_craft")).toBe("survival craft");
expect(humanizeId("tower_defense")).toBe("tower defense");
});
it("leaves single-word ids untouched", () => {
expect(humanizeId("action")).toBe("action");
expect(humanizeId("rpg")).toBe("rpg");
});
it("handles multiple underscores", () => {
expect(humanizeId("a_b_c_d")).toBe("a b c d");
});
});
Loaded 100 of 101 files, more files were not shown because too many files have changed in this diff. Show more