fix(tuna-obs): Added song url to tuna-obs plugin (#2524)

This commit is contained in:
Tim ^.^
2024-10-21 02:16:41 +01:00
committed by GitHub
parent 980068217c
commit ad9571550f

View File

@ -16,6 +16,7 @@ interface Data {
progress: number; progress: number;
status: string; status: string;
title: string; title: string;
url: string;
} }
export default createPlugin({ export default createPlugin({
@ -37,6 +38,7 @@ export default createPlugin({
duration: 0, duration: 0,
album_url: '', album_url: '',
album: undefined, album: undefined,
url: '',
} as Data, } as Data,
start({ ipc }) { start({ ipc }) {
const secToMilisec = (t: number) => Math.round(Number(t) * 1e3); const secToMilisec = (t: number) => Math.round(Number(t) * 1e3);
@ -106,6 +108,7 @@ export default createPlugin({
this.data.artists = [songInfo.artist]; this.data.artists = [songInfo.artist];
this.data.status = songInfo.isPaused ? 'stopped' : 'playing'; this.data.status = songInfo.isPaused ? 'stopped' : 'playing';
this.data.album = songInfo.album; this.data.album = songInfo.album;
this.data.url = songInfo.url ?? '';
post(this.data); post(this.data);
}); });
}, },