1
0
mirror of https://gitlab.com/comunic/comunicapiv3 synced 2025-06-21 00:45:18 +00:00

Can create YouTube posts

This commit is contained in:
2020-07-08 13:05:06 +02:00
parent 8753f77227
commit 11051b28a0
3 changed files with 41 additions and 3 deletions

View File

@ -75,7 +75,7 @@ pub fn create(p: &Post) -> ResultBoxError<u64> {
.add_opt_str("texte", p.content.as_ref());
match &p.kind {
PostKind::POST_KIND_TEXT => {/* nothing to do */},
PostKind::POST_KIND_TEXT => { /* nothing to do */ }
// Posts with associated file
POST_KIND_IMAGE(file) | POST_KIND_PDF(file) => {
@ -84,6 +84,11 @@ pub fn create(p: &Post) -> ResultBoxError<u64> {
.add_opt_str("file_type", file.file_type.as_ref());
}
// YouTube posts
POST_KIND_YOUTUBE(id) => {
insert_query = insert_query.add_str("path", id)
.add_str("type", "youtube");
}
_ => unimplemented!()
/*
@ -91,7 +96,7 @@ pub fn create(p: &Post) -> ResultBoxError<u64> {
POST_KIND_MOVIE(_) => {},
POST_KIND_COUNTDOWN(_) => {},
POST_KIND_SURVEY => {},
POST_KIND_YOUTUBE(_) => {},*/
*/
}
// Execute insertion