- NotionSyncSettings.GetGitRawUrl() 메서드 수정 - 경로의 각 세그먼트를 Uri.EscapeDataString()으로 인코딩 - 슬래시(/)는 유지하면서 한글 문자만 인코딩 - 예: [공용]루프탑 카페 → %5B%EA%B3%B5%EC%9A%A9%5D%EB%A3%A8%ED%94%84%ED%83%91%20%EC%B9%B4%ED%8E%98 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
86 lines
3.2 KiB
C#
86 lines
3.2 KiB
C#
using System;
|
|
using UnityEngine;
|
|
|
|
namespace Streamingle.Background.Editor
|
|
{
|
|
/// <summary>
|
|
/// Notion 동기화 설정을 저장하는 ScriptableObject
|
|
/// </summary>
|
|
[CreateAssetMenu(fileName = "NotionSyncSettings", menuName = "Streamingle/Notion Sync Settings")]
|
|
public class NotionSyncSettings : ScriptableObject
|
|
{
|
|
[Header("Notion API 설정")]
|
|
[Tooltip("Notion Integration Token (ntn_xxx... 또는 secret_xxx...)")]
|
|
public string notionApiToken = "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";
|
|
|
|
[Tooltip("Notion Database ID (32자리 hex) - 배경 일람")]
|
|
public string notionDatabaseId = "25ea7d46b958805f88fcf127979934bf";
|
|
|
|
[Header("Git 설정")]
|
|
[Tooltip("Git 서버 URL (예: https://kindnick-git.duckdns.org)")]
|
|
public string gitServerUrl = "https://kindnick-git.duckdns.org";
|
|
|
|
[Tooltip("Git 리포지토리 경로 (예: kindnick/Streamingle_URP)")]
|
|
public string gitRepoPath = "kindnick/Streamingle_URP";
|
|
|
|
[Tooltip("Git 브랜치 (예: main)")]
|
|
public string gitBranch = "main";
|
|
|
|
[Header("동기화 설정")]
|
|
[Tooltip("썸네일 캡처 시 자동 동기화")]
|
|
public bool autoSyncOnCapture = false;
|
|
|
|
[Tooltip("배경 씬 로드 시 사용 이력 기록")]
|
|
public bool trackUsageHistory = true;
|
|
|
|
[Header("썸네일 설정")]
|
|
[Tooltip("썸네일 너비")]
|
|
public int thumbnailWidth = 1920;
|
|
|
|
[Tooltip("썸네일 높이 (16:9 비율)")]
|
|
public int thumbnailHeight = 1080;
|
|
|
|
/// <summary>
|
|
/// Git Raw 파일 URL 생성 (Gitea/Gogs 형식)
|
|
/// </summary>
|
|
public string GetGitRawUrl(string assetPath)
|
|
{
|
|
// Assets/ResourcesData/Background/... 형식의 경로를 Git Raw URL로 변환
|
|
// Gitea Raw URL 형식: {serverUrl}/{repoPath}/raw/branch/{branch}/{filePath}
|
|
string relativePath = assetPath.Replace("\\", "/");
|
|
|
|
// 경로의 각 세그먼트를 URL 인코딩 (슬래시는 유지)
|
|
string[] segments = relativePath.Split('/');
|
|
for (int i = 0; i < segments.Length; i++)
|
|
{
|
|
segments[i] = Uri.EscapeDataString(segments[i]);
|
|
}
|
|
string encodedPath = string.Join("/", segments);
|
|
|
|
return $"{gitServerUrl}/{gitRepoPath}/raw/branch/{gitBranch}/{encodedPath}";
|
|
}
|
|
|
|
/// <summary>
|
|
/// 설정이 유효한지 확인
|
|
/// </summary>
|
|
public bool IsValid()
|
|
{
|
|
return !string.IsNullOrEmpty(notionApiToken) &&
|
|
!string.IsNullOrEmpty(notionDatabaseId) &&
|
|
!string.IsNullOrEmpty(gitServerUrl) &&
|
|
!string.IsNullOrEmpty(gitRepoPath);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Notion API Token이 설정되었는지 확인
|
|
/// </summary>
|
|
public bool HasNotionToken => !string.IsNullOrEmpty(notionApiToken) &&
|
|
(notionApiToken.StartsWith("secret_") || notionApiToken.StartsWith("ntn_"));
|
|
|
|
/// <summary>
|
|
/// Database ID가 유효한 형식인지 확인
|
|
/// </summary>
|
|
public bool HasValidDatabaseId => !string.IsNullOrEmpty(notionDatabaseId) && notionDatabaseId.Length >= 32;
|
|
}
|
|
}
|