MCPcopy Create free account
hub / github.com/TeleBoxOrg/TeleBox_Plugins / buildUniquePath

Method buildUniquePath

save/save.ts:149–162  ·  view source on GitHub ↗
(dirPath: string, fileName: string)

Source from the content-addressed store, hash-verified

147 const rootDir = this.getLocalSaveRoot();
148 await fs.mkdir(rootDir, { recursive: true });
149
150 const displayName = await this.getChatDisplayName(chatId);
151 const dirName = this.sanitizePathSegment(chatId, "chat");
152 const chatDir = path.join(rootDir, dirName);
153 await fs.mkdir(chatDir, { recursive: true });
154
155 return { rootDir, chatDir, displayName };
156 }
157
158 private getLocalChatRelativeDirectory(chatId: string): string {
159 const chatDir = path.join(this.getLocalSaveRoot(), this.sanitizePathSegment(chatId, "chat"));
160 return path.relative(process.cwd(), chatDir) || chatDir;
161 }
162
163 private formatLocalDirectorySummary(savedFiles: LocalSavedFile[]): string {
164 const directories = Array.from(
165 new Set(savedFiles.map((file) => this.getLocalChatRelativeDirectory(file.sourceChatId)))

Callers 3

saveLocalMetadataMethod · 0.95
saveMediaToLocalMethod · 0.95
writeLocalSaveIndexMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected