{"record":{"id":"01d7c2c74b4462fc","repo":"AlistGo/alist","slug":"you-have-joined-album","errorCode":null,"errorMessage":"you have joined album","messagePattern":"you have joined album","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"drivers/baidu_photo/utils.go","lineNumber":46,"sourceCode":"\t\t// SetQueryParam(\"access_token\", d.AccessToken)\n\t\tSetHeader(\"Cookie\", d.Cookie)\n\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","sourceCodeStart":28,"sourceCodeEnd":64,"githubUrl":"https://github.com/AlistGo/alist/blob/843d9dc8149126976b2625911e45a4d3ffd6f2f5/drivers/baidu_photo/utils.go#L28-L64","documentation":"The Baidu Photo union API returned errno 50805, mapped in BaiduPhoto.Request (drivers/baidu_photo/utils.go:46) to 'you have joined album'. It fires when a join-shared-album request targets an album the current account has already joined. The operation itself is effectively already done; the error is an idempotency signal, not data loss.","triggerScenarios":"Calling JoinAlbum with an invitation code (e.g. via MakeDir with the 'join:' code path at driver.go:170) for an album already in the account's album list; retrying a join that succeeded but whose result was not observed.","commonSituations":"Re-running a setup script that joins the same shared album twice; a share link pasted again after the first join succeeded; UI double-submit.","solutions":["Treat 50805 as success: the album is already in the account, proceed to list it","Check GetAllAlbum first and skip joining if the album_id already exists","Guard UI/API layers against double-submitting the join request"],"exampleFix":"// before\nalbum, err := d.JoinAlbum(ctx, code)\nif err != nil { return nil, err }\n\n// after\nalbum, err := d.JoinAlbum(ctx, code)\nif err != nil && strings.Contains(err.Error(), \"you have joined album\") {\n    // already joined: fall through and list albums to find it\n    albums, _ := d.GetAllAlbum(ctx)\n    for _, a := range albums { if a.AlbumID == wantedID { album = &a; break } }\n} else if err != nil {\n    return nil, err\n}","handlingStrategy":"fallback","validationCode":"// check membership before joining\nalbums, err := d.GetAllAlbum(ctx)\nif err == nil {\n    for _, a := range albums {\n        if a.AlbumID == targetAlbumID {\n            return &a, nil // already joined\n        }\n    }\n}\nreturn d.JoinAlbum(ctx, code)","typeGuard":null,"tryCatchPattern":"album, err := d.JoinAlbum(ctx, code)\nif err != nil && strings.Contains(err.Error(), \"you have joined album\") {\n    // idempotent success: locate it in the existing album list\n    albums, lerr := d.GetAllAlbum(ctx)\n    if lerr == nil {\n        for _, a := range albums {\n            if a.AlbumID == targetAlbumID {\n                return &a, nil\n            }\n        }\n    }\n} else if err != nil {\n    return nil, err\n}","preventionTips":["Make join flows idempotent by checking the album list first","Disable the join button / skip the join step once the album is present","Do not auto-retry join on this error — it already succeeded"],"tags":["baidu-photo","api","idempotency","album"],"backgroundTag":null,"analyzedSha":"843d9dc8149126976b2625911e45a4d3ffd6f2f5","analyzedAt":"2026-08-15T12:14:11.722Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}