mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-12-07 07:38:07 -06:00
[feature] Allow users to export data via the settings panel (#3140)
* [feature] Allow users to export data via the settings panel * rename/move some stuff
This commit is contained in:
parent
43519324b3
commit
38f041cea1
32 changed files with 2102 additions and 7 deletions
|
|
@ -106,6 +106,14 @@ func (l *listDB) GetListsForAccountID(ctx context.Context, accountID string) ([]
|
|||
return l.GetListsByIDs(ctx, listIDs)
|
||||
}
|
||||
|
||||
func (l *listDB) CountListsForAccountID(ctx context.Context, accountID string) (int, error) {
|
||||
return l.db.
|
||||
NewSelect().
|
||||
Table("lists").
|
||||
Where("? = ?", bun.Ident("account_id"), accountID).
|
||||
Count(ctx)
|
||||
}
|
||||
|
||||
func (l *listDB) PopulateList(ctx context.Context, list *gtsmodel.List) error {
|
||||
var (
|
||||
err error
|
||||
|
|
|
|||
|
|
@ -178,6 +178,11 @@ func (r *relationshipDB) GetAccountBlocks(ctx context.Context, accountID string,
|
|||
return r.GetBlocksByIDs(ctx, blockIDs)
|
||||
}
|
||||
|
||||
func (r *relationshipDB) CountAccountBlocks(ctx context.Context, accountID string) (int, error) {
|
||||
blockIDs, err := r.GetAccountBlockIDs(ctx, accountID, nil)
|
||||
return len(blockIDs), err
|
||||
}
|
||||
|
||||
func (r *relationshipDB) GetAccountFollowIDs(ctx context.Context, accountID string, page *paging.Page) ([]string, error) {
|
||||
return loadPagedIDs(&r.state.Caches.DB.FollowIDs, ">"+accountID, page, func() ([]string, error) {
|
||||
var followIDs []string
|
||||
|
|
|
|||
|
|
@ -77,6 +77,11 @@ func (r *relationshipDB) GetMute(
|
|||
)
|
||||
}
|
||||
|
||||
func (r *relationshipDB) CountAccountMutes(ctx context.Context, accountID string) (int, error) {
|
||||
muteIDs, err := r.getAccountMuteIDs(ctx, accountID, nil)
|
||||
return len(muteIDs), err
|
||||
}
|
||||
|
||||
func (r *relationshipDB) getMutesByIDs(ctx context.Context, ids []string) ([]*gtsmodel.UserMute, error) {
|
||||
// Load all mutes IDs via cache loader callbacks.
|
||||
mutes, err := r.state.Caches.DB.UserMute.LoadIDs("ID",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue