Skip to content

Commit

Permalink
feat: added album covers as url or images
Browse files Browse the repository at this point in the history
  • Loading branch information
studiowebux committed Nov 29, 2023
1 parent e6e7757 commit 5ce2db8
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/output.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,18 @@ export function processCurrentlyPlayingTrack(
/{{ album_cover_small }}|{{album_cover_small}}/g,
`![${data.item.album.name}](${data.item.album.images[2]?.url})`
)
.replace(
/{{ album_cover_link_large }}|{{album_cover_link_large}}/g,
data.item.album.images[0].url
)
.replace(
/{{ album_cover_link_medium }}|{{album_cover_link_medium}}/g,
data.item.album.images[1]?.url
)
.replace(
/{{ album_cover_link_small }}|{{album_cover_link_small}}/g,
data.item.album.images[2]?.url
)
.replace(
/{{ album_link }}|{{album_link}}/g,
data.item.album.external_urls.spotify
Expand Down
3 changes: 3 additions & 0 deletions src/settingsTab.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,9 @@ export default class SettingsTab extends PluginSettingTab {
.createEl("li", { text: "{{ album_cover_large }}" })
.createEl("li", { text: "{{ album_cover_medium }}" })
.createEl("li", { text: "{{ album_cover_small }}" })
.createEl("li", { text: "{{ album_cover_link_large }}" })
.createEl("li", { text: "{{ album_cover_link_medium }}" })
.createEl("li", { text: "{{ album_cover_link_small }}" })
.createEl("li", { text: "{{ album_link }}" })
.createEl("li", { text: "{{ artists }}" })
.createEl("li", { text: "{{ song_name }}" })
Expand Down

0 comments on commit 5ce2db8

Please sign in to comment.