From f324919b1079363c61581ea1492318f7e3a65973 Mon Sep 17 00:00:00 2001 From: user Date: Thu, 8 Jan 2026 01:26:40 +0900 Subject: [PATCH] =?UTF-8?q?Feat:=20Notion=20=EB=B0=B0=EA=B2=BD=20=EB=8F=99?= =?UTF-8?q?=EA=B8=B0=ED=99=94=EC=97=90=20=ED=83=9C=EA=B7=B8(multi=5Fselect?= =?UTF-8?q?)=20=EC=86=8D=EC=84=B1=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 데이터베이스 속성에 '태그' multi_select 추가 - 폴더 이름에서 대괄호 안의 모든 태그 추출 예: "[공용][야외]농구장" → ["공용", "야외"] - ExtractAllTags() 메서드 추가 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- .../Background/Editor/NotionBackgroundSync.cs | 49 ++++++++++++++++++- 1 file changed, 47 insertions(+), 2 deletions(-) diff --git a/Assets/Scripts/Streamingle/StreamingleControl/Background/Editor/NotionBackgroundSync.cs b/Assets/Scripts/Streamingle/StreamingleControl/Background/Editor/NotionBackgroundSync.cs index 4e708add..18c1da8e 100644 --- a/Assets/Scripts/Streamingle/StreamingleControl/Background/Editor/NotionBackgroundSync.cs +++ b/Assets/Scripts/Streamingle/StreamingleControl/Background/Editor/NotionBackgroundSync.cs @@ -157,6 +157,7 @@ namespace Streamingle.Background.Editor { // Title 속성은 이미 존재하므로 이름만 확인 ["카테고리"] = new JObject { ["select"] = new JObject { ["options"] = new JArray() } }, + ["태그"] = new JObject { ["multi_select"] = new JObject { ["options"] = new JArray() } }, ["씬 경로"] = new JObject { ["rich_text"] = new JObject() }, ["폴더 이름"] = new JObject { ["rich_text"] = new JObject() }, ["썸네일"] = new JObject { ["url"] = new JObject() }, @@ -428,13 +429,28 @@ namespace Streamingle.Background.Editor } }; - // 카테고리 (Select) + // 카테고리 (Select) - 첫 번째 태그 사용 string category = ExtractCategory(sceneInfo.categoryName); properties["카테고리"] = new JObject { ["select"] = new JObject { ["name"] = category } }; + // 태그 (Multi-Select) - 대괄호 안의 모든 태그 추출 + var tags = ExtractAllTags(sceneInfo.categoryName); + if (tags.Count > 0) + { + var tagArray = new JArray(); + foreach (var tag in tags) + { + tagArray.Add(new JObject { ["name"] = tag }); + } + properties["태그"] = new JObject + { + ["multi_select"] = tagArray + }; + } + // 씬 경로 (Rich Text) properties["씬 경로"] = new JObject { @@ -482,7 +498,7 @@ namespace Streamingle.Background.Editor } /// - /// 카테고리 이름에서 태그 부분 추출 (예: "[공용]농구장" → "공용") + /// 카테고리 이름에서 첫 번째 태그 부분 추출 (예: "[공용]농구장" → "공용") /// private string ExtractCategory(string folderName) { @@ -499,6 +515,35 @@ namespace Streamingle.Background.Editor return folderName; } + /// + /// 카테고리 이름에서 모든 태그 추출 (예: "[공용][야외]농구장" → ["공용", "야외"]) + /// + private List ExtractAllTags(string folderName) + { + var tags = new List(); + if (string.IsNullOrEmpty(folderName)) return tags; + + int searchStart = 0; + while (searchStart < folderName.Length) + { + int startBracket = folderName.IndexOf('[', searchStart); + if (startBracket < 0) break; + + int endBracket = folderName.IndexOf(']', startBracket); + if (endBracket < 0) break; + + string tag = folderName.Substring(startBracket + 1, endBracket - startBracket - 1); + if (!string.IsNullOrEmpty(tag) && !tags.Contains(tag)) + { + tags.Add(tag); + } + + searchStart = endBracket + 1; + } + + return tags; + } + /// /// 파일이 Git에 커밋되어 있는지 확인 ///