Skip to content

Commit

Permalink
pass id/index when creating imdb_ratings/imdb_episodes
Browse files Browse the repository at this point in the history
  • Loading branch information
ddboline committed Aug 18, 2024
1 parent 8acdb20 commit 3a5b89d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
7 changes: 4 additions & 3 deletions movie_collection_lib/src/imdb_episodes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -193,9 +193,9 @@ impl ImdbEpisodes {
let query = query!(
r#"
INSERT INTO imdb_episodes (
show, season, episode, airdate, rating, eptitle, epurl, last_modified
show, season, episode, airdate, rating, eptitle, epurl, last_modified, id
) VALUES (
$show, $season, $episode, $airdate, $rating, $eptitle, $epurl, now()
$show, $season, $episode, $airdate, $rating, $eptitle, $epurl, $id, now()
)
"#,
show = self.show,
Expand All @@ -204,7 +204,8 @@ impl ImdbEpisodes {
airdate = self.airdate,
rating = self.rating,
eptitle = self.eptitle,
epurl = self.epurl
epurl = self.epurl,
id = self.id,
);
let conn = pool.get().await?;
query.execute(&conn).await.map(|_| ()).map_err(Into::into)
Expand Down
7 changes: 4 additions & 3 deletions movie_collection_lib/src/imdb_ratings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,16 +49,17 @@ impl ImdbRatings {
let query = query!(
r#"
INSERT INTO imdb_ratings
(show, title, link, rating, istv, source, last_modified)
(show, title, link, rating, istv, source, index, last_modified)
VALUES
($show, $title, $link, $rating, $istv, $source, now())
($show, $title, $link, $rating, $istv, $source, $index, now())
"#,
show = self.show,
title = self.title,
link = self.link,
rating = self.rating,
istv = self.istv,
source = source
source = source,
index = self.index,
);
debug!("{:?}", self);
let conn = pool.get().await?;
Expand Down

0 comments on commit 3a5b89d

Please sign in to comment.