Skip to content

Commit

Permalink
Image URL calculation fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
vpoluyaktov committed Nov 13, 2023
1 parent bb7c392 commit 9edad03
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions internal/controller/searchController.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package controller

import (
"path/filepath"
"net/url"
"sort"
"strconv"
"strings"
Expand Down Expand Up @@ -130,7 +130,7 @@ func (c *SearchController) performSearch(cmd *dto.SearchCommand) {
biggestImage = item.ImageFiles[i]
}
}
item.CoverUrl = "https://" + filepath.Join(item.Server, item.Dir, biggestImage.Name)
item.CoverUrl = (&url.URL{Scheme: "https", Host: item.Server, Path: item.Dir + "/" + biggestImage.Name}).String()
} else {
item.CoverUrl = "No cover available!"
}
Expand Down

0 comments on commit 9edad03

Please sign in to comment.