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:
@ -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
|
||||
*
|
||||
|
Reference in New Issue
Block a user