mirror of https://github.com/stashapp/stash.git
Truncate scenes_o_dates and scenes_view_dates as part of anonymize (#5166)
This commit is contained in:
parent
d8ee57cd50
commit
e49beb139c
|
@ -47,6 +47,8 @@ func (db *Anonymiser) Anonymise(ctx context.Context) error {
|
||||||
return utils.Do([]func() error{
|
return utils.Do([]func() error{
|
||||||
func() error { return db.deleteBlobs() },
|
func() error { return db.deleteBlobs() },
|
||||||
func() error { return db.deleteStashIDs() },
|
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.anonymiseFolders(ctx) },
|
||||||
func() error { return db.anonymiseFiles(ctx) },
|
func() error { return db.anonymiseFiles(ctx) },
|
||||||
func() error { return db.anonymiseFingerprints(ctx) },
|
func() error { return db.anonymiseFingerprints(ctx) },
|
||||||
|
@ -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 {
|
func (db *Anonymiser) anonymiseFolders(ctx context.Context) error {
|
||||||
logger.Infof("Anonymising folders")
|
logger.Infof("Anonymising folders")
|
||||||
return txn.WithTxn(ctx, db, func(ctx context.Context) error {
|
return txn.WithTxn(ctx, db, func(ctx context.Context) error {
|
||||||
|
|
Loading…
Reference in New Issue