Some main.ts refactoring

This commit is contained in:
mProjectsCode 2022-09-22 13:19:23 +02:00
parent 7ae51676a2
commit 6a0d192aba
8 changed files with 172 additions and 98 deletions

View file

@ -58,6 +58,12 @@ export class MediaTypeManager {
return replaceTags(template, mediaTypeModel);
}
/**
* Takes an object and a MediaType and turns the object into an instance of a MediaTypeModel corresponding to the MediaType passed in.
*
* @param obj
* @param mediaType
*/
createMediaTypeModelFromMediaType(obj: any, mediaType: MediaType): MediaTypeModel {
if (mediaType === MediaType.Movie) {
return new MovieModel(obj);

View file

@ -5,7 +5,7 @@ export const pluginName: string = 'obsidian-media-db-plugin';
export const contactEmail: string = 'm.projects.code@gmail.com';
export const mediaDbTag: string = 'mediaDB';
export const mediaDbVersion: string = '0.3.2';
export const debug: boolean = false;
export const debug: boolean = true;
export function wrapAround(value: number, size: number): number {
return ((value % size) + size) % size;