mirror of
https://gitlab.com/comunic/comunicapiv2
synced 2025-06-20 08:35:17 +00:00
Return information about a single movie
This commit is contained in:
@ -26,7 +26,7 @@ export class MoviesController {
|
||||
*
|
||||
* @param m The movie to convert
|
||||
*/
|
||||
private static MovieToAPI(m: Movie): any {
|
||||
public static MovieToAPI(m: Movie): any {
|
||||
return {
|
||||
id: m.id,
|
||||
uri: m.uri,
|
||||
|
@ -1,7 +1,9 @@
|
||||
import { RequestHandler } from "../entities/RequestHandler";
|
||||
import { UserHelper } from "../helpers/UserHelper";
|
||||
import { PostsHelper } from "../helpers/PostsHelper";
|
||||
import { Post, PostVisibilityLevel } from "../entities/Post";
|
||||
import { Post, PostVisibilityLevel, PostKind } from "../entities/Post";
|
||||
import { MoviesController } from "./MoviesController";
|
||||
import { MoviesHelper } from "../helpers/MoviesHelper";
|
||||
|
||||
/**
|
||||
* Posts controller
|
||||
@ -60,7 +62,13 @@ export class PostsController {
|
||||
file_size: !p.hasFile ? null : p.file.size,
|
||||
file_type: !p.hasFile ? null : p.file.type,
|
||||
file_path: !p.hasFile ? null : p.file.path,
|
||||
file_url: !p.hasFile ? null : p.file.url
|
||||
file_url: !p.hasFile ? null : p.file.url,
|
||||
|
||||
|
||||
// Movie specific
|
||||
video_id: p.kind == PostKind.POST_KIND_MOVIE ? p.movieID : null,
|
||||
video_info: p.kind == PostKind.POST_KIND_MOVIE ?
|
||||
MoviesController.MovieToAPI(await MoviesHelper.GetInfo(p.movieID)) : null
|
||||
};
|
||||
|
||||
return data;
|
||||
|
Reference in New Issue
Block a user