Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
biezhihua committed Jan 25, 2024
1 parent c13c804 commit 3a83583
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion soda_resource_tools_lib/src/soda.rs
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ fn scrape_mt(

let mut mt_info = mt_infos.get_mut(&mt_info_key).ok_or(SodaError::Str("mt_info is empty"))?;

tracing::info!(target:"soda::info", " {} - {}",mt_info.tvdb_id().unwrap_or(0), mt_info.title());
tracing::info!(target:"soda::info", "tvdb_id = {}, imdb_id = {}, title = {}",mt_info.tvdb_id().unwrap_or("0".to_string()),mt_info.imdb_id().unwrap_or("0"), mt_info.title());

// 更新媒体图片
if scrape_config.enable_scrape_image {
Expand Down
24 changes: 12 additions & 12 deletions soda_resource_tools_lib/src/soda/entity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ impl MTInfo {
pub(crate) fn title(&self) -> &str {
match self {
MTInfo::MOVIE(movie) => match movie {
MovieType::TMDB(movie) => "",
MovieType::TMDB(movie) => movie.movie.name(),
},
MTInfo::TV(tv) => match tv {
TVType::TMDB(tv) => tv.tv.name(),
Expand Down Expand Up @@ -418,31 +418,31 @@ impl MTInfo {
}
}

pub(crate) fn tvdb_id(&self) -> Option<i64> {
pub(crate) fn tvdb_id(&self) -> Option<String> {
match self {
MTInfo::TV(tv) => match tv {
TVType::TMDB(tv) => {
if let Some(external_ids) = &tv.tv.external_ids {
return Some(external_ids.tvdb_id());
}
return None;
return tv.tv.tvdb_id();
}
},
MTInfo::MOVIE(movie) => match movie {
MovieType::TMDB(movie) => {
return movie.movie.tvdb_id();
}
},
_ => None,
}
}

pub(crate) fn imdb_id(&self) -> Option<&str> {
match self {
MTInfo::MOVIE(movie) => match movie {
MovieType::TMDB(movie) => None,
MovieType::TMDB(movie) => {
return movie.movie.imdb_id();
}
},
MTInfo::TV(tv) => match tv {
TVType::TMDB(tv) => {
if let Some(external_ids) = &tv.tv.external_ids {
return Some(external_ids.imdb_id());
}
return None;
return tv.tv.imdb_id();
}
},
}
Expand Down

0 comments on commit 3a83583

Please sign in to comment.