Find and remove duplicate songs within the slave library
A new Duplicates filter in Review finds songs filed more than once in the slave library, such as a single next to its album version, and recommends which copy to keep. Removed copies go to the quarantine and can be restored. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
491d679233
commit
206b2ab5db
13 files changed
+1123
-11
No files matched your search
+11
-1
@@ -622,7 +622,7 @@ func (e *Engine) Undo(ctx context.Context, opID int64) error {
|
||||
return errors.New("the quarantined original was already purged")
|
||||
}
|
||||
switch o.Action {
|
||||
case store.ActLink, store.ActPromote, store.ActBuild, store.ActRemove, store.ActRename, store.ActRemoveFolder:
|
||||
case store.ActLink, store.ActPromote, store.ActBuild, store.ActRemove, store.ActRename, store.ActRemoveFolder, store.ActRemoveDupe:
|
||||
default:
|
||||
// History can hold operations of features that were removed (tag
|
||||
// edits, file moves); undoing them as a link would be wrong.
|
||||
@@ -643,6 +643,16 @@ func (e *Engine) Undo(ctx context.Context, opID int64) error {
|
||||
pruneEmpty(filepath.Dir(o.QuarantinePath), l.quarantine)
|
||||
return nil
|
||||
}
|
||||
if o.Action == store.ActRemoveDupe {
|
||||
if err := e.undoRemoveDupe(ctx, l, o); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := e.st.MarkUndone(ctx, o.ID); err != nil {
|
||||
return err
|
||||
}
|
||||
e.log.Info("duplicate restored from quarantine", "op", o.ID, "slave", o.RelSlave)
|
||||
return nil
|
||||
}
|
||||
if o.Action == store.ActRename {
|
||||
if err := undoRename(l, o); err != nil {
|
||||
return err
|
||||
|
||||
Reference in new issue
Block a user