Refactored purgeInactive, better test suite setup

This commit is contained in:
Deluan
2020-01-10 19:20:29 -05:00
committed by Deluan Quintão
parent ef79f6342f
commit 9ccd9545e8
7 changed files with 47 additions and 48 deletions
+2 -7
View File
@@ -99,13 +99,8 @@ func (r *mediaFileRepository) GetAllIds() ([]string, error) {
return result, nil
}
func (r *mediaFileRepository) PurgeInactive(active domain.MediaFiles) ([]string, error) {
activeIDs := make([]string, len(active))
for i, mediaFile := range active {
activeIDs[i] = mediaFile.ID
}
return r.purgeInactive(activeIDs)
func (r *mediaFileRepository) PurgeInactive(activeList domain.MediaFiles) ([]string, error) {
return r.purgeInactive(activeList)
}
var _ domain.MediaFileRepository = (*mediaFileRepository)(nil)