diff --git a/main.py b/main.py index 26a7960..1de9591 100644 --- a/main.py +++ b/main.py @@ -434,7 +434,7 @@ def render_albums(): return album if delete_mode: - albums_to_delete = delete_albums_mode(album, y, album_rect, current_hovered_index, hover_index) + albums_to_delete = delete_albums_mode(y, album_rect, current_hovered_index, hover_index) y += cons[0] @@ -470,7 +470,7 @@ def handle_album_interaction(album_hover, album): albums_to_delete = [] -def delete_albums_mode(album, y, album_rect, current_hovered_index, hover_index): +def delete_albums_mode(y, album_rect, current_hovered_index, hover_index): global albums_to_delete checkbox_rect = pygame.Rect(cons[2], y + cons[3], checkbox[1], checkbox[1]) checkbox_hover = checkbox_rect.collidepoint(pygame.mouse.get_pos()) @@ -488,16 +488,16 @@ def delete_albums_mode(album, y, album_rect, current_hovered_index, hover_index) if album not in albums_to_delete: albums_to_delete.append(album) - print(albums_to_delete) + elif album in albums_to_delete: albums_to_delete.remove(album) - print(albums_to_delete) + return albums_to_delete checkbox_image = Image((checkbox[0], 0), (cons[2], y + cons[3]), (checkbox[1], checkbox[1])) - if album in albums_to_delete: + if list(storage["albums"].keys())[hover_index] in albums_to_delete: checkbox_image = Image((checkbox[0] + checkbox[1] + 3, 0), (cons[2], y + cons[3]), (checkbox[1], checkbox[1])) checkbox_image.draw(screen) return albums_to_delete diff --git a/main_data.json b/main_data.json index a577a95..7813a24 100644 --- a/main_data.json +++ b/main_data.json @@ -120,10 +120,6 @@ "00:00:00", 0 ] - }, - "2": {}, - "3": {}, - "4": {}, - "5": {} + } } } \ No newline at end of file