2 Commits

Author SHA1 Message Date
davidskrundz 343978e3f2 Strip derivable metadata 2025-05-03 18:38:53 -06:00
davidskrundz 45b0a5e601 Expose TmdbId 2025-05-03 18:08:39 -06:00
12 changed files with 18 additions and 22 deletions
Generated
+3 -3
View File
@@ -214,7 +214,7 @@ checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f"
[[package]] [[package]]
name = "flix" name = "flix"
version = "0.0.1" version = "0.0.2"
dependencies = [ dependencies = [
"chrono", "chrono",
"flix-tmdb", "flix-tmdb",
@@ -224,7 +224,7 @@ dependencies = [
[[package]] [[package]]
name = "flix-cli" name = "flix-cli"
version = "0.0.1" version = "0.0.2"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"clap", "clap",
@@ -238,7 +238,7 @@ dependencies = [
[[package]] [[package]]
name = "flix-tmdb" name = "flix-tmdb"
version = "0.0.1" version = "0.0.2"
dependencies = [ dependencies = [
"chrono", "chrono",
"reqwest", "reqwest",
+2 -2
View File
@@ -34,8 +34,8 @@ overflow-checks = true
strip = "debuginfo" strip = "debuginfo"
[workspace.dependencies] [workspace.dependencies]
flix = { path = "crates/flix", version = "=0.0.1", default-features = false } flix = { path = "crates/flix", version = "=0.0.2", default-features = false }
flix-tmdb = { path = "crates/tmdb", version = "=0.0.1", default-features = false } flix-tmdb = { path = "crates/tmdb", version = "=0.0.2", default-features = false }
anyhow = { version = "^1", default-features = false } anyhow = { version = "^1", default-features = false }
chrono = { version = "^0.4", default-features = false } chrono = { version = "^0.4", default-features = false }
+1 -1
View File
@@ -1,6 +1,6 @@
[package] [package]
name = "flix-cli" name = "flix-cli"
version = "0.0.1" version = "0.0.2"
categories = ["command-line-utilities"] categories = ["command-line-utilities"]
description = "CLI for interacting with flix media" description = "CLI for interacting with flix media"
-3
View File
@@ -50,7 +50,6 @@ impl TmdbObject {
}, },
tmdb: Some(TmdbMovie { tmdb: Some(TmdbMovie {
id: tmdb.id, id: tmdb.id,
collection: tmdb.collection.map(|c| c.id),
genres: tmdb.genres.iter().map(|g| g.id).collect(), genres: tmdb.genres.iter().map(|g| g.id).collect(),
}), }),
})?, })?,
@@ -67,7 +66,6 @@ impl TmdbObject {
})?, })?,
TmdbObject::Season(tmdb) => toml::to_string(&Season { TmdbObject::Season(tmdb) => toml::to_string(&Season {
season: GenericSeason { season: GenericSeason {
number: tmdb.season_number,
name: tmdb.name, name: tmdb.name,
overview: tmdb.overview, overview: tmdb.overview,
air_date: tmdb.air_date, air_date: tmdb.air_date,
@@ -75,7 +73,6 @@ impl TmdbObject {
})?, })?,
TmdbObject::Episode(tmdb) => toml::to_string(&Episode { TmdbObject::Episode(tmdb) => toml::to_string(&Episode {
episode: GenericEpisode { episode: GenericEpisode {
number: tmdb.episode_number,
name: tmdb.name, name: tmdb.name,
overview: tmdb.overview, overview: tmdb.overview,
air_date: tmdb.air_date, air_date: tmdb.air_date,
+1 -1
View File
@@ -1,6 +1,6 @@
[package] [package]
name = "flix" name = "flix"
version = "0.0.1" version = "0.0.2"
categories = [] categories = []
description = "Types for storing persistent data about media" description = "Types for storing persistent data about media"
-2
View File
@@ -10,8 +10,6 @@ pub struct Episode {
/// The generic episode data /// The generic episode data
#[derive(Debug, serde::Serialize, serde::Deserialize)] #[derive(Debug, serde::Serialize, serde::Deserialize)]
pub struct GenericEpisode { pub struct GenericEpisode {
/// The episode's number
pub number: i32,
/// The episode's name /// The episode's name
pub name: String, pub name: String,
/// The episode's overview /// The episode's overview
+1 -3
View File
@@ -1,5 +1,5 @@
#[cfg(feature = "tmdb")] #[cfg(feature = "tmdb")]
use flix_tmdb::model::{CollectionId, MovieGenreId, MovieId}; use flix_tmdb::model::{MovieGenreId, MovieId};
use chrono::NaiveDate; use chrono::NaiveDate;
@@ -31,8 +31,6 @@ pub struct GenericMovie {
pub struct TmdbMovie { pub struct TmdbMovie {
/// The movie's TMDB ID /// The movie's TMDB ID
pub id: MovieId, pub id: MovieId,
/// The movie's collection's TMDB ID
pub collection: Option<CollectionId>,
/// The list of genre TMDB IDs that the movie is associated with /// The list of genre TMDB IDs that the movie is associated with
pub genres: Vec<MovieGenreId>, pub genres: Vec<MovieGenreId>,
} }
-2
View File
@@ -10,8 +10,6 @@ pub struct Season {
/// The generic season data /// The generic season data
#[derive(Debug, serde::Serialize, serde::Deserialize)] #[derive(Debug, serde::Serialize, serde::Deserialize)]
pub struct GenericSeason { pub struct GenericSeason {
/// The season's number
pub number: i32,
/// The season's name /// The season's name
pub name: String, pub name: String,
/// The season's overview /// The season's overview
+1 -1
View File
@@ -1,6 +1,6 @@
[package] [package]
name = "flix-tmdb" name = "flix-tmdb"
version = "0.0.1" version = "0.0.2"
categories = [] categories = []
description = "Clients and models for fetching data from TMDB" description = "Clients and models for fetching data from TMDB"
+2 -2
View File
@@ -1,5 +1,5 @@
# flix # flix-tmdb
[![Crates Version](https://img.shields.io/crates/v/flix.svg)](https://crates.io/crates/flix) [![Crates Version](https://img.shields.io/crates/v/flix-tmdb.svg)](https://crates.io/crates/flix-tmdb)
A library providing clients and models for fetching data from TMDB A library providing clients and models for fetching data from TMDB
+6 -2
View File
@@ -18,8 +18,11 @@ pub enum Collection {}
pub enum Movie {} pub enum Movie {}
pub enum Show {} pub enum Show {}
type Inner = i32; /// The inner type of TmdbId
pub type Inner = i32;
/// Wraps an ID from TMDB, the generic parameter is to enforce that
/// IDs for different types of media are not interchangeable
#[derive(serde::Serialize, serde::Deserialize)] #[derive(serde::Serialize, serde::Deserialize)]
#[serde(transparent)] #[serde(transparent)]
#[repr(transparent)] #[repr(transparent)]
@@ -30,7 +33,8 @@ pub struct TmdbId<T> {
} }
impl<T> TmdbId<T> { impl<T> TmdbId<T> {
pub fn inner(&self) -> Inner { /// Extract the inner value
pub fn inner(self) -> Inner {
self.inner self.inner
} }
} }
+1
View File
@@ -15,3 +15,4 @@ pub use serde::*;
pub use show::*; pub use show::*;
pub use id::{CollectionId, MovieGenreId, MovieId, ShowGenreId, ShowId}; pub use id::{CollectionId, MovieGenreId, MovieId, ShowGenreId, ShowId};
pub use id::{Inner as TmdbIdInner, TmdbId};