mirror of
https://github.com/usememos/memos.git
synced 2025-06-05 22:09:59 +02:00
chore: update link service
This commit is contained in:
@@ -7,16 +7,14 @@ import (
|
||||
apiv2pb "github.com/usememos/memos/proto/gen/api/v2"
|
||||
)
|
||||
|
||||
func (*APIV2Service) GetMetadata(_ context.Context, request *apiv2pb.GetLinkMetadataRequest) (*apiv2pb.GetLinkMetadataResponse, error) {
|
||||
urlStr := request.Url
|
||||
|
||||
htmlMeta, err := getter.GetHTMLMeta(urlStr)
|
||||
func (*APIV2Service) GetLinkMetadata(_ context.Context, request *apiv2pb.GetLinkMetadataRequest) (*apiv2pb.GetLinkMetadataResponse, error) {
|
||||
htmlMeta, err := getter.GetHTMLMeta(request.Link)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return &apiv2pb.GetLinkMetadataResponse{
|
||||
Metadata: &apiv2pb.Metadata{
|
||||
Metadata: &apiv2pb.LinkMetadata{
|
||||
Title: htmlMeta.Title,
|
||||
Description: htmlMeta.Description,
|
||||
Image: htmlMeta.Image,
|
||||
|
Reference in New Issue
Block a user