George Baugh 3 年之前
父节点
当前提交
34f059daa0
共有 1 个文件被更改,包括 7 次插入5 次删除
  1. 7 5
      lib/Trog/Routes/HTML.pm

+ 7 - 5
lib/Trog/Routes/HTML.pm

@@ -1060,12 +1060,14 @@ sub sitemap ($query) {
                     }] if $url->{is_image};
 
                     # Truncate descriptions
-                    my $desc = substr($url->{data},0,2048) || '';
-                    $desc //= '';
+                    my $desc    = substr($url->{data},0,2048) || '';
+                    my $href    = $url->{href} || '';
+                    my $preview = $url->{preview} || '';
+                    my $domain  = $query->{domain} || '';
                     $out{videos} = [{
-                        content_loc   => "http://$query->{domain}$url->{href}",
-                        thumbnail_loc => "http://$query->{domain}$url->{preview}",
-                        title         => substr($url->{title},0,100),
+                        content_loc   => "http://$domain$href",
+                        thumbnail_loc => "http://$domain$preview",
+                        title         => substr($url->{title},0,100) || '',
                         description   => $desc,
                     }] if $url->{is_video};
                 }