diff --git a/package.json b/package.json index 7061df18..aa701696 100644 --- a/package.json +++ b/package.json @@ -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", @@ -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://lovegaoshi@github.com/lovegaoshi/react-native-lyric.git#commit=6f20e83948c29b0d46833ab9173cd81f99d0ab48", diff --git a/patches/react-native-gesture-handler+2.22.1.patch b/patches/react-native-gesture-handler+2.22.1.patch deleted file mode 100644 index c9f0e355..00000000 --- a/patches/react-native-gesture-handler+2.22.1.patch +++ /dev/null @@ -1,63 +0,0 @@ -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..16ed350 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 -@@ -11,7 +11,6 @@ import com.facebook.react.views.scroll.ReactScrollView - import com.facebook.react.views.swiperefresh.ReactSwipeRefreshLayout - import com.facebook.react.views.text.ReactTextView - import com.facebook.react.views.textinput.ReactEditText --import com.facebook.react.views.view.ReactViewGroup - import com.swmansion.gesturehandler.react.RNGestureHandlerButtonViewManager - import com.swmansion.gesturehandler.react.isScreenReaderOn - -@@ -88,7 +87,6 @@ class NativeViewGestureHandler : GestureHandler() { - is ReactScrollView -> this.hook = ScrollViewHook() - is ReactHorizontalScrollView -> this.hook = ScrollViewHook() - is ReactTextView -> this.hook = TextViewHook() -- is ReactViewGroup -> this.hook = ReactViewGroupHook() - } - } - -@@ -109,8 +107,7 @@ class NativeViewGestureHandler : GestureHandler() { - if (state == STATE_UNDETERMINED && !hook.canBegin(event)) { - cancel() - } else { -- hook.sendTouchEvent(view, event) -- -+ view.onTouchEvent(event) - if ((state == STATE_UNDETERMINED || state == STATE_BEGAN) && hook.canActivate(view)) { - activate() - } -@@ -127,12 +124,12 @@ class NativeViewGestureHandler : GestureHandler() { - when { - shouldActivateOnStart -> { - tryIntercept(view, event) -- hook.sendTouchEvent(view, event) -+ view.onTouchEvent(event) - activate() - } - - tryIntercept(view, event) -> { -- hook.sendTouchEvent(view, event) -+ view.onTouchEvent(event) - activate() - } - -@@ -147,7 +144,7 @@ class NativeViewGestureHandler : GestureHandler() { - } - } - } else if (state == STATE_ACTIVE) { -- hook.sendTouchEvent(view, event) -+ view.onTouchEvent(event) - } - } - -@@ -156,7 +153,7 @@ class NativeViewGestureHandler : GestureHandler() { - val event = MotionEvent.obtain(time, time, MotionEvent.ACTION_CANCEL, 0f, 0f, 0).apply { - action = MotionEvent.ACTION_CANCEL - } -- hook.sendTouchEvent(view, event) -+ view!!.onTouchEvent(event) - event.recycle() - } - diff --git a/patches/react-native-gesture-handler+2.23.0.patch b/patches/react-native-gesture-handler+2.23.0.patch new file mode 100644 index 00000000..7aa0fd6b --- /dev/null +++ b/patches/react-native-gesture-handler+2.23.0.patch @@ -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() { + // inside a `` 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) + } + } diff --git a/src/hooks/usePlaylist.ts b/src/hooks/usePlaylist.ts index 9904559d..5b3abf8e 100644 --- a/src/hooks/usePlaylist.ts +++ b/src/hooks/usePlaylist.ts @@ -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); diff --git a/src/utils/mediafetch/bilisearch.ts b/src/utils/mediafetch/bilisearch.ts index 03995365..51aa6fff 100644 --- a/src/utils/mediafetch/bilisearch.ts +++ b/src/utils/mediafetch/bilisearch.ts @@ -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'; @@ -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, @@ -83,6 +83,7 @@ export const fetchBiliSearchList = async ( : undefined, startPage, }); + return getUniqObjects(results, v => v.bvid); } catch (e) { logger.error(e); } diff --git a/yarn.lock b/yarn.lock index 97501467..e80293ed 100644 --- a/yarn.lock +++ b/yarn.lock @@ -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" @@ -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 @@ -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" @@ -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://lovegaoshi@github.com/lovegaoshi/react-native-lyric.git#commit=6f20e83948c29b0d46833ab9173cd81f99d0ab48" @@ -15129,9 +15129,9 @@ __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" @@ -15139,7 +15139,7 @@ __metadata: peerDependencies: react: "*" react-native: "*" - checksum: 10c0/f4e1e08a25f4555491d6d2d9428c8f9cda343c6508f2e0f8d212698e5d5dc370cecadf08774243c6502b2c46e85a0d70f7bd426626d3ae27e180950a41415e2f + checksum: 10c0/b4bfa9f71990fb5f75225b63878f668a9c6cee29cea6636482b64708432fb46b8c969c570022728fb130bf4e6ce306719dae200d1cb4050fdd2690e34b7b2a78 languageName: node linkType: hard