1
0
mirror of https://gitlab.com/comunic/comunicapiv2 synced 2025-06-20 00:25:17 +00:00

Return information about a single movie

This commit is contained in:
2020-01-03 10:24:05 +01:00
parent 87daf8acbe
commit f18a0952d6
3 changed files with 30 additions and 3 deletions

View File

@ -27,6 +27,25 @@ export class MoviesHelper {
})).map((row) => this.DBToMovie(row));
}
/**
* Get information about a single movie
*
* @param movieID The movie to get
*/
public static async GetInfo(movieID: number) : Promise<Movie> {
const row = await DatabaseHelper.QueryRow({
table: MOVIES_TABLE,
where: {
ID: movieID
}
});
if(row == null)
throw Error("Movie " + movieID + " could not be found!");
return this.DBToMovie(row);
}
/**
* Turn a database entry into a movie object
*