fix:#46 updated fetcher and empty course issue

This commit is contained in:
Elmar Kresse
2024-07-05 15:23:10 +02:00
parent a5a8c2a58d
commit ab22364ac8
7 changed files with 76 additions and 72 deletions

View File

@@ -89,8 +89,9 @@ func removeDuplicates(groups db.SeminarGroups) db.SeminarGroups {
uniqueGroups := make(db.SeminarGroups, 0, len(groups))
seen := make(map[string]struct{}) // Use an empty struct to minimize memory usage
// unique Identifier is the course and semester
for _, group := range groups {
key := group.Course + group.Semester
key := group.UniqueKey()
if _, exists := seen[key]; !exists {
seen[key] = struct{}{}
uniqueGroups = append(uniqueGroups, group)