Add separate Suno MP3 and WAV actions
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
// ==UserScript==
|
// ==UserScript==
|
||||||
// @name ChatGPT to Suno Prompt Copier
|
// @name ChatGPT to Suno Prompt Copier
|
||||||
// @namespace local.suno-helper
|
// @namespace local.suno-helper
|
||||||
// @version 0.8.3
|
// @version 0.8.4
|
||||||
// @description Copy structured ChatGPT song prompt versions into Suno fields.
|
// @description Copy structured ChatGPT song prompt versions into Suno fields.
|
||||||
// @author local
|
// @author local
|
||||||
// @match https://chatgpt.com/*
|
// @match https://chatgpt.com/*
|
||||||
@@ -28,7 +28,7 @@
|
|||||||
(function () {
|
(function () {
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
const SCRIPT_VERSION = "0.8.3";
|
const SCRIPT_VERSION = "0.8.4";
|
||||||
const STORAGE_KEY = "chatgptSunoPromptSlots";
|
const STORAGE_KEY = "chatgptSunoPromptSlots";
|
||||||
const SLOT_COUNT = 2;
|
const SLOT_COUNT = 2;
|
||||||
const isChatGPT = location.hostname.includes("chatgpt.com") || location.hostname.includes("chat.openai.com");
|
const isChatGPT = location.hostname.includes("chatgpt.com") || location.hostname.includes("chat.openai.com");
|
||||||
@@ -1470,7 +1470,8 @@
|
|||||||
<option value="">감지된 곡 없음</option>
|
<option value="">감지된 곡 없음</option>
|
||||||
</select>
|
</select>
|
||||||
<div class="cgs-row">
|
<div class="cgs-row">
|
||||||
<button class="cgs-btn cgs-wide" type="button" data-cgs-process-one>선택 1곡 MP3</button>
|
<button class="cgs-btn cgs-wide" type="button" data-cgs-process-one-mp3>선택 1곡 MP3</button>
|
||||||
|
<button class="cgs-btn cgs-wide" type="button" data-cgs-process-one-wav>선택 1곡 WAV</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="cgs-row">
|
<div class="cgs-row">
|
||||||
<button class="cgs-btn cgs-wide" type="button" data-cgs-test-companion>연결 테스트</button>
|
<button class="cgs-btn cgs-wide" type="button" data-cgs-test-companion>연결 테스트</button>
|
||||||
@@ -1479,7 +1480,10 @@
|
|||||||
<button class="cgs-btn cgs-wide" type="button" data-cgs-copy-diagnostics>진단 복사</button>
|
<button class="cgs-btn cgs-wide" type="button" data-cgs-copy-diagnostics>진단 복사</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="cgs-row">
|
<div class="cgs-row">
|
||||||
<button class="cgs-btn cgs-primary cgs-wide" type="button" data-cgs-process-library>MP3 일괄 + 메타데이터</button>
|
<button class="cgs-btn cgs-primary cgs-wide" type="button" data-cgs-process-library-mp3>MP3 일괄 + 메타데이터</button>
|
||||||
|
</div>
|
||||||
|
<div class="cgs-row">
|
||||||
|
<button class="cgs-btn cgs-primary cgs-wide" type="button" data-cgs-process-library-wav>WAV 일괄 + FLAC 메타</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="cgs-status"></div>
|
<div class="cgs-status"></div>
|
||||||
`;
|
`;
|
||||||
@@ -1548,7 +1552,7 @@
|
|||||||
setStatus(body, `${networkHint} 목록 새로고침이나 스크롤 후 다시 눌러봐. 화면 텍스트: ${visibleHints.join(", ")}`);
|
setStatus(body, `${networkHint} 목록 새로고침이나 스크롤 후 다시 눌러봐. 화면 텍스트: ${visibleHints.join(", ")}`);
|
||||||
});
|
});
|
||||||
|
|
||||||
body.querySelector("[data-cgs-process-one]").addEventListener("click", async () => {
|
const processSelectedTrack = async (format) => {
|
||||||
if (!libraryTracks.length) {
|
if (!libraryTracks.length) {
|
||||||
libraryTracks = scanSunoLibraryTracks();
|
libraryTracks = scanSunoLibraryTracks();
|
||||||
renderLibraryTrackSelect();
|
renderLibraryTrackSelect();
|
||||||
@@ -1561,24 +1565,40 @@
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
const data = await uploadTrackToCompanion(track, body, "mp3");
|
const data = await uploadTrackToCompanion(track, body, format);
|
||||||
setStatus(body, `선택 1곡 업로드 완료: ${track.title || track.id} / 대기 ${data.queued ?? "?"}개 / 처리 ${data.active || "대기"}`);
|
setStatus(body, `선택 1곡 ${format.toUpperCase()} 업로드 완료: ${track.title || track.id} / 대기 ${data.queued ?? "?"}개 / 처리 ${data.active || "대기"}`);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
setStatus(body, `선택 1곡 처리 실패: ${error.message || error}`);
|
setStatus(body, `선택 1곡 ${format.toUpperCase()} 처리 실패: ${error.message || error}`);
|
||||||
}
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
body.querySelector("[data-cgs-process-one-mp3]").addEventListener("click", async () => {
|
||||||
|
await processSelectedTrack("mp3");
|
||||||
});
|
});
|
||||||
|
|
||||||
body.querySelector("[data-cgs-process-library]").addEventListener("click", async () => {
|
body.querySelector("[data-cgs-process-one-wav]").addEventListener("click", async () => {
|
||||||
|
await processSelectedTrack("wav");
|
||||||
|
});
|
||||||
|
|
||||||
|
const processLibraryTracks = async (format) => {
|
||||||
if (!libraryTracks.length) {
|
if (!libraryTracks.length) {
|
||||||
libraryTracks = scanSunoLibraryTracks();
|
libraryTracks = scanSunoLibraryTracks();
|
||||||
renderLibraryTrackSelect();
|
renderLibraryTrackSelect();
|
||||||
}
|
}
|
||||||
updateSummary();
|
updateSummary();
|
||||||
try {
|
try {
|
||||||
await uploadTracksToCompanion(libraryTracks, body, "mp3");
|
await uploadTracksToCompanion(libraryTracks, body, format);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
setStatus(body, `MP3 일괄 처리 실패: ${error.message || error}`);
|
setStatus(body, `${format.toUpperCase()} 일괄 처리 실패: ${error.message || error}`);
|
||||||
}
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
body.querySelector("[data-cgs-process-library-mp3]").addEventListener("click", async () => {
|
||||||
|
await processLibraryTracks("mp3");
|
||||||
|
});
|
||||||
|
|
||||||
|
body.querySelector("[data-cgs-process-library-wav]").addEventListener("click", async () => {
|
||||||
|
await processLibraryTracks("wav");
|
||||||
});
|
});
|
||||||
|
|
||||||
body.querySelector("[data-cgs-test-companion]").addEventListener("click", async () => {
|
body.querySelector("[data-cgs-test-companion]").addEventListener("click", async () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user