feat(folders): allow videos in top-level folders too

1단계 폴더에도 영상을 직접 추가할 수 있게 한다 (하위 폴더와 혼합 가능).
플레이리스트 추가는 기존대로 2단계 폴더 한정.

- op.ts: editor/upload/youtube start 의 parentId===null 차단 제거
  (playlist probe/start/new 차단은 유지)
- op/folder.ejs: 1단계에서 "하위 폴더 추가"+"영상 추가" 동시 노출,
  서브폴더 그리드와 영상 그리드를 함께 표시
- folder.ejs(public): 1단계에서 하위 폴더 + 영상 함께 표시
- README: 폴더 구조/버튼 설명 갱신

Co-Authored-By: Claude Opus 4 <noreply@anthropic.com>
This commit is contained in:
Claude (owner)
2026-06-01 22:12:37 +09:00
parent ad42c88eaf
commit 0e39836c1f
4 changed files with 46 additions and 51 deletions

View File

@@ -30,7 +30,7 @@
<% if (!isSubFolder) { %>
<section class="folderGrid">
<% if (!subFolders || subFolders.length === 0) { %>
<% if ((!subFolders || subFolders.length === 0) && videos.length === 0) { %>
<p class="muted">아직 하위 폴더가 없습니다.</p>
<% } %>
<% (subFolders || []).forEach(function (sf) { %>
@@ -40,22 +40,22 @@
</a>
<% }) %>
</section>
<% } else { %>
<section class="videoGrid">
<% if (videos.length === 0) { %>
<p class="muted">이 폴더에 영상이 없습니다.</p>
<% } %>
<% videos.forEach(function (v) {
var shareUrl = '/video/' + folderPathEnc + '/' + encodeURIComponent(v.id)
%>
<a class="videoCard" href="<%= shareUrl %>"
data-video-id="<%= v.id %>" data-share-url="<%= shareUrl %>">
<div class="videoThumb">▶</div>
<div class="videoTitle"><%= v.title %></div>
</a>
<% }) %>
</section>
<% } %>
<section class="videoGrid">
<% if (videos.length === 0 && isSubFolder) { %>
<p class="muted">이 폴더에 영상이 없습니다.</p>
<% } %>
<% videos.forEach(function (v) {
var shareUrl = '/video/' + folderPathEnc + '/' + encodeURIComponent(v.id)
%>
<a class="videoCard" href="<%= shareUrl %>"
data-video-id="<%= v.id %>" data-share-url="<%= shareUrl %>">
<div class="videoThumb">▶</div>
<div class="videoTitle"><%= v.title %></div>
</a>
<% }) %>
</section>
</main>
<div class="ctxMenu" id="ctxMenu" hidden>

View File

@@ -26,8 +26,9 @@
<div class="dashboardActions">
<% if (!isSubFolder) { %>
<button type="button" class="primaryButton" id="addSubFolderBtn">하위 폴더 추가</button>
<% } else { %>
<a class="primaryButton" href="<%= editorHref %>">영상 추가</a>
<% } %>
<a class="primaryButton" href="<%= editorHref %>">영상 추가</a>
<% if (isSubFolder) { %>
<a class="primaryButton" href="<%= playlistHref %>">플레이리스트 추가</a>
<% } %>
</div>
@@ -36,7 +37,7 @@
<% if (!isSubFolder) { %>
<section class="folderGrid" id="subFolderGrid">
<% if (!subFolders || subFolders.length === 0) { %>
<p class="muted">아직 하위 폴더가 없습니다. 우측 상단에서 하위 폴더를 추가하세요. (영상은 하위 폴더 안에서만 추가할 수 있습니다.)</p>
<p class="muted">아직 하위 폴더가 없습니다. 우측 상단에서 하위 폴더를 추가하세요. (영상도 이 폴더에 바로 추가할 수 있습니다.)</p>
<% } %>
<% (subFolders || []).forEach(function (sf) { %>
<div class="folderCard adminFolder" data-folder-id="<%= sf.id %>" data-name="<%= sf.name %>">
@@ -47,28 +48,28 @@
</div>
<% }) %>
</section>
<% } else { %>
<section class="videoGrid" id="videoGrid">
<% if (videos.length === 0) { %>
<p class="muted">이 폴더에 영상이 없습니다. 우측 상단에서 영상을 추가하세요.</p>
<% } %>
<% videos.forEach(function (v) {
var shareUrl = '/video/' + folderPathEnc + '/' + encodeURIComponent(v.id)
%>
<div class="videoCard adminVideo"
data-id="<%= v.id %>"
data-video-id="<%= v.id %>"
data-title="<%= v.title %>"
data-share-url="<%= shareUrl %>">
<div class="videoThumb">▶</div>
<div class="videoTitle"><%= v.title %></div>
<% if (v.sourceType === 'youtube') { %>
<div class="muted">YouTube</div>
<% } %>
</div>
<% }) %>
</section>
<% } %>
<section class="videoGrid" id="videoGrid">
<% if (videos.length === 0) { %>
<p class="muted">이 폴더에 영상이 없습니다. 우측 상단에서 영상을 추가하세요.</p>
<% } %>
<% videos.forEach(function (v) {
var shareUrl = '/video/' + folderPathEnc + '/' + encodeURIComponent(v.id)
%>
<div class="videoCard adminVideo"
data-id="<%= v.id %>"
data-video-id="<%= v.id %>"
data-title="<%= v.title %>"
data-share-url="<%= shareUrl %>">
<div class="videoThumb">▶</div>
<div class="videoTitle"><%= v.title %></div>
<% if (v.sourceType === 'youtube') { %>
<div class="muted">YouTube</div>
<% } %>
</div>
<% }) %>
</section>
</main>
<div class="ctxMenu" id="ctxMenu" hidden>