fix: scrobble error params type (#38)

* feat: add config to resolve path alias.

* feat: use vue-i18n for language switch

* feat: add .editorconfig for ide

* fix: add no-referrer to avoid CROB

* fix: setCookie and fix typo

* feat: integrate vue-i18n

* feat: player component i18n support

* fix: duplicate key warning in explore page

* fix: like songs number changed in library page

* fire: remove todo

* fix: same text search on enter will cause error

* fix: scrobble error params type
master
Hawtim Zhang 4 years ago committed by GitHub
parent 87fe3e9ff2
commit e4693b1bdf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -7,14 +7,24 @@ export default {
getTrackDetail(basicTrack.id).then(data => { getTrackDetail(basicTrack.id).then(data => {
let track = data.songs[0]; let track = data.songs[0];
track.sort = basicTrack.sort; track.sort = basicTrack.sort;
// 获取当前的播放时间。初始化为 loading 状态时返回 howler 的实例而不是浮点数时间,比如 1.332
let time = state.howler.seek(); let time = state.howler.seek();
let currentTime = 0
if (time === 0) {
// state.howler._duration 可以获得当前实例的播放时长
currentTime = 180
}
if (time.toString() === '[object Object]') {
currentTime = 0
}
if (time > 0) {
currentTime = time
}
scrobble({ scrobble({
id: state.player.currentTrack.id, id: state.player.currentTrack.id,
sourceid: state.player.listInfo.id, sourceid: state.player.listInfo.id,
time: time === 0 ? 180 : time time: currentTime
}); })
commit("updateCurrentTrack", track); commit("updateCurrentTrack", track);
updateMediaSessionMetaData(track); updateMediaSessionMetaData(track);
document.title = `${track.name} · ${track.ar[0].name} - YesPlayMusic`; document.title = `${track.name} · ${track.ar[0].name} - YesPlayMusic`;

Loading…
Cancel
Save