mirror of
https://github.com/GiriNeko/YesPlayMusic.git
synced 2025-12-17 05:38:04 +00:00
feat: prettier task supported (#40)
* 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 * feat: prettier task supported * fix: prettier ignore config update * fix: conflict
This commit is contained in:
parent
56fe497db9
commit
c042faa001
44 changed files with 1755 additions and 1445 deletions
|
|
@ -4,7 +4,7 @@ import store from "@/store";
|
|||
export function isTrackPlayable(track) {
|
||||
let result = {
|
||||
playable: true,
|
||||
reason: ""
|
||||
reason: "",
|
||||
};
|
||||
if (track.fee === 1 || track.privilege?.fee === 1) {
|
||||
if (isLoggedIn && store.state.settings.user.vipType === 11) {
|
||||
|
|
@ -27,7 +27,7 @@ export function isTrackPlayable(track) {
|
|||
}
|
||||
|
||||
export function mapTrackPlayableStatus(tracks) {
|
||||
return tracks.map(t => {
|
||||
return tracks.map((t) => {
|
||||
let result = isTrackPlayable(t);
|
||||
t.playable = result.playable;
|
||||
t.reason = result.reason;
|
||||
|
|
@ -47,13 +47,13 @@ export function randomNum(minNum, maxNum) {
|
|||
}
|
||||
|
||||
export function shuffleAList(list) {
|
||||
let sortsList = list.map(t => t.sort);
|
||||
let sortsList = list.map((t) => t.sort);
|
||||
for (let i = 1; i < sortsList.length; i++) {
|
||||
const random = Math.floor(Math.random() * (i + 1));
|
||||
[sortsList[i], sortsList[random]] = [sortsList[random], sortsList[i]];
|
||||
}
|
||||
let newSorts = {};
|
||||
list.map(track => {
|
||||
list.map((track) => {
|
||||
newSorts[track.id] = sortsList.pop();
|
||||
});
|
||||
return newSorts;
|
||||
|
|
@ -65,6 +65,8 @@ export function throttle(fn, time) {
|
|||
if (isRun) return;
|
||||
isRun = true;
|
||||
fn.apply(this, arguments);
|
||||
setTimeout(() => { isRun = false }, time);
|
||||
}
|
||||
setTimeout(() => {
|
||||
isRun = false;
|
||||
}, time);
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue