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:
Hawtim Zhang 2020-10-22 21:44:34 +08:00 committed by GitHub
parent 56fe497db9
commit c042faa001
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
44 changed files with 1755 additions and 1445 deletions

View file

@ -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);
};
}