Skip to content

Commit

Permalink
commands(tmdb): move SimplifiedMovie to tmdb model.
Browse files Browse the repository at this point in the history
  • Loading branch information
evieluvsrainbows committed Jul 28, 2024
1 parent 1f2cab7 commit 4483b3d
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 13 deletions.
20 changes: 7 additions & 13 deletions src/commands/search/tmdb/mod.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use crate::{
models::tmdb::Movie,
models::tmdb::{Movie, SimplifiedMovie},
utils::{format_int, locale},
Context, Error
};
Expand All @@ -22,21 +22,15 @@ pub struct SearchResult {
}

#[derive(Deserialize, Debug)]
#[rustfmt::skip]
pub struct Collection {
pub name: String, // The name of the collection.
pub overview: String, // The overview of the collection.
pub poster_path: String, // The poster belonging to the collection.
pub parts: Vec<SimplifiedMovie> // The movies part of the collection.
}

#[derive(Deserialize, Debug)]
pub struct SimplifiedMovie {
pub id: u64, // The TMDb ID belonging to the movie.
pub overview: String, // The overview of the movie.
pub release_date: String, // The release date of the movie.
pub title: String // The title of the movie.
pub name: String, // The name of the collection.
pub overview: String, // The overview of the collection.
pub poster_path: String, // The poster belonging to the collection.
pub parts: Vec<SimplifiedMovie> // The movies part of the collection.
}

/// Commands for interacting with The Movie Database (tmdb.org).
#[poise::command(slash_command, subcommands("collection", "movie"))]
pub async fn tmdb(_context: Context<'_>) -> Result<(), Error> {
Ok(())
Expand Down
9 changes: 9 additions & 0 deletions src/models/tmdb/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,15 @@ pub struct Movie {
pub vote_count: f64 // The movie's total amount of votes on The Movie Database.
}

#[derive(Deserialize, Debug)]
#[rustfmt::skip]
pub struct SimplifiedMovie {
pub id: u64, // The TMDb ID belonging to the movie.
pub overview: String, // The overview of the movie.
pub release_date: String, // The release date of the movie.
pub title: String // The title of the movie.
}

#[derive(Deserialize)]
#[rustfmt::skip]
pub struct Collection {
Expand Down

0 comments on commit 4483b3d

Please sign in to comment.