Skip to content

Commit

Permalink
feat: qqQrc
Browse files Browse the repository at this point in the history
  • Loading branch information
lovegaoshi committed Apr 17, 2024
1 parent e33072b commit 2fec089
Show file tree
Hide file tree
Showing 4 changed files with 296 additions and 238 deletions.
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@
"@react-navigation/material-top-tabs": "^6.6.13",
"@react-navigation/native": "^6.1.17",
"@react-navigation/native-stack": "^6.9.26",
"@sentry/react-native": "^5.20.0",
"@sentry/react-native": "^5.22.0",
"@sharcoux/slider": "^7.1.1",
"@shopify/flash-list": "^1.6.4",
"@shopify/react-native-skia": "1.2.0",
"@shopify/react-native-skia": "1.2.1",
"axios": "^1.6.8",
"babel-plugin-transform-remove-console": "^6.9.4",
"base-64": "^1.0.0",
Expand All @@ -57,7 +57,7 @@
"dayjs": "^1.11.9",
"deepmerge": "^4.3.1",
"dropbox": "git+https://[email protected]/lovegaoshi/dropbox-sdk-js.git",
"expo": "^50.0.15",
"expo": "^50.0.17",
"expo-clipboard": "~5.0.1",
"expo-document-picker": "~11.10.1",
"expo-image": "^1.10.6",
Expand Down Expand Up @@ -104,7 +104,7 @@
"react-native-url-polyfill": "^2.0.0",
"react-native-vector-icons": "^10.0.3",
"react-native-video": "git+https://github.com/lovegaoshi/react-native-video.git#dev-android-cache",
"react-native-webview": "^13.8.5",
"react-native-webview": "^13.8.6",
"react-native-windows": "^0.73.11",
"react-use": "^17.5.0",
"use-debounce": "^10.0.0",
Expand Down Expand Up @@ -140,7 +140,7 @@
"@welldone-software/why-did-you-render": "^8.0.1",
"argparse": "^2.0.1",
"babel-jest": "^29.6.4",
"babel-plugin-module-resolver": "^5.0.0",
"babel-plugin-module-resolver": "^5.0.1",
"cpx": "^1.5.0",
"eslint": "^9.0.0",
"eslint-config-prettier": "^9.0.0",
Expand Down
6 changes: 3 additions & 3 deletions src/components/player/Lyric.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -213,9 +213,9 @@ export const LyricView = ({
else {
const resolvedLrc = resolvedLrcOptions[index!];
const lyric = resolvedLyric
? resolvedLrc.lrc ??
(await searchLyric(resolvedLyric.lyricKey, resolvedLyric.source))
: await searchLyric(resolvedLrc.songMid, resolvedLrc.source);
? await searchLyric(resolvedLyric.lyricKey, resolvedLyric.source)
: resolvedLrc.lrc ??
(await searchLyric(resolvedLrc.songMid, resolvedLrc.source));
setLrc(lyric);
setLrcOption(resolvedLrc);
updateLyricMapping({ newLrcDetail: { lyric }, resolvedLrc });
Expand Down
5 changes: 3 additions & 2 deletions src/utils/LyricFetch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export const searchLyricOptions = async (
return qqLrcFetch.getLrcOptions(searchKey);
}
} catch (e) {
logger.error(`[lrcOptionFetch] ${searchKey} & ${source}: ${e}`);
logger.warn(`[lrcOptionFetch] ${searchKey} & ${source}: ${e}`);
return [];
}
};
Expand All @@ -32,13 +32,14 @@ export const searchLyric = async (searchMID: string, source = LrcSource.QQ) => {
case LrcSource.Kugou:
return kugouLrcFetch.getLyric(searchMID);
case LrcSource.QQQrc:
return 'oh no!';
return qqQrcFetch.getLyric(searchMID);
case LrcSource.QQ:
default:
return qqLrcFetch.getLyric(searchMID);
}
} catch (e) {
logger.error(`[lrcFetch] ${searchMID} & ${source}: ${e}`);
logger.warn(`[lrcFetch] ${searchMID} & ${source}: ${e}`);
return i18n.t('Lyric.failedToFetch');
}
};
Loading

0 comments on commit 2fec089

Please sign in to comment.