mirror of
https://gitlab.com/comunic/comunicapiv2
synced 2024-11-22 13:29:22 +00:00
Post are more complete
This commit is contained in:
parent
f18a0952d6
commit
f0c8781ba7
@ -58,6 +58,7 @@ export class PostsController {
|
|||||||
visibility_level: VISIBILITY_LEVELS_API[p.visibilityLevel],
|
visibility_level: VISIBILITY_LEVELS_API[p.visibilityLevel],
|
||||||
kind: p.kind,
|
kind: p.kind,
|
||||||
|
|
||||||
|
|
||||||
// File specific
|
// File specific
|
||||||
file_size: !p.hasFile ? null : p.file.size,
|
file_size: !p.hasFile ? null : p.file.size,
|
||||||
file_type: !p.hasFile ? null : p.file.type,
|
file_type: !p.hasFile ? null : p.file.type,
|
||||||
@ -66,9 +67,19 @@ export class PostsController {
|
|||||||
|
|
||||||
|
|
||||||
// Movie specific
|
// Movie specific
|
||||||
video_id: p.kind == PostKind.POST_KIND_MOVIE ? p.movieID : null,
|
video_id: p.hasMovie ? p.movieID : null,
|
||||||
video_info: p.kind == PostKind.POST_KIND_MOVIE ?
|
video_info: p.hasMovie ?
|
||||||
MoviesController.MovieToAPI(await MoviesHelper.GetInfo(p.movieID)) : null
|
MoviesController.MovieToAPI(await MoviesHelper.GetInfo(p.movieID)) : null,
|
||||||
|
|
||||||
|
|
||||||
|
// Countdown timer specific
|
||||||
|
time_end: p.hasTimeEnd ? p.timeEnd : null,
|
||||||
|
|
||||||
|
// Weblink specific
|
||||||
|
link_url: !p.hasLink ? null : p.link.url,
|
||||||
|
link_title: !p.hasLink ? null : p.link.title,
|
||||||
|
link_description: !p.hasLink ? null : p.link.description,
|
||||||
|
link_image: !p.hasLink ? null : p.link.image
|
||||||
};
|
};
|
||||||
|
|
||||||
return data;
|
return data;
|
||||||
|
@ -148,4 +148,16 @@ export class Post implements PostBuilder {
|
|||||||
get hasFile() : boolean {
|
get hasFile() : boolean {
|
||||||
return this.file != null && this.file != undefined;
|
return this.file != null && this.file != undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get hasMovie() : boolean {
|
||||||
|
return this.kind == PostKind.POST_KIND_MOVIE;
|
||||||
|
}
|
||||||
|
|
||||||
|
get hasTimeEnd() : boolean {
|
||||||
|
return this.kind == PostKind.POST_KIND_COUNTDOWN;
|
||||||
|
}
|
||||||
|
|
||||||
|
get hasLink() : boolean {
|
||||||
|
return this.kind == PostKind.POST_KIND_WEBLINK;
|
||||||
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user