diff --git a/.envrc b/.envrc
deleted file mode 100644
index fd24c66..0000000
--- a/.envrc
+++ /dev/null
@@ -1,4 +0,0 @@
-source_url "https://raw.githubusercontent.com/cachix/devenv/82c0147677e510b247d8b9165c54f73d32dfd899/direnvrc" "sha256-7u4iDd1nZpxL4tCzmPG0dQgC5V+/44Ba+tHkPob1v2k="
-
-export NIXPKGS_ALLOW_INSECURE=1
-use devenv
diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index 4caf481..8a103f3 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -81,7 +81,6 @@ jobs:
- name: Build/release Electron app
uses: samuelmeuli/action-electron-builder@v1.6.0
env:
- VUE_APP_NETEASE_API_URL: /api
VUE_APP_ELECTRON_API_URL: /api
VUE_APP_ELECTRON_API_URL_DEV: http://127.0.0.1:10754
VUE_APP_LASTFM_API_KEY: 09c55292403d961aa517ff7f5e8a3d9c
diff --git a/.gitignore b/.gitignore
index d8dd8fc..b96fe0f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -32,12 +32,3 @@ NeteaseCloudMusicApi-master.zip
# Local Netlify folder
.netlify
vercel.json
-# Devenv
-.devenv*
-devenv.local.nix
-
-# direnv
-.direnv
-
-# pre-commit
-.pre-commit-config.yaml
diff --git a/README.md b/README.md
index 146f524..35018c4 100644
--- a/README.md
+++ b/README.md
@@ -8,7 +8,7 @@
",
@@ -27,7 +27,7 @@
},
"dependencies": {
"@unblockneteasemusic/rust-napi": "^0.4.0",
- "NeteaseCloudMusicApi": "^4.23.3",
+ "NeteaseCloudMusicApi": "^4.8.7",
"axios": "^0.26.1",
"change-case": "^4.1.2",
"cli-color": "^2.0.0",
diff --git a/public/robots.txt b/public/robots.txt
index 1f53798..eb05362 100644
--- a/public/robots.txt
+++ b/public/robots.txt
@@ -1,2 +1,2 @@
User-agent: *
-Disallow: /
+Disallow:
diff --git a/src/api/artist.js b/src/api/artist.js
index 925df45..462f707 100644
--- a/src/api/artist.js
+++ b/src/api/artist.js
@@ -1,7 +1,5 @@
import request from '@/utils/request';
import { mapTrackPlayableStatus } from '@/utils/common';
-import { isAccountLoggedIn } from '@/utils/auth';
-import { getTrackDetail } from '@/api/track';
/**
* 获取歌手单曲
@@ -16,13 +14,7 @@ export function getArtist(id) {
id,
timestamp: new Date().getTime(),
},
- }).then(async data => {
- if (!isAccountLoggedIn()) {
- const trackIDs = data.hotSongs.map(t => t.id);
- const tracks = await getTrackDetail(trackIDs.join(','));
- data.hotSongs = tracks.songs;
- return data;
- }
+ }).then(data => {
data.hotSongs = mapTrackPlayableStatus(data.hotSongs);
return data;
});
diff --git a/src/assets/icons/fullscreen-exit.svg b/src/assets/icons/fullscreen-exit.svg
deleted file mode 100644
index f76f601..0000000
--- a/src/assets/icons/fullscreen-exit.svg
+++ /dev/null
@@ -1,3 +0,0 @@
-
\ No newline at end of file
diff --git a/src/assets/icons/fullscreen.svg b/src/assets/icons/fullscreen.svg
deleted file mode 100644
index e6128c0..0000000
--- a/src/assets/icons/fullscreen.svg
+++ /dev/null
@@ -1,3 +0,0 @@
-
\ No newline at end of file
diff --git a/src/components/CoverRow.vue b/src/components/CoverRow.vue
index 76c1e1b..77eb66e 100644
--- a/src/components/CoverRow.vue
+++ b/src/components/CoverRow.vue
@@ -50,7 +50,7 @@ export default {
props: {
items: { type: Array, required: true },
type: { type: String, required: true },
- subText: { type: String, default: 'none' },
+ subText: { type: String, default: 'null' },
subTextFontSize: { type: String, default: '16px' },
showPlayCount: { type: Boolean, default: false },
columnNumber: { type: Number, default: 5 },
@@ -96,7 +96,7 @@ export default {
return this.type === 'playlist' && item.privacy === 10;
},
isExplicit(item) {
- return this.type === 'album' && (item.mark & 1048576) === 1048576;
+ return this.type === 'album' && item.mark === 1056768;
},
getTitleLink(item) {
return `/${this.type}/${item.id}`;
diff --git a/src/components/TrackListItem.vue b/src/components/TrackListItem.vue
index a3a6238..3eef677 100644
--- a/src/components/TrackListItem.vue
+++ b/src/components/TrackListItem.vue
@@ -42,15 +42,13 @@
:exclude="$parent.albumObject.artist.name"
prefix="-"
/>
-
diff --git a/src/electron/ipcMain.js b/src/electron/ipcMain.js
index aa0e3d7..4310342 100644
--- a/src/electron/ipcMain.js
+++ b/src/electron/ipcMain.js
@@ -240,7 +240,7 @@ export function initIpcMain(win, store, trayEventEmitter) {
details: track.name + ' - ' + track.ar.map(ar => ar.name).join(','),
state: track.al.name,
endTimestamp: Date.now() + track.dt,
- largeImageKey: track.al.picUrl,
+ largeImageKey: 'logo',
largeImageText: 'Listening ' + track.name,
smallImageKey: 'play',
smallImageText: 'Playing',
@@ -252,7 +252,7 @@ export function initIpcMain(win, store, trayEventEmitter) {
client.updatePresence({
details: track.name + ' - ' + track.ar.map(ar => ar.name).join(','),
state: track.al.name,
- largeImageKey: track.al.picUrl,
+ largeImageKey: 'logo',
largeImageText: 'YesPlayMusic',
smallImageKey: 'pause',
smallImageText: 'Pause',
diff --git a/src/locale/lang/en.js b/src/locale/lang/en.js
index d880e32..6728b8a 100644
--- a/src/locale/lang/en.js
+++ b/src/locale/lang/en.js
@@ -244,8 +244,6 @@ export default {
minePlaylists: 'My Playlists',
likedPlaylists: 'Liked Playlists',
cardiacMode: 'Cardiac Mode',
- copyLyric: 'Copy Lyric',
- copyLyricWithTranslation: 'Copy Lyric With Translation',
},
toast: {
savedToPlaylist: 'Saved to playlist',
diff --git a/src/locale/lang/tr.js b/src/locale/lang/tr.js
index fda2939..296aac3 100644
--- a/src/locale/lang/tr.js
+++ b/src/locale/lang/tr.js
@@ -230,8 +230,6 @@ export default {
minePlaylists: 'My Playlists',
likedPlaylists: 'Liked Playlists',
cardiacMode: 'Cardiac Mode',
- copyLyric: 'Copy Lyric',
- copyLyricWithTranslation: 'Copy Lyric With Translation',
},
toast: {
savedToMyLikedSongs: 'Beğendiğim Müziklere Kaydet',
diff --git a/src/locale/lang/zh-CN.js b/src/locale/lang/zh-CN.js
index 543132a..9fbcafc 100644
--- a/src/locale/lang/zh-CN.js
+++ b/src/locale/lang/zh-CN.js
@@ -243,8 +243,6 @@ export default {
minePlaylists: '创建的歌单',
likedPlaylists: '收藏的歌单',
cardiacMode: '心动模式',
- copyLyric: '复制歌词',
- copyLyricWithTranslation: '复制歌词(含翻译)',
},
toast: {
savedToPlaylist: '已添加到歌单',
diff --git a/src/locale/lang/zh-TW.js b/src/locale/lang/zh-TW.js
index 384a0cf..0882921 100644
--- a/src/locale/lang/zh-TW.js
+++ b/src/locale/lang/zh-TW.js
@@ -240,8 +240,6 @@ export default {
minePlaylists: '我建立的歌單',
likedPlaylists: '收藏的歌單',
cardiacMode: '心動模式',
- copyLyric: '複製歌詞',
- copyLyricWithTranslation: '複製歌詞(含翻譯)',
},
toast: {
savedToPlaylist: '已新增至歌單',
diff --git a/src/main.js b/src/main.js
index 50d73a2..73f7e8e 100644
--- a/src/main.js
+++ b/src/main.js
@@ -7,6 +7,7 @@ import i18n from '@/locale';
import '@/assets/icons';
import '@/utils/filters';
import './registerServiceWorker';
+import { dailyTask } from '@/utils/common';
import '@/assets/css/global.scss';
import NProgress from 'nprogress';
import '@/assets/css/nprogress.css';
@@ -37,6 +38,7 @@ Vue.use(
Vue.config.productionTip = false;
NProgress.configure({ showSpinner: false, trickleSpeed: 100 });
+dailyTask();
new Vue({
i18n,
diff --git a/src/store/initLocalStorage.js b/src/store/initLocalStorage.js
index 9540efb..ce0e802 100644
--- a/src/store/initLocalStorage.js
+++ b/src/store/initLocalStorage.js
@@ -36,8 +36,6 @@ let localStorage = {
server: '',
port: null,
},
- enableRealIP: false,
- realIP: null,
shortcuts: shortcuts,
},
data: {
diff --git a/src/utils/Player.js b/src/utils/Player.js
index 11af73a..19e1ad8 100644
--- a/src/utils/Player.js
+++ b/src/utils/Player.js
@@ -3,7 +3,7 @@ import { getArtist } from '@/api/artist';
import { trackScrobble, trackUpdateNowPlaying } from '@/api/lastfm';
import { fmTrash, personalFM } from '@/api/others';
import { getPlaylistDetail, intelligencePlaylist } from '@/api/playlist';
-import { getLyric, getMP3, getTrackDetail } from '@/api/track';
+import { getLyric, getMP3, getTrackDetail, scrobble } from '@/api/track';
import store from '@/store';
import { isAccountLoggedIn } from '@/utils/auth';
import { cacheTrackSource, getTrackSource } from '@/utils/db';
@@ -130,8 +130,6 @@ export default class {
if (shuffle) {
this._shuffleTheList();
}
- // 同步当前歌曲在列表中的下标
- this.current = this.list.indexOf(this.currentTrackID);
}
get reversed() {
return this._reversed;
@@ -309,6 +307,11 @@ export default class {
);
const trackDuration = ~~(track.dt / 1000);
time = completed ? trackDuration : ~~time;
+ scrobble({
+ id: track.id,
+ sourceid: this.playlistSource.id,
+ time,
+ });
if (
store.state.lastfm.key !== undefined &&
(time >= trackDuration / 2 || time >= 240)
@@ -889,7 +892,7 @@ export default class {
if (autoPlayTrackID === 'first') {
this._replaceCurrentTrack(this.list[0]);
} else {
- this.current = this.list.indexOf(autoPlayTrackID);
+ this.current = trackIDs.indexOf(autoPlayTrackID);
this._replaceCurrentTrack(autoPlayTrackID);
}
}
diff --git a/src/utils/lyrics.js b/src/utils/lyrics.js
index b883f46..b9a7e59 100644
--- a/src/utils/lyrics.js
+++ b/src/utils/lyrics.js
@@ -84,30 +84,3 @@ function trimContent(content) {
let t = content.trim();
return t.length < 1 ? content : t;
}
-
-/**
- * @param {string} lyric
- */
-export async function copyLyric(lyric) {
- const textToCopy = lyric;
- if (navigator.clipboard && navigator.clipboard.writeText) {
- try {
- await navigator.clipboard.writeText(textToCopy);
- } catch (err) {
- alert('复制失败,请手动复制!');
- }
- } else {
- const tempInput = document.createElement('textarea');
- tempInput.value = textToCopy;
- tempInput.style.position = 'absolute';
- tempInput.style.left = '-9999px';
- document.body.appendChild(tempInput);
- tempInput.select();
- try {
- document.execCommand('copy');
- } catch (err) {
- alert('复制失败,请手动复制!');
- }
- document.body.removeChild(tempInput);
- }
-}
diff --git a/src/utils/request.js b/src/utils/request.js
index 6ac7bc3..52ac6f4 100644
--- a/src/utils/request.js
+++ b/src/utils/request.js
@@ -38,15 +38,8 @@ service.interceptors.request.use(function (config) {
config.params.realIP = '211.161.244.70';
}
- // Force real_ip
- const enableRealIP = JSON.parse(
- localStorage.getItem('settings')
- ).enableRealIP;
- const realIP = JSON.parse(localStorage.getItem('settings')).realIP;
if (process.env.VUE_APP_REAL_IP) {
config.params.realIP = process.env.VUE_APP_REAL_IP;
- } else if (enableRealIP) {
- config.params.realIP = realIP;
}
const proxy = JSON.parse(localStorage.getItem('settings')).proxyConfig;
@@ -64,16 +57,8 @@ service.interceptors.response.use(
},
async error => {
/** @type {import('axios').AxiosResponse | null} */
- let response;
- let data;
- if (error === 'TypeError: baseURL is undefined') {
- response = error;
- data = error;
- console.error("You must set up the baseURL in the service's config");
- } else if (error.response) {
- response = error.response;
- data = response.data;
- }
+ const response = error.response;
+ const data = response.data;
if (
response &&
diff --git a/src/views/album.vue b/src/views/album.vue
index acc8a40..7b032b7 100644
--- a/src/views/album.vue
+++ b/src/views/album.vue
@@ -28,9 +28,7 @@
Compilation by Various Artists
-
{{
diff --git a/src/views/artist.vue b/src/views/artist.vue
index d825436..4d6aae2 100644
--- a/src/views/artist.vue
+++ b/src/views/artist.vue
@@ -185,7 +185,6 @@ import {
followAArtist,
similarArtists,
} from '@/api/artist';
-import { getTrackDetail } from '@/api/track';
import locale from '@/locale';
import { isAccountLoggedIn } from '@/utils/auth';
import NProgress from 'nprogress';
@@ -279,7 +278,7 @@ export default {
this.$parent.$refs.main.scrollTo({ top: 0 });
getArtist(id).then(data => {
this.artist = data.artist;
- this.setPopularTracks(data.hotSongs);
+ this.popularTracks = data.hotSongs;
if (next !== undefined) next();
NProgress.done();
this.show = true;
@@ -292,16 +291,8 @@ export default {
this.mvs = data.mvs;
this.hasMoreMV = data.hasMore;
});
- if (isAccountLoggedIn()) {
- similarArtists(id).then(data => {
- this.similarArtists = data.artists;
- });
- }
- },
- setPopularTracks(hotSongs) {
- const trackIDs = hotSongs.map(t => t.id);
- getTrackDetail(trackIDs.join(',')).then(data => {
- this.popularTracks = data.songs;
+ similarArtists(id).then(data => {
+ this.similarArtists = data.artists;
});
},
goToAlbum(id) {
diff --git a/src/views/explore.vue b/src/views/explore.vue
index 90624d0..ef190df 100644
--- a/src/views/explore.vue
+++ b/src/views/explore.vue
@@ -120,13 +120,10 @@ export default {
setTimeout(() => {
if (!this.show) NProgress.start();
}, 1000);
- const queryCategory = this.$route.query.category;
- if (queryCategory === undefined) {
- this.playlists = [];
- this.activeCategory = '全部';
- } else {
- this.activeCategory = queryCategory;
- }
+ this.activeCategory =
+ this.$route.query.category === undefined
+ ? '全部'
+ : this.$route.query.category;
this.getPlaylist();
},
goToCategory(Category) {
diff --git a/src/views/library.vue b/src/views/library.vue
index da24af7..01381e4 100644
--- a/src/views/library.vue
+++ b/src/views/library.vue
@@ -215,7 +215,7 @@