Skip to content

Commit

Permalink
v2.18.6
Browse files Browse the repository at this point in the history
  • Loading branch information
Dooy committed Jun 17, 2024
1 parent 3cec4de commit cb7a097
Show file tree
Hide file tree
Showing 14 changed files with 244 additions and 17 deletions.
4 changes: 4 additions & 0 deletions changlog.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# 功能升级日志

# 计划
# 2.18.6
- 😄 升级:suno支持延伸
- 😄 升级:suno支持 以音频生成音频(需要用到延伸)

# 2.18.5
- 😄 升级:将suno可版本选择 v3 v3.5
- 🐞 修复:suno 生成失败 error 状态
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "chatgpt-web-midjourney-proxy",
"version": "2.18.5",
"version": "2.18.6",
"private": false,
"description": "ChatGPT Web Midjourney Proxy",
"author": "Dooy <[email protected]>",
Expand Down
2 changes: 1 addition & 1 deletion src-tauri/tauri.conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
},
"package": {
"productName": "ChatGPT-MJ",
"version": "2.18.5"
"version": "2.18.6"
},
"tauri": {
"allowlist": {
Expand Down
7 changes: 7 additions & 0 deletions src/locales/en-US.ts
Original file line number Diff line number Diff line change
Expand Up @@ -407,6 +407,13 @@ export default {
"server": "Suno API Endpoint",
"serverabout": "Suno Related",
"setOpenKeyPlaceholder": "Related KEY for Suno API; optional"

,upMps:'Upload'
,extend:'Extend'
,extendFrom:'Extend From'
,extendAt:'Extend at'
,fail:'Fail'
,info:'Note: <br> Uploaded audio must be between 6 seconds and 60 seconds in duration.'
}


Expand Down
9 changes: 8 additions & 1 deletion src/locales/fr-FR.ts
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,14 @@ export default {
"menuinfo": "Création musicale Suno",
"server": "Point de terminaison de l'API Suno",
"serverabout": "Lié à Suno",
"setOpenKeyPlaceholder": "Clé associée pour l'API Suno ; facultatif"
"setOpenKeyPlaceholder": "Clé associée pour l'API Suno ; facultatif",

upMps: 'Télécharger l\'audio',
extend: 'Étendre',
extendFrom: 'Étendre depuis',
extendAt: 'Commencer l\'extension à',
fail: 'Échec',
info: 'Instructions :<br>La durée de l\'audio téléchargé doit être comprise entre 6s et 60s'

}
}
10 changes: 9 additions & 1 deletion src/locales/ko-KR.ts
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,14 @@ export default {
"menuinfo": "Suno 음악 생성",
"server": "Suno API 엔드포인트",
"serverabout": "Suno 관련",
"setOpenKeyPlaceholder": "Suno API에 대한 관련 키; 선택 사항"
"setOpenKeyPlaceholder": "Suno API에 대한 관련 키; 선택 사항",

upMps: '오디오 업로드',
extend: '확장',
extendFrom: '출처',
extendAt: '시작',
fail: '실패',
info: '설명:<br>오디오 업로드 시간은 6초에서 60초 사이여야 합니다'

}
}
10 changes: 9 additions & 1 deletion src/locales/ru-RU.ts
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,15 @@ export default {
"menuinfo": "Создание музыки Suno",
"server": "Конечная точка API Suno",
"serverabout": "Связанные с Suno",
"setOpenKeyPlaceholder": "Связанный ключ для API Suno; необязательно"
"setOpenKeyPlaceholder": "Связанный ключ для API Suno; необязательно",

upMps: 'Загрузить аудио',
extend: 'Расширить',
extendFrom: 'Расширить от',
extendAt: 'Расширение начинается с',
fail: 'Неудача',
info: 'Инструкции:<br>Длительность загружаемого аудио должна быть от 6 до 60 секунд'


}
}
9 changes: 8 additions & 1 deletion src/locales/tr-TR.ts
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,14 @@ export default {
"menuinfo": "Suno Müzik Oluşturma",
"server": "Suno API Uç Noktası",
"serverabout": "Suno İlgili",
"setOpenKeyPlaceholder": "Suno API için İlgili Anahtar; isteğe bağlı"
"setOpenKeyPlaceholder": "Suno API için İlgili Anahtar; isteğe bağlı",

upMps: 'Ses yükle',
extend: 'Genişlet',
extendFrom: 'Şundan genişlet',
extendAt: 'Genişletmeyi başlat',
fail: 'Başarısız',
info: 'Açıklamalar:<br>Yüklenen sesin süresi 6 saniye ile 60 saniye arasında olmalıdır'
}

}
10 changes: 9 additions & 1 deletion src/locales/vi-VN.ts
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,14 @@ export default {
"menuinfo": "Sáng tạo âm nhạc Suno",
"server": "Điểm cuối API Suno",
"serverabout": "Liên quan đến Suno",
"setOpenKeyPlaceholder": "Khóa liên quan cho API Suno; tùy chọn"
"setOpenKeyPlaceholder": "Khóa liên quan cho API Suno; tùy chọn",

upMps: 'Tải lên âm thanh',
extend: 'Mở rộng',
extendFrom: 'Mở rộng từ',
extendAt: 'Bắt đầu mở rộng từ',
fail: 'Thất bại',
info: 'Hướng dẫn:<br>Thời lượng tải lên âm thanh phải từ 6 giây đến 60 giây'

}
}
9 changes: 8 additions & 1 deletion src/locales/zh-CN.ts
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ export default {
,addPlaceholder:'将GPTs的gid贴这儿 也可直接贴gpts的链接'
,gidError:'未找到有效的gid,请重新填写'
,success3:'新增GPTs成功!'

},
mj:{
setOpen:'OpenAI 相关',
Expand Down Expand Up @@ -414,6 +414,13 @@ export default {
,server:'Suno 接口地址'
,serverabout:'Suno 相关'
,setOpenKeyPlaceholder:'Suno API 的相关KEY;可不填'

,upMps:'上传音频'
,extend:'延伸'
,extendFrom:'延伸于'
,extendAt:'延伸开始于'
,fail:'失败'
,info:'说明:<br>上传音频时长必须在6s-60s内'
}


Expand Down
9 changes: 8 additions & 1 deletion src/locales/zh-TW.ts
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,14 @@ export default {
"menuinfo": "Suno 音樂創作",
"server": "Suno API 端點",
"serverabout": "Suno 相關",
"setOpenKeyPlaceholder": "Suno API 的相關KEY;可不填"
"setOpenKeyPlaceholder": "Suno API 的相關KEY;可不填",

upMps: '上載音頻',
extend: '擴展',
extendFrom: '擴展自',
extendAt: '擴展始於',
fail: '失敗',
info: '說明:<br>上載音頻的持續時間必須在6秒到60秒之間'

}
}
83 changes: 79 additions & 4 deletions src/views/suno/mcInput.vue
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
<script setup lang="ts">
import { ref,computed ,onMounted} from 'vue';
import { NTabs ,NTabPane ,NInput,NSwitch ,NTooltip, NTag ,NButton, useMessage,NSelect} from "naive-ui";
import { ref,computed ,onMounted, watch} from 'vue';
import { NTabs ,NTabPane ,NInput,NSwitch ,NTooltip, NTag ,NButton, useMessage,NSelect, NImage, NSlider} from "naive-ui";
import { SvgIcon } from '@/components/common';
import { mlog } from '@/api';
import { sunoFetch ,lyricsFetch, randStyle, FeedTask} from '@/api/suno';
import { t } from '@/locales';
import { homeStore } from '@/store';
import { SunoMedia } from '@/api/sunoStore';
import mcUploaderMp3 from './mcUploadMp3.vue'
const st = ref({type:'custom',isLoading:false})
const exSuno= ref<SunoMedia>()
const des= ref( {
"gpt_description_prompt": "",
"make_instrumental": false,
Expand Down Expand Up @@ -82,11 +85,16 @@ const generate= async ()=>{
if(st.value.type=='custom'){
if(des.value.make_instrumental) cs.value.prompt='';
if( cs.value.continue_clip_id!='' && exSuno.value?.metadata?.type=='upload' ){
//chirp-v3-5-upload
cs.value.mv='chirp-v3-5-upload'
}
let r:any= await sunoFetch( '/generate' , cs.value )
st.value.isLoading =false;
ids=r.clips.map((r:any)=>r.id);
mlog('ids ', ids );
mlog('ids ', ids );
if( cs.value.mv='chirp-v3-5-upload' ) cs.value.mv='chirp-v3-5'
}else{
des.value.prompt=cs.value.title;
let r:any= await sunoFetch( '/generate/description-mode' , des.value )
Expand All @@ -96,6 +104,20 @@ const generate= async ()=>{
FeedTask(ids)
}
watch(()=>homeStore.myData.act, (n)=>{
if(n=='suno.extend'){
mlog("suno.extend", homeStore.myData.actData )
const s= homeStore.myData.actData as SunoMedia
exSuno.value= s
cs.value.continue_clip_id= s.id
cs.value.continue_at= Math.ceil(s.metadata.duration/2)
}
});
</script>
<template>
<div class="p-2">
Expand Down Expand Up @@ -181,17 +203,70 @@ const generate= async ()=>{
<div class="pt-1">
<n-select v-model:value="cs.mv" :options="mvOption" size="small" />
</div>
<template v-if="cs.continue_clip_id && exSuno">
<div class="pt-5">
<div class="flex justify-between pb-3">
<div class="text-[12px]"> {{ $t('suno.extendAt') }} {{ cs.continue_at }}s</div>
<NTag type="success" size="small" round ><span class="cursor-pointer" @click="cs.continue_clip_id=''" >清除</span></NTag>

</div>
<n-slider v-model:value="cs.continue_at" :step="1" :max="Math.ceil( exSuno.metadata.duration)">
<template #thumb>
<div class="bg-[--n-fill-color] text-[9px] border-[0px] px-1 list-none rounded-md">{{ cs.continue_at }}s</div>
</template>
</n-slider>
</div>
<div class="pt-1" >
<div class="flex relative justify-between items-start p-2 hover:dark:bg-black hover:bg-gray-200 border-b-[1px] border-gray-500/10 ">
<div class="w-[60px] h-[60px] relative cursor-pointer" >
<n-image lazy width="100" :src="exSuno.image_url" preview-disabled >
<template #placeholder>
<div class="w-full h-full justify-center items-center flex" >
<SvgIcon icon="line-md:downloading-loop" class="text-[40px] text-green-300" ></SvgIcon>
</div>
</template>
</n-image>
</div>
<div class="flex-1 pl-2">
<div class="flex justify-between line-clamp-1 w-full cursor-pointer" >
<h3>{{exSuno.title}}</h3>
<!-- <div class="opacity-80" >{{exSuno.metadata.tags}}</div> -->
</div>
<div class="opacity-60 line-clamp-1 w-full text-[12px] cursor-pointer" v-if="exSuno.metadata && exSuno.metadata.prompt">
{{exSuno.metadata.prompt}}
</div>
<div class="opacity-60 line-clamp-1 w-full text-[12px] cursor-pointer" v-else>
{{$t('suno.noly')}}
</div>
<div class="text-right text-[14px] flex justify-end items-center space-x-2 ">

<div v-if="exSuno.status=='error'" class="text-[8px] flex items-center border-[1px] border-red-500/80 px-1 list-none rounded-md ">失败</div>
<template v-if="exSuno.metadata && exSuno.metadata.duration">
<div class="text-[8px] flex items-center border-[1px] border-gray-500/30 px-1 list-none rounded-md" > {{exSuno.metadata.duration.toFixed(1)}}s</div>
</template>
<div class="text-[8px] flex items-center border-[1px] border-gray-500/30 px-1 list-none rounded-md" v-if="exSuno.major_model_version"> {{exSuno.major_model_version}}</div>
</div>
</div>
</div>
</div>
</template>
</n-tab-pane>
</n-tabs>

<div class="pt-4">
<div class="flex justify-between items-start">
<div>
<div class=" space-x-1">
<NTag v-if="st.type=='custom'" type="success" size="small" round ><span class="cursor-pointer" @click="generateLyrics()" >{{ $t('suno.generately') }}</span></NTag>
<!-- <NTag v-if="st.type=='custom'" type="success" size="small" round ><span class="cursor-pointer" @click="generateLyrics()" >上传音频</span></NTag> -->
<mcUploaderMp3 v-if="st.type=='custom'"/>
</div>
<NButton type="primary" :disabled="!canPost" @click="generate()"><SvgIcon icon="ri:music-fill" /> {{$t('suno.generate')}}</NButton>
</div>


</div>
<div v-if="st.type=='custom'" class="pt-4 text-[12px]" v-html="t('suno.info')"> </div>

</div>

</template>
31 changes: 27 additions & 4 deletions src/views/suno/mcList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,12 @@ const goPlay=(v:SunoMedia)=>{
}
}
const extend=(v:SunoMedia)=>{
mlog("extend", extend )
//homeStore.myData.actData
homeStore.setMyData({act:"suno.extend", actData: v })
}
const sp= ref({v:10, max:0 ,status:'',idDrop:false });
watch(()=>homeStore.myData.act, (n)=>{
Expand All @@ -54,6 +60,15 @@ watch(()=>homeStore.myData.act, (n)=>{
}
});
const getExSuno=(id:string)=>{
id= id.replace("m_",'');
let index= list.value.findIndex(v=>v.id==id);
if (index<0){
return null ;
}
return list.value[index];
}
const update = (v:any )=>{
sp.value=v
Expand Down Expand Up @@ -92,7 +107,10 @@ initLoad();
</div>
<div class="flex-1 pl-2">
<div class="flex justify-between line-clamp-1 w-full cursor-pointer" @click="goPlay( item )">
<h3>{{item.title}}</h3>
<div class="flex justify-start items-center">
<h3 >{{item.title}}</h3>
<div class="text-[8px] flex items-center border-[1px] border-gray-500/30 px-1 ml-1 list-none rounded-md" v-if="item.metadata?.type=='upload'" >Uploaded</div>
</div>
<div class="opacity-80" >{{item.metadata.tags}}</div>
</div>
<div class="opacity-60 line-clamp-1 w-full text-[12px] cursor-pointer" @click="goPlay( item )" v-if="item.metadata && item.metadata.prompt">
Expand All @@ -102,10 +120,15 @@ initLoad();
{{$t('suno.noly')}}
</div>
<div class="text-right text-[14px] flex justify-end items-center space-x-2 ">

<div v-if="item.status=='error'" class="text-[8px] flex items-center border-[1px] border-red-500/80 px-1 list-none rounded-md ">失败</div>
<div class="text-[8px] flex items-center border-[1px] border-gray-500/30 px-1 list-none rounded-md" v-if="item.metadata?.audio_prompt_id">
{{ $t('suno.extendFrom') }}:{{ getExSuno(item.metadata?.audio_prompt_id)?.title }}
</div>
<div v-if="item.status=='error'" class="text-[8px] flex items-center border-[1px] border-red-500/80 px-1 list-none rounded-md ">{{ $t('suno.fail') }}</div>
<template v-if="item.metadata && item.metadata.duration">
<div class="text-[8px] flex items-center border-[1px] border-gray-500/30 px-1 list-none rounded-md" > {{item.metadata.duration.toFixed(1)}}s</div>
<div @click="extend(item)" class="text-[8px] flex items-center border-[1px] border-gray-500/30 px-1 list-none rounded-md cursor-pointer">{{ $t('suno.extend') }}</div>
</template>
<div class="text-[8px] flex items-center border-[1px] border-gray-500/30 px-1 list-none rounded-md" v-if="item.major_model_version"> {{item.major_model_version}}</div>
<div class="text-[8px] flex items-center border-[1px] border-gray-500/30 px-1 list-none rounded-md" v-if="item.metadata && item.metadata.duration"> {{item.metadata.duration.toFixed(1)}}s</div>
<SvgIcon icon="mdi:play-circle-outline" class="cursor-pointer" @click="goPlay( item )" />
<a :href="item.audio_url" download target="_blank"><SvgIcon icon="mdi:download" class="cursor-pointer"/></a>
</div>
Expand Down
Loading

0 comments on commit cb7a097

Please sign in to comment.