Skip to content

Commit

Permalink
Merge pull request #758 from lovegaoshi/dev
Browse files Browse the repository at this point in the history
feat: uniquify biliSearch
  • Loading branch information
lovegaoshi authored Feb 5, 2025
2 parents 7923650 + d15fd39 commit b018bc2
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 78 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
"@sentry/react-native": "^6.6.0",
"@sharcoux/slider": "8.0.6",
"@shopify/flash-list": "^1.7.3",
"@shopify/react-native-skia": "1.11.3",
"@shopify/react-native-skia": "1.11.4",
"axios": "^1.7.9",
"base-64": "^1.0.0",
"base64-js": "^1.5.1",
Expand Down Expand Up @@ -96,7 +96,7 @@
"react-native-carplay": "2.4.1-beta.0",
"react-native-device-info": "^14.0.4",
"react-native-flashdrag-list": "^0.2.4",
"react-native-gesture-handler": "2.22.1",
"react-native-gesture-handler": "2.23.0",
"react-native-get-random-values": "^1.11.0",
"react-native-image-colors": "^2.4.0",
"react-native-lyric": "https://[email protected]/lovegaoshi/react-native-lyric.git#commit=6f20e83948c29b0d46833ab9173cd81f99d0ab48",
Expand Down
63 changes: 0 additions & 63 deletions patches/react-native-gesture-handler+2.22.1.patch

This file was deleted.

12 changes: 12 additions & 0 deletions patches/react-native-gesture-handler+2.23.0.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
diff --git a/node_modules/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/core/NativeViewGestureHandler.kt b/node_modules/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/core/NativeViewGestureHandler.kt
index 1abcdc8..927a3f6 100644
--- a/node_modules/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/core/NativeViewGestureHandler.kt
+++ b/node_modules/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/core/NativeViewGestureHandler.kt
@@ -313,6 +313,6 @@ class NativeViewGestureHandler : GestureHandler<NativeViewGestureHandler>() {
// inside a `<View />` component in JS). In such cases, calling `onTouchEvent` wouldn't work as those are
// ignored by the wrapper view. Instead `dispatchTouchEvent` can be used, which causes the view to dispatch
// the event to its children.
- override fun sendTouchEvent(view: View?, event: MotionEvent) = view?.dispatchTouchEvent(event)
+ override fun sendTouchEvent(view: View?, event: MotionEvent) = view?.onTouchEvent(event)
}
}
2 changes: 1 addition & 1 deletion src/hooks/usePlaylist.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ const usePlaylist = (playlist: NoxMedia.Playlist): UsePlaylist => {
state => state.togglePlaylistInfoUpdate,
);
const playlistCRUD = usePlaylistCRUD(playlist);
const searchBarRef = useRef();
const searchBarRef = useRef(undefined);

const handleSearch = (searchedVal: string) => {
setSearchText(searchedVal);
Expand Down
5 changes: 3 additions & 2 deletions src/utils/mediafetch/bilisearch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { logger } from '../Logger';
import { fetchBiliPaginatedAPI } from './paginatedbili';
import bfetch from '../BiliFetch';
import { getBiliCookie, BILICOOKIES } from '@utils/Bilibili/biliCookies';
import { timestampToSeconds } from '../Utils';
import { timestampToSeconds, getUniqObjects } from '../Utils';
import SongTS from '@objects/Song';
import { Source } from '@enums/MediaFetch';

Expand Down Expand Up @@ -62,7 +62,7 @@ export const fetchBiliSearchList = async (
// otherwise will return error 412. for users didnt login to bilibili,
// setting a random buvid3 would enable this API.
try {
return fetchBiliPaginatedAPI({
const results = await fetchBiliPaginatedAPI({
url: URL_BILI_SEARCH.replace('{keyword}', kword),
getMediaCount: data => Math.min(data.numResults, data.pagesize * 2),
getPageSize: data => data.pagesize,
Expand All @@ -83,6 +83,7 @@ export const fetchBiliSearchList = async (
: undefined,
startPage,
});
return getUniqObjects(results, v => v.bvid);
} catch (e) {
logger.error(e);
}
Expand Down
20 changes: 10 additions & 10 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4034,9 +4034,9 @@ __metadata:
languageName: node
linkType: hard

"@shopify/react-native-skia@npm:1.11.3":
version: 1.11.3
resolution: "@shopify/react-native-skia@npm:1.11.3"
"@shopify/react-native-skia@npm:1.11.4":
version: 1.11.4
resolution: "@shopify/react-native-skia@npm:1.11.4"
dependencies:
canvaskit-wasm: "npm:0.39.1"
react-reconciler: "npm:0.27.0"
Expand All @@ -4051,7 +4051,7 @@ __metadata:
optional: true
bin:
setup-skia-web: ./scripts/setup-canvaskit.js
checksum: 10c0/191f1b5b00ff4ba123d62f567d65569cddd4ee0d94a4fcdd6f1c2f8c023ab43d83d077efc0cea955864eee84848a417f85c24d40c8716a56431c56f973d365c7
checksum: 10c0/6a5c47d479b4ccba830c88a7bd71fafb38cbd79fd44bfec37e149f74ba0a466874a8b5993b5aec5a0d984c593912e6d4ff1c8eb0d187a2ac12570423012a154a
languageName: node
linkType: hard

Expand Down Expand Up @@ -5727,7 +5727,7 @@ __metadata:
"@sentry/react-native": "npm:^6.6.0"
"@sharcoux/slider": "npm:8.0.6"
"@shopify/flash-list": "npm:^1.7.3"
"@shopify/react-native-skia": "npm:1.11.3"
"@shopify/react-native-skia": "npm:1.11.4"
"@tsconfig/react-native": "npm:^3.0.5"
"@types/base-64": "npm:^1.0.2"
"@types/crypto-js": "npm:^4.2.2"
Expand Down Expand Up @@ -5815,7 +5815,7 @@ __metadata:
react-native-device-info: "npm:^14.0.4"
react-native-dotenv: "npm:^3.4.11"
react-native-flashdrag-list: "npm:^0.2.4"
react-native-gesture-handler: "npm:2.22.1"
react-native-gesture-handler: "npm:2.23.0"
react-native-get-random-values: "npm:^1.11.0"
react-native-image-colors: "npm:^2.4.0"
react-native-lyric: "https://[email protected]/lovegaoshi/react-native-lyric.git#commit=6f20e83948c29b0d46833ab9173cd81f99d0ab48"
Expand Down Expand Up @@ -15129,17 +15129,17 @@ __metadata:
languageName: node
linkType: hard

"react-native-gesture-handler@npm:2.22.1":
version: 2.22.1
resolution: "react-native-gesture-handler@npm:2.22.1"
"react-native-gesture-handler@npm:2.23.0":
version: 2.23.0
resolution: "react-native-gesture-handler@npm:2.23.0"
dependencies:
"@egjs/hammerjs": "npm:^2.0.17"
hoist-non-react-statics: "npm:^3.3.0"
invariant: "npm:^2.2.4"
peerDependencies:
react: "*"
react-native: "*"
checksum: 10c0/f4e1e08a25f4555491d6d2d9428c8f9cda343c6508f2e0f8d212698e5d5dc370cecadf08774243c6502b2c46e85a0d70f7bd426626d3ae27e180950a41415e2f
checksum: 10c0/b4bfa9f71990fb5f75225b63878f668a9c6cee29cea6636482b64708432fb46b8c969c570022728fb130bf4e6ce306719dae200d1cb4050fdd2690e34b7b2a78
languageName: node
linkType: hard

Expand Down

0 comments on commit b018bc2

Please sign in to comment.