Skip to content

Commit

Permalink
Truncate scenes_o_dates and scenes_view_dates as part of anonymize (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
ikmckenz authored Aug 26, 2024
1 parent d8ee57c commit e49beb1
Showing 1 changed file with 14 additions and 0 deletions.
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

0 comments on commit e49beb1

Please sign in to comment.