Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Truncate scenes_o_dates and scenes_view_dates as part of anonymize #5166

Merged
merged 1 commit into from
Aug 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions pkg/sqlite/anonymise.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ func (db *Anonymiser) Anonymise(ctx context.Context) error {
return utils.Do([]func() error{
func() error { return db.deleteBlobs() },
func() error { return db.deleteStashIDs() },
func() error { return db.clearOHistory() },
func() error { return db.clearWatchHistory() },
func() error { return db.anonymiseFolders(ctx) },
func() error { return db.anonymiseFiles(ctx) },
func() error { return db.anonymiseFingerprints(ctx) },
Expand Down Expand Up @@ -101,6 +103,18 @@ func (db *Anonymiser) deleteStashIDs() error {
})
}

func (db *Anonymiser) clearOHistory() error {
return utils.Do([]func() error{
func() error { return db.truncateTable("scenes_o_dates") },
})
}

func (db *Anonymiser) clearWatchHistory() error {
return utils.Do([]func() error{
func() error { return db.truncateTable("scenes_view_dates") },
})
}

func (db *Anonymiser) anonymiseFolders(ctx context.Context) error {
logger.Infof("Anonymising folders")
return txn.WithTxn(ctx, db, func(ctx context.Context) error {
Expand Down
Loading