Skip to content

Commit

Permalink
Fix source name & add lyrics title (#11)
Browse files Browse the repository at this point in the history
* fix source name, add title
* bump version v2.4.1
  • Loading branch information
mr687 authored Jun 10, 2022
1 parent 8d3fd8f commit b1084b6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "songlyrics",
"version": "2.4.0",
"version": "2.4.1",
"description": "Find a lyrics just enter the song title",
"keywords": [
"lyrics",
Expand Down
4 changes: 3 additions & 1 deletion src/lib/songlyrics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { makeSources } from '../sources'
const cleanTitleRegexp = /\s(-.+|\[.+\]|\(.+\))/g
const cleanTitle = (title: string) => title.replace(cleanTitleRegexp, '').trim()
export type TLyrics = {
title: string
lyrics: string
source: {
name: string
Expand All @@ -29,9 +30,10 @@ export const songlyrics = async (
const html = await makeRequest(new URL(ddgResult.c))
const lyrics = await source.parse(htmlParser(html))
return {
title: ddgResult.t.replace(/\|.+/g, '').trim(),
lyrics,
source: {
name: ddgResult.t.replace(/\|.+/g, '').trim(),
name: source.name,
url: ddgResult.i,
link: ddgResult.c,
},
Expand Down

0 comments on commit b1084b6

Please sign in to comment.