fix(bilibili): use actual user UID instead of 0 for favorite command#333
Merged
jackwener merged 1 commit intojackwener:mainfrom Mar 24, 2026
Merged
Conversation
The favorite command was using up_mid: 0 which returns empty results. Now it correctly fetches the current user UID using getSelfUid().
jackwener
approved these changes
Mar 24, 2026
Owner
jackwener
left a comment
There was a problem hiding this comment.
Review summary:
| Priority | Issue | File | Action |
|---|---|---|---|
| P1 | Missing regression coverage for the UID-dependent folder lookup | src/clis/bilibili/favorite.ts |
Fixed by adding src/clis/bilibili/favorite.test.ts |
The functional fix is correct: bilibili favorite should query /x/v3/fav/folder/created/list-all with the logged-in user's real UID, not 0.
I pushed a small follow-up commit to lock this behavior with a targeted unit test. Validation on the updated branch:
npx vitest run src/clis/bilibili/favorite.test.ts src/clis/bilibili/dynamic.test.tsnpm run typechecknpm testnpm run build
Approve.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
bilibili favoritecommand returning empty resultsup_mid: 0to use the actual logged-in user's UID viagetSelfUid()Problem
The
opencli bilibili favoritecommand was always returning empty results because the API call usedup_mid: 0which doesn't return any favorite folders.Solution
Import and use
getSelfUid()to fetch the current user's UID before querying the favorite folders API.Test
Before fix:
After fix: