From 5b31802ceb6712248b62e9b91758d1ad349416dd Mon Sep 17 00:00:00 2001 From: BroodjeAap Date: Sat, 1 Oct 2022 11:24:14 +0000 Subject: [PATCH] removed commented code --- main.go | 61 --------------------------------------------------------- 1 file changed, 61 deletions(-) diff --git a/main.go b/main.go index 6eebde8..b6210bc 100644 --- a/main.go +++ b/main.go @@ -133,67 +133,6 @@ func (web Web) watchUpdate(c *gin.Context) { c.Redirect(http.StatusSeeOther, fmt.Sprintf("/watch/%d", watch.ID)) } -/* -func (web Web) viewWatch(c *gin.Context) { - id := c.Param("id") - - var watch Watch - web.db.Model(&Watch{}).First(&watch, id) - - var filters []Filter - web.db.Model(&Filter{}).Where("watch_id = ?", watch.ID).Find(&filters) - - filterMap := make(map[uint]*Filter) - for i := range filters { - filterMap[filters[i].ID] = &filters[i] - } - - currentLayerFilters := []*Filter{} - for i := range filters { - filter := &filters[i] - if filter.ParentID != nil { - parent := filterMap[*filter.ParentID] - parent.Filters = append(parent.Filters, *filter) - } else { - currentLayerFilters = append(currentLayerFilters, filter) - } - } - - bftFilters := []FilterDepth{} - nextLayerFilters := []*Filter{} - depth := 0 - for len(nextLayerFilters) > 0 || len(currentLayerFilters) > 0 { - for len(currentLayerFilters) > 0 { - filter := currentLayerFilters[0] - bftFilters = append(bftFilters, FilterDepth{ - Filter: filter, - Depth: make([]struct{}, depth), - }) - for _, filter := range filter.Filters { - nextLayerFilters = append(nextLayerFilters, &filter) - } - currentLayerFilters = currentLayerFilters[1:] - } - depth += 1 - currentLayerFilters = nextLayerFilters - nextLayerFilters = []*Filter{} - } - - for i := range bftFilters { - fd := &bftFilters[i] - fd.RevDepth = make([]struct{}, depth-len(fd.Depth)) - } - numberOfColumns := depth + 4 - c.HTML(http.StatusOK, "viewWatch", gin.H{ - "Watch": watch, - "Filters": bftFilters, - "MaxDepth": depth, - "Columns": make([]struct{}, numberOfColumns), - "ColumnWidth": 100 / numberOfColumns, - }) -} -*/ - func passiveBot(bot *tgbotapi.BotAPI) { u := tgbotapi.NewUpdate(0) u.Timeout = 60