22 lines
518 B
TypeScript
22 lines
518 B
TypeScript
|
import { Console } from "hsconsole";
|
||
|
import MediaRepo from "../repos/MediaRepo";
|
||
|
|
||
|
export default abstract class MediaService {
|
||
|
public static async GetByHash(hash: string) {
|
||
|
try {
|
||
|
return await MediaRepo.SelectByHash(hash);
|
||
|
} catch (e) {
|
||
|
Console.printError(`EUS server service error:\n${e}`);
|
||
|
throw e;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
public static async GetByTag(tag: string) {
|
||
|
try {
|
||
|
return await MediaRepo.SelectByMediaTag(tag);
|
||
|
} catch (e) {
|
||
|
Console.printError(`EUS server service error:\n${e}`);
|
||
|
throw e;
|
||
|
}
|
||
|
}
|
||
|
}
|