Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Letterboxd Fetching Logic #4

Open
wyatt-avilla opened this issue Oct 27, 2024 · 0 comments
Open

Letterboxd Fetching Logic #4

wyatt-avilla opened this issue Oct 27, 2024 · 0 comments
Labels
bug Something isn't working enhancement New feature or request

Comments

@wyatt-avilla
Copy link
Owner

Some(Movie {
title,
rating,
release_year: String::new(),
url: format! {"https://letterboxd.com{link}"},
poster_url: slug.to_string(), // icky, just store the slug in here for now xd
})

right now the poster_url and release_year fields of the movie struct are assigned temporary values before being replaced. this is gross

let html = Html::parse_document(
&reqwest::get(format!(
"https://letterboxd.com/ajax/poster/film/{}/std/70x105/",
movie.poster_url // aka slug
))
.await
.map_err(|err| Box::new(err) as Box<dyn std::error::Error>)?
.text()
.await
.map_err(|err| Box::new(err) as Box<dyn std::error::Error>)?,
);
movie.poster_url = parse_image(&html)?;
movie.release_year = parse_release_year(&html)?;

the initial iterator should produce Movies that don't require additional processing

@wyatt-avilla wyatt-avilla added bug Something isn't working enhancement New feature or request labels Oct 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant