feat(folders): nested folder tree (max depth 2) + id-based mutations

- new storeDb.ts: DB+FS layer (folders w/ parent_id, videos w/ global id)
- depth cap: sub-folder cannot have children (enforced in createFolder)
- video id: editable anytime (changeVideoId), uniqueness via PK
- routes:
  - public /folder/:topName[/:subName], /video/:topName[/:subName]/:videoId
  - admin /op/folder/:topName[/:subName], id-based /op/folders/:id/*
    and /op/videos/:id/* (rename/changeId/delete/save + idAvailable check)
- views: breadcrumb + subFolder grid; 플레이리스트 추가 button shows at 2단계
- client JS: id-based mutation endpoints, share URL data attribute,
  in-site player pushes share URL to address bar
- store.ts slimmed to Account + readAccounts (FS layer moved to storeDb)
- pickIntId accepts numeric JSON bodies

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
Claude
2026-05-31 23:36:02 +09:00
parent 3560dcb802
commit c5faa8808c
17 changed files with 1207 additions and 577 deletions

View File

@@ -3,13 +3,18 @@
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>영상 편집 · <%= folder %></title>
<title>영상 편집 · <%= breadcrumb.join(' / ') %></title>
<link rel="stylesheet" href="/static/styles.css" />
</head>
<body class="siteBody">
<%
var folderPathEnc = breadcrumb.map(function (s) { return encodeURIComponent(s) }).join('/')
var folderHref = '/op/folder/' + folderPathEnc
var folderLabel = breadcrumb.join(' / ')
%>
<header class="editorNav">
<div class="editorNavLeft">
<a class="muted" href="/op/folder/<%= encodeURIComponent(folder) %>">← <%= folder %></a>
<a class="muted" href="<%= folderHref %>">← <%= folderLabel %></a>
<input type="text" id="titleInput" class="titleInput" placeholder="영상 제목" value="<%= video ? video.title : '' %>" />
</div>
<div class="editorNavRight">
@@ -35,7 +40,7 @@
<div id="videoPanel" class="videoPanel" <% if (!video) { %>hidden<% } %>>
<video id="editVideo" controls preload="metadata"
<% if (video) { %>src="/api/video/<%= video.id %>/file?edited=0"<% } %>></video>
<% if (video) { %>src="/api/video/<%= encodeURIComponent(video.id) %>/file?edited=0"<% } %>></video>
<div class="trimTimeline">
<div class="trimTimelineHeader">
@@ -66,7 +71,8 @@
<script>
window.__EDITOR__ = {
folder: <%- jsonForScript(folder) %>,
folderPath: <%- jsonForScript(breadcrumb) %>,
folderId: <%- jsonForScript(folder.id) %>,
video: <%- jsonForScript(video) %>
}
</script>