Merge tags functionality (#1481)

* Add API to merge tags

Add new API endpoint, `tagsMerge(source, destination)` to merge multiple
tags into a single one. The "sources" must be provided as a list of ids
and the destination as a single id. All usages of the source tags
(scenes, markers (primary and additional), images, galleries and
performers) will be updated to the destination tag, all aliases of the
source tags will be updated to the destination, and the name of the
source will be added as alias to the destination as well.

* Add merge tag UI
* Add unit tests
* Update test mocks
* Update internationalisation
* Add changelog entry

Co-authored-by: gitgiggety <gitgiggety@outlook.com>
This commit is contained in:
WithoutPants
2021-06-16 14:33:54 +10:00
committed by GitHub
parent 45f4a5ba81
commit 4fe4da6c01
18 changed files with 468 additions and 14 deletions

View File

@@ -358,13 +358,13 @@ func (_m *PerformerReaderWriter) GetStashIDs(performerID int) ([]*models.StashID
return r0, r1
}
// GetTagIDs provides a mock function with given fields: sceneID
func (_m *PerformerReaderWriter) GetTagIDs(sceneID int) ([]int, error) {
ret := _m.Called(sceneID)
// GetTagIDs provides a mock function with given fields: performerID
func (_m *PerformerReaderWriter) GetTagIDs(performerID int) ([]int, error) {
ret := _m.Called(performerID)
var r0 []int
if rf, ok := ret.Get(0).(func(int) []int); ok {
r0 = rf(sceneID)
r0 = rf(performerID)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).([]int)
@@ -373,7 +373,7 @@ func (_m *PerformerReaderWriter) GetTagIDs(sceneID int) ([]int, error) {
var r1 error
if rf, ok := ret.Get(1).(func(int) error); ok {
r1 = rf(sceneID)
r1 = rf(performerID)
} else {
r1 = ret.Error(1)
}
@@ -508,13 +508,13 @@ func (_m *PerformerReaderWriter) UpdateStashIDs(performerID int, stashIDs []mode
return r0
}
// UpdateTags provides a mock function with given fields: sceneID, tagIDs
func (_m *PerformerReaderWriter) UpdateTags(sceneID int, tagIDs []int) error {
ret := _m.Called(sceneID, tagIDs)
// UpdateTags provides a mock function with given fields: performerID, tagIDs
func (_m *PerformerReaderWriter) UpdateTags(performerID int, tagIDs []int) error {
ret := _m.Called(performerID, tagIDs)
var r0 error
if rf, ok := ret.Get(0).(func(int, []int) error); ok {
r0 = rf(sceneID, tagIDs)
r0 = rf(performerID, tagIDs)
} else {
r0 = ret.Error(0)
}