diff --git a/package.json b/package.json index dc4372fe..e398d97b 100644 --- a/package.json +++ b/package.json @@ -74,7 +74,7 @@ "metro": "^0.80.8", "patch-package": "^8.0.0", "postinstall-postinstall": "^2.1.0", - "qs": "^6.12.0", + "qs": "^6.12.1", "react": "18.2.0", "react-i18next": "^14.1.0", "react-native": "0.73.6", diff --git a/src/hooks/useSongOperations.ts b/src/hooks/useSongOperations.ts index 77c8142f..f4be840c 100644 --- a/src/hooks/useSongOperations.ts +++ b/src/hooks/useSongOperations.ts @@ -11,7 +11,7 @@ const useSongOperations = () => { const startRadio = (song: NoxMedia.Song) => { switch (song.source) { case Source.ytbvideo: - setExternalSearchText(`youtu.be/${song.bvid}`); + setExternalSearchText(`youtu.be/list=RD${song.bvid}`); break; case Source.bilivideo: setExternalSearchText(`bilibili.com/video/similarvideo/${song.bvid}`); diff --git a/src/utils/Cache.ts b/src/utils/Cache.ts index 80ba494f..0606e838 100644 --- a/src/utils/Cache.ts +++ b/src/utils/Cache.ts @@ -5,7 +5,7 @@ import RNFetchBlob from 'react-native-blob-util'; import TrackPlayer from 'react-native-track-player'; import { r128gain, setR128Gain, ffmpegToMP3 } from './ffmpeg/ffmpeg'; -import { addDownloadProgress } from '@stores/appStore'; +import { addDownloadProgress, setFetchProgress } from '@stores/appStore'; import { addR128Gain, getR128Gain } from '@utils/ffmpeg/r128Store'; import playerSettingStore from '@stores/playerSettingStore'; import { getCachedMediaMapping, saveCachedMediaMapping } from './ChromeStorage'; @@ -74,12 +74,14 @@ class NoxMediaCache { }; // HACK: local files also need r128gain if (resolvedURL.url.startsWith('file://')) parseR128Gain(); - if ( - this.cache.max < 2 || - !resolvedURL.url.startsWith('http') || - song.isLive - ) + if (this.cache.max < 2 || song.isLive) { + setFetchProgress(0); return; + } + if (!resolvedURL.url.startsWith('http')) { + setFetchProgress(100); + return; + } logger.debug(`[Cache] fetching ${song.name} to cache...`); if (!extension) { const regexMatch = /.+\/{2}.+\/{1}.+(\.\w+)\?*.*/.exec(resolvedURL.url); diff --git a/yarn.lock b/yarn.lock index 08a16995..9296bd6b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -11923,10 +11923,10 @@ qrcode@^1.5.1: pngjs "^5.0.0" yargs "^15.3.1" -qs@^6.12.0: - version "6.12.0" - resolved "https://registry.npmjs.org/qs/-/qs-6.12.0.tgz#edd40c3b823995946a8a0b1f208669c7a200db77" - integrity sha512-trVZiI6RMOkO476zLGaBIzszOdFPnCCXHPG9kn0yuS1uz6xdVxPfZdB3vUig9pxPFDM9BRAgz/YUIVQ1/vuiUg== +qs@^6.12.1: + version "6.12.1" + resolved "https://registry.yarnpkg.com/qs/-/qs-6.12.1.tgz#39422111ca7cbdb70425541cba20c7d7b216599a" + integrity sha512-zWmv4RSuB9r2mYQw3zxQuHWeU+42aKi1wWig/j4ele4ygELZ7PEO6MM7rim9oAQH2A5MWfsAVf/jPvTPgCbvUQ== dependencies: side-channel "^1.0.6" @@ -12110,7 +12110,7 @@ react-native-get-random-values@^1.11.0: "react-native-lyric@git+https://github.com/lovegaoshi/react-native-lyric.git#dev": version "1.0.1" - resolved "git+https://github.com/lovegaoshi/react-native-lyric.git#b141a77252a9afe9b74f2e70e02bc02188c1c5c3" + resolved "git+https://github.com/lovegaoshi/react-native-lyric.git#dbc2b07a5ea211097cb60ecd6a1e0f6891557c27" dependencies: "@react-native-masked-view/masked-view" "^0.3.1"