Browse Source

Fix metadata.html crash. Closes #746. Re: #685

initial-username
Gabe Kangas 5 months ago
parent
commit
dc8cdb09d5
2 changed files with 7 additions and 8 deletions
  1. +2
    -2
      controllers/index.go
  2. +5
    -6
      static/metadata.html

+ 2
- 2
controllers/index.go View File

@ -26,7 +26,6 @@ type MetadataPage struct {
Image string
Thumbnail string
TagsString string
Title string
Summary string
Name string
Tags []string
@ -77,7 +76,7 @@ func handleScraperMetadataPage(w http.ResponseWriter, r *http.Request) {
if err != nil {
log.Panicln(err)
}
imageURL, err := url.Parse(fmt.Sprintf("http://%s%s", r.Host, data.GetLogoPath()))
imageURL, err := url.Parse(fmt.Sprintf("http://%s%s", r.Host, "/logo"))
if err != nil {
log.Panicln(err)
}
@ -100,6 +99,7 @@ func handleScraperMetadataPage(w http.ResponseWriter, r *http.Request) {
tagsString := strings.Join(data.GetServerMetadataTags(), ",")
metadata := MetadataPage{
Name: data.GetServerName(),
RequestedURL: fullURL.String(),
Image: imageURL.String(),
Thumbnail: thumbnailURL,


+ 5
- 6
static/metadata.html View File

@ -4,11 +4,11 @@
<head>
<meta charset="utf-8">
<title>{{.Config.Title}}</title>
<title>{{.Name}}</title>
<meta name="description" content="{{.Summary}}">
<meta property="og:title" content="{{.Title}}">
<meta property="og:site_name" content="{{.Title}}">
<meta property="og:title" content="{{.Name}}">
<meta property="og:site_name" content="{{.Name}}">
<meta property="og:url" content="{{.RequestedURL}}">
<meta property="og:description" content="{{.Summary}}">
<meta property="og:type" content="video.other">
@ -24,7 +24,7 @@
<meta property="og:video:type" content="application/x-mpegURL" />
<meta property="og:video:actor" content="{{.Name}}" />
<meta property="twitter:title" content="{{.Title}}">
<meta property="twitter:title" content="{{.Name}}">
<meta property="twitter:url" content="{{.RequestedURL}}">
<meta property="twitter:description" content="{{.Summary}}">
<meta property="twitter:image" content="{{.Image}}">
@ -51,8 +51,7 @@
</head>
<body>
<h1>{{.Title}}</h1>
<h2>{{.Name}}</h2>
<h1>{{.Name}}</h1>
<center>
<img src="{{.Thumbnail}}" width=10% />


Loading…
Cancel
Save