1
0
mirror of https://gitlab.com/comunic/comunicapiv3 synced 2025-06-21 08:55:16 +00:00

Deprecate old movies system

This commit is contained in:
2021-02-13 11:12:17 +01:00
parent a6c32d763f
commit 3a22c89b87
16 changed files with 9 additions and 207 deletions

View File

@ -10,7 +10,6 @@ use crate::data::conversation_message::ConversationMessage;
use crate::data::error::ResultBoxError;
use crate::data::friend::Friend;
use crate::data::group_id::GroupID;
use crate::data::movie::Movie;
use crate::data::post::{Post, PostPageKind};
use crate::data::survey_response::SurveyResponse;
use crate::data::user::{User, UserID};
@ -23,7 +22,6 @@ pub struct AccountExport {
pub comments: Vec<Comment>,
pub likes: Vec<UserLike>,
pub survey_responses: Vec<SurveyResponse>,
pub movies: Vec<Movie>,
pub all_conversation_messages: Vec<ConversationMessage>,
pub conversations: Vec<Conversation>,
pub conversation_messages: HashMap<u64, Vec<ConversationMessage>>,

View File

@ -20,7 +20,7 @@ use crate::data::group::GroupAccessLevel;
use crate::data::group_id::GroupID;
use crate::data::post::{Post, PostAccessLevel};
use crate::data::user::UserID;
use crate::helpers::{account_helper, comments_helper, conversations_helper, custom_emojies_helper, friends_helper, groups_helper, movies_helper, posts_helper, user_helper, virtual_directory_helper};
use crate::helpers::{account_helper, comments_helper, conversations_helper, custom_emojies_helper, friends_helper, groups_helper, posts_helper, user_helper, virtual_directory_helper};
use crate::helpers::virtual_directory_helper::VirtualDirType;
use crate::utils::pdf_utils::is_valid_pdf;
use crate::utils::string_utils::{check_emoji_code, check_string_before_insert, check_url, remove_html_nodes};
@ -536,17 +536,6 @@ pub trait BaseRequestHandler {
Ok(comment)
}
/// Get the ID of a movie included in the request
fn post_movie_id(&mut self, name: &str) -> ResultBoxError<u64> {
let movie_id = self.post_u64(name)?;
if !movies_helper::does_user_has(self.user_id_ref()?, movie_id)? {
self.forbidden("You are not authorized to use this movie!".to_string())?;
}
Ok(movie_id)
}
/// Get a content of a post and satinize it
fn post_content(&mut self, name: &str, min_len: usize, required: bool) -> ResultBoxError<String> {
let content = self.post_string_opt(name, min_len, required)?;

View File

@ -96,10 +96,10 @@ pub enum PostKind {
POST_KIND_IMAGE(PostFile),
POST_KIND_WEBLINK(PostWebLink),
POST_KIND_PDF(PostFile),
POST_KIND_MOVIE(u64),
// The ID of the movie
/// Countdown. Value : end time
POST_KIND_COUNTDOWN(u64),
// End time
POST_KIND_SURVEY,
POST_KIND_YOUTUBE(String),
}
@ -111,7 +111,6 @@ impl PostKind {
PostKind::POST_KIND_IMAGE(_) => "image",
PostKind::POST_KIND_WEBLINK(_) => "weblink",
PostKind::POST_KIND_PDF(_) => "pdf",
PostKind::POST_KIND_MOVIE(_) => "movie",
PostKind::POST_KIND_COUNTDOWN(_) => "countdown",
PostKind::POST_KIND_SURVEY => "survey",
PostKind::POST_KIND_YOUTUBE(_) => "youtube",