Fix handling of files to delete during delete Gallery operation (#5213)

* Only remove file in zip from image if deleting from zip file
* Only remove file in folder from image if deleting from folder
This commit is contained in:
WithoutPants
2024-09-05 11:27:31 +10:00
committed by GitHub
parent 7a2e59fcef
commit ad17e7defe
8 changed files with 136 additions and 99 deletions

View File

@@ -638,6 +638,20 @@ func (_m *ImageReaderWriter) QueryCount(ctx context.Context, imageFilter *models
return r0, r1
}
// RemoveFileID provides a mock function with given fields: ctx, id, fileID
func (_m *ImageReaderWriter) RemoveFileID(ctx context.Context, id int, fileID models.FileID) error {
ret := _m.Called(ctx, id, fileID)
var r0 error
if rf, ok := ret.Get(0).(func(context.Context, int, models.FileID) error); ok {
r0 = rf(ctx, id, fileID)
} else {
r0 = ret.Error(0)
}
return r0
}
// ResetOCounter provides a mock function with given fields: ctx, id
func (_m *ImageReaderWriter) ResetOCounter(ctx context.Context, id int) (int, error) {
ret := _m.Called(ctx, id)

View File

@@ -190,27 +190,6 @@ func (_m *SceneReaderWriter) CountByFileID(ctx context.Context, fileID models.Fi
return r0, r1
}
// CountByGroupID provides a mock function with given fields: ctx, groupID
func (_m *SceneReaderWriter) CountByGroupID(ctx context.Context, groupID int) (int, error) {
ret := _m.Called(ctx, groupID)
var r0 int
if rf, ok := ret.Get(0).(func(context.Context, int) int); ok {
r0 = rf(ctx, groupID)
} else {
r0 = ret.Get(0).(int)
}
var r1 error
if rf, ok := ret.Get(1).(func(context.Context, int) error); ok {
r1 = rf(ctx, groupID)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// CountByPerformerID provides a mock function with given fields: ctx, performerID
func (_m *SceneReaderWriter) CountByPerformerID(ctx context.Context, performerID int) (int, error) {
ret := _m.Called(ctx, performerID)
@@ -232,48 +211,6 @@ func (_m *SceneReaderWriter) CountByPerformerID(ctx context.Context, performerID
return r0, r1
}
// CountByStudioID provides a mock function with given fields: ctx, studioID
func (_m *SceneReaderWriter) CountByStudioID(ctx context.Context, studioID int) (int, error) {
ret := _m.Called(ctx, studioID)
var r0 int
if rf, ok := ret.Get(0).(func(context.Context, int) int); ok {
r0 = rf(ctx, studioID)
} else {
r0 = ret.Get(0).(int)
}
var r1 error
if rf, ok := ret.Get(1).(func(context.Context, int) error); ok {
r1 = rf(ctx, studioID)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// CountByTagID provides a mock function with given fields: ctx, tagID
func (_m *SceneReaderWriter) CountByTagID(ctx context.Context, tagID int) (int, error) {
ret := _m.Called(ctx, tagID)
var r0 int
if rf, ok := ret.Get(0).(func(context.Context, int) int); ok {
r0 = rf(ctx, tagID)
} else {
r0 = ret.Get(0).(int)
}
var r1 error
if rf, ok := ret.Get(1).(func(context.Context, int) error); ok {
r1 = rf(ctx, tagID)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// CountMissingChecksum provides a mock function with given fields: ctx
func (_m *SceneReaderWriter) CountMissingChecksum(ctx context.Context) (int, error) {
ret := _m.Called(ctx)