Browse Source

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

pull/749/head
Gabe Kangas 5 years ago
parent
commit
dc8cdb09d5
  1. 4
      controllers/index.go
  2. 11
      static/metadata.html

4
controllers/index.go

@ -26,7 +26,6 @@ type MetadataPage struct { @@ -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) { @@ -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) { @@ -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,

11
static/metadata.html

@ -4,11 +4,11 @@ @@ -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 @@ @@ -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 @@ @@ -51,8 +51,7 @@
</head>
<body>
<h1>{{.Title}}</h1>
<h2>{{.Name}}</h2>
<h1>{{.Name}}</h1>
<center>
<img src="{{.Thumbnail}}" width=10% />

Loading…
Cancel
Save