updated getTraktMovie to include movie ID and modify title display based on showImage flag
This commit is contained in:
parent
7656f7f501
commit
2a3bb8301c
1 changed files with 5 additions and 2 deletions
7
utils.js
7
utils.js
|
|
@ -169,7 +169,7 @@ export async function getTraktEpisode(username, id, showImage = true) {
|
|||
return { text, url: link }
|
||||
}
|
||||
|
||||
export async function getTraktMovie(username, showImage = true) {
|
||||
export async function getTraktMovie(username, id, showImage = true) {
|
||||
const res = await fetch(
|
||||
`https://trakt.tv/users/${username}/history/movies/added/asc.atom?slurm=${process.env.TRAKT_SLURM}`,
|
||||
)
|
||||
|
|
@ -178,7 +178,10 @@ export async function getTraktMovie(username, showImage = true) {
|
|||
const entry = dom.window.document.querySelector('entry')
|
||||
const title = entry.querySelector('title').textContent
|
||||
const link = entry.querySelector('link').getAttribute('href')
|
||||
return { text: title, url: link }
|
||||
const text = !showImage
|
||||
? title
|
||||
: `${title} `
|
||||
return { text, url: link }
|
||||
}
|
||||
|
||||
export async function getTraktEpisodeAndMovie(username, id, showImage = true) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue