AlistGo/alist · warning

you have joined album

Error message

you have joined album

What it means

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.

Source

Thrown at drivers/baidu_photo/utils.go:46

		// SetQueryParam("access_token", d.AccessToken)
		SetHeader("Cookie", d.Cookie)
	if callback != nil {
		callback(req)
	}
	if resp != nil {
		req.SetResult(resp)
	}
	res, err := req.Execute(method, furl)
	if err != nil {
		return nil, err
	}

	erron := utils.Json.Get(res.Body(), "errno").ToInt()
	switch erron {
	case 0:
		break
	case 50805:
		return nil, fmt.Errorf("you have joined album")
	case 50820:
		return nil, fmt.Errorf("no shared albums found")
	case 50100:
		return nil, fmt.Errorf("illegal title, only supports 50 characters")
	// case -6:
	// 	if err = d.refreshToken(); err != nil {
	// 		return nil, err
	// 	}
	default:
		return nil, fmt.Errorf("errno: %d, refer to https://photo.baidu.com/union/doc", erron)
	}
	return res, nil
}

//func (d *BaiduPhoto) Request(furl string, method string, callback base.ReqCallback, resp interface{}) ([]byte, error) {
//	res, err := d.request(furl, method, callback, resp)
//	if err != nil {
//		return nil, err

View on GitHub (pinned to 843d9dc814)

Solutions

  1. Treat 50805 as success: the album is already in the account, proceed to list it
  2. Check GetAllAlbum first and skip joining if the album_id already exists
  3. Guard UI/API layers against double-submitting the join request

Example fix

// before
album, err := d.JoinAlbum(ctx, code)
if err != nil { return nil, err }

// after
album, err := d.JoinAlbum(ctx, code)
if err != nil && strings.Contains(err.Error(), "you have joined album") {
    // already joined: fall through and list albums to find it
    albums, _ := d.GetAllAlbum(ctx)
    for _, a := range albums { if a.AlbumID == wantedID { album = &a; break } }
} else if err != nil {
    return nil, err
}
Defensive patterns

Strategy: fallback

Validate before calling

// check membership before joining
albums, err := d.GetAllAlbum(ctx)
if err == nil {
    for _, a := range albums {
        if a.AlbumID == targetAlbumID {
            return &a, nil // already joined
        }
    }
}
return d.JoinAlbum(ctx, code)

Try / catch

album, err := d.JoinAlbum(ctx, code)
if err != nil && strings.Contains(err.Error(), "you have joined album") {
    // idempotent success: locate it in the existing album list
    albums, lerr := d.GetAllAlbum(ctx)
    if lerr == nil {
        for _, a := range albums {
            if a.AlbumID == targetAlbumID {
                return &a, nil
            }
        }
    }
} else if err != nil {
    return nil, err
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of AlistGo/alist@843d9dc814 (2026-08-15). Data as JSON: /api/errors/01d7c2c74b4462fc. Report an issue: GitHub.