making simpler with content instead of audioclips

This commit is contained in:
talksik
2022-05-29 12:09:57 -05:00
parent 1e809f9e43
commit 50e632550c
3 changed files with 32 additions and 28 deletions
+13 -17
View File
@@ -11,32 +11,28 @@ export interface IContent {
// ? persist length of clip for easier viewing for others...
// ?they have to load it anyway and will get metadata anyway?
export class AudioClip implements IContent {
export class ContentBlock implements IContent {
id: string;
constructor(
public creatorUserId: string,
public contentUrl: string,
public contentType: ContentType,
public blobType: string,
public createdDate: Timestamp = Timestamp.now(),
) {}
}
export class Link implements IContent {
id: string;
constructor(
public creatorUserId: string,
public contentUrl: string,
public createdDate: Timestamp = Timestamp.now(),
) {}
export enum ContentType {
audio = 'audio',
link = 'link',
image = 'image',
}
export class Image implements IContent {
id: string;
constructor(
public creatorUserId: string,
public contentUrl: string,
public thumbnailUrl?: string,
public createdDate: Timestamp = Timestamp.now(),
) {}
export function isUrlImage(url: string) {
return url.match(/\.(jpeg|jpg|gif|png)$/) != null;
}