{"record":{"id":"20c71d45e879e322","repo":"AlistGo/alist","slug":"no-shared-albums-found","errorCode":null,"errorMessage":"no shared albums found","messagePattern":"no shared albums found","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"drivers/baidu_photo/utils.go","lineNumber":48,"sourceCode":"\tif callback != nil {\n\t\tcallback(req)\n\t}\n\tif resp != nil {\n\t\treq.SetResult(resp)\n\t}\n\tres, err := req.Execute(method, furl)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\terron := utils.Json.Get(res.Body(), \"errno\").ToInt()\n\tswitch erron {\n\tcase 0:\n\t\tbreak\n\tcase 50805:\n\t\treturn nil, fmt.Errorf(\"you have joined album\")\n\tcase 50820:\n\t\treturn nil, fmt.Errorf(\"no shared albums found\")\n\tcase 50100:\n\t\treturn nil, fmt.Errorf(\"illegal title, only supports 50 characters\")\n\t// case -6:\n\t// \tif err = d.refreshToken(); err != nil {\n\t// \t\treturn nil, err\n\t// \t}\n\tdefault:\n\t\treturn nil, fmt.Errorf(\"errno: %d, refer to https://photo.baidu.com/union/doc\", erron)\n\t}\n\treturn res, nil\n}\n\n//func (d *BaiduPhoto) Request(furl string, method string, callback base.ReqCallback, resp interface{}) ([]byte, error) {\n//\tres, err := d.request(furl, method, callback, resp)\n//\tif err != nil {\n//\t\treturn nil, err\n//\t}\n//\treturn res.Body(), nil","sourceCodeStart":30,"sourceCodeEnd":66,"githubUrl":"https://github.com/AlistGo/alist/blob/843d9dc8149126976b2625911e45a4d3ffd6f2f5/drivers/baidu_photo/utils.go#L30-L66","documentation":"The Baidu Photo union API returned errno 50820, mapped in Request (drivers/baidu_photo/utils.go:48) to 'no shared albums found'. It means the endpoint was asked for shared-album data but the account (or the given invitation context) has no shared albums to return. It is a normal empty-state response surfaced as an error.","triggerScenarios":"Calling GetAllAlbumFile / GetAlbumDetail for a shared album that was deleted or left; listing the shared-album scope on a fresh account that never joined any share; using an album_id that no longer resolves.","commonSituations":"Stale cached album IDs after the owner deleted the share; testing a new account with no shares; retrying after leaving an album.","solutions":["Treat 50820 as an empty list rather than a hard failure in listing code","Refresh the album list (GetAllAlbum) and invalidate cached album IDs when it fires","Verify the share/invitation code is still valid before listing its files"],"exampleFix":"// before\nfiles, err := d.GetAllAlbumFile(ctx, album, passwd)\nif err != nil { return nil, err }\n\n// after\nfiles, err := d.GetAllAlbumFile(ctx, album, passwd)\nif err != nil && strings.Contains(err.Error(), \"no shared albums found\") {\n    return []model.Obj{}, nil // empty state, not a failure\n}\nif err != nil { return nil, err }","handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":"files, err := d.GetAllAlbumFile(ctx, album, passwd)\nif err != nil && strings.Contains(err.Error(), \"no shared albums found\") {\n    return []model.Obj{}, nil // treat as empty, drop stale album cache\n}\nif err != nil {\n    return nil, err\n}","preventionTips":["Refresh the cached album list when this fires instead of retrying the same album_id","Validate share/invitation codes before adding album mounts","Distinguish empty-state (50820) from auth errors so UIs show the right message"],"tags":["baidu-photo","api","album","empty-state"],"backgroundTag":null,"analyzedSha":"843d9dc8149126976b2625911e45a4d3ffd6f2f5","analyzedAt":"2026-08-15T12:14:11.722Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}