Feat: Notion 배경 동기화에 태그(multi_select) 속성 추가

- 데이터베이스 속성에 '태그' multi_select 추가
- 폴더 이름에서 대괄호 안의 모든 태그 추출
  예: "[공용][야외]농구장" → ["공용", "야외"]
- ExtractAllTags() 메서드 추가

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
user 2026-01-08 01:26:40 +09:00
parent 17a9f57d59
commit f324919b10

View File

@ -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
}
/// <summary>
/// 카테고리 이름에서 태그 부분 추출 (예: "[공용]농구장" → "공용")
/// 카테고리 이름에서 첫 번째 태그 부분 추출 (예: "[공용]농구장" → "공용")
/// </summary>
private string ExtractCategory(string folderName)
{
@ -499,6 +515,35 @@ namespace Streamingle.Background.Editor
return folderName;
}
/// <summary>
/// 카테고리 이름에서 모든 태그 추출 (예: "[공용][야외]농구장" → ["공용", "야외"])
/// </summary>
private List<string> ExtractAllTags(string folderName)
{
var tags = new List<string>();
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;
}
/// <summary>
/// 파일이 Git에 커밋되어 있는지 확인
/// </summary>