mirror of
https://github.com/Jonnyan404/memos-bber.git
synced 2026-08-23 00:41:39 +09:00
Fix tags display and Memos API compatibility issues
Fix the tags not displaying issue by querying both /tag/suggestion and /tag endpoints and merging results. Simplify v0.23 filter to avoid 400 errors from numeric ID requirements. Add v0.18.2 support via numeric ID fallback in getMemoUid. Improve v0.23+ resource URL handling and add better error handling with debug logging for tags and random features.
This commit is contained in:
@@ -249,10 +249,10 @@
|
||||
}
|
||||
|
||||
if (flavor === 'v023' && global.MemosApiV023) {
|
||||
const filterExpr = global.MemosApiV023.buildFilter({
|
||||
rowStatus: 'NORMAL',
|
||||
creator: 'users/' + info.userid
|
||||
})
|
||||
// v0.23 filter requires `creator == "users/{numericId}"`. Some stored userids are
|
||||
// usernames, which causes 400. Also `row_status` can cause 400 on some builds.
|
||||
// Let the server identify the current user from the token and return all visible memos.
|
||||
const filterExpr = global.MemosApiV023.buildFilter({})
|
||||
global.MemosApiV023.listMemos(
|
||||
info,
|
||||
{ pageSize: 1000, filterExpr: filterExpr },
|
||||
@@ -328,7 +328,10 @@
|
||||
|
||||
if (flavor === FLAVOR_V020_V021 && global.MemosApiV020V021) {
|
||||
global.MemosApiV020V021.listMemos(info, { limit: 1000, rowStatus: 'NORMAL' }, function (data) {
|
||||
if (success) success(keepLegacyVisibleMemos(extractMemos(data)))
|
||||
const raw = extractMemos(data)
|
||||
const filtered = keepLegacyVisibleMemos(raw)
|
||||
console.log('[memos-bber] v020-v021 random raw count:', raw.length, 'filtered count:', filtered.length)
|
||||
if (success) success(filtered)
|
||||
}, fail)
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user