From 9949f1dccfb93ace5f4978d4f069acb4768aa866 Mon Sep 17 00:00:00 2001 From: Pierre HUBERT Date: Sat, 13 Feb 2021 11:26:06 +0100 Subject: [PATCH] Continue to deprecate old movie system --- src/data/mod.rs | 1 - src/data/movie.rs | 14 -------------- src/helpers/posts_helper.rs | 17 ----------------- 3 files changed, 32 deletions(-) delete mode 100644 src/data/movie.rs diff --git a/src/data/mod.rs b/src/data/mod.rs index ab094e0..f1dc5de 100644 --- a/src/data/mod.rs +++ b/src/data/mod.rs @@ -22,7 +22,6 @@ pub mod global_search_result; pub mod friend; pub mod friendship_status; pub mod post; -pub mod movie; pub mod survey; pub mod comment; pub mod new_survey; diff --git a/src/data/movie.rs b/src/data/movie.rs deleted file mode 100644 index 14b7074..0000000 --- a/src/data/movie.rs +++ /dev/null @@ -1,14 +0,0 @@ -//! # Movie information -//! -//! @author Pierre Hubert - -use crate::data::user::UserID; - -pub struct Movie { - pub id: u64, - pub user_id: UserID, - pub name: String, - pub uri: String, - pub file_type: String, - pub size: usize, -} \ No newline at end of file diff --git a/src/helpers/posts_helper.rs b/src/helpers/posts_helper.rs index 28f1130..2b3ccd2 100644 --- a/src/helpers/posts_helper.rs +++ b/src/helpers/posts_helper.rs @@ -8,7 +8,6 @@ use crate::constants::database_tables_names::POSTS_TABLE; use crate::data::error::{ExecError, ResultBoxError}; use crate::data::group_id::GroupID; use crate::data::group_member::GroupMembershipLevel; -use crate::data::movie::Movie; use crate::data::post::{Post, PostAccessLevel, PostFile, PostKind, PostPageKind, PostVisibilityLevel, PostWebLink}; use crate::data::post::PostKind::{POST_KIND_COUNTDOWN, POST_KIND_IMAGE, POST_KIND_PDF, POST_KIND_SURVEY, POST_KIND_WEBLINK, POST_KIND_YOUTUBE}; use crate::data::user::UserID; @@ -470,22 +469,6 @@ pub fn delete_all_user(user_id: &UserID) -> ResultBoxError { Ok(()) } -/// Get all the posts that use of movie -pub fn get_posts_for_movie(m: &Movie) -> ResultBoxError> { - database::QueryInfo::new(POSTS_TABLE) - .cond_u64("idvideo", m.id) - .exec(db_to_post) -} - -/// Delete all the posts associated with a movie -pub fn delete_all_with_movie(m: &Movie) -> ResultBoxError { - for post in get_posts_for_movie(m)? { - delete(&post)?; - } - - Ok(()) -} - /// Turn a post into a database entry fn db_to_post(res: &database::RowResult) -> ResultBoxError { let user_id = if res.get_u64("ID_amis")? == 0 {