Merge branch 'master' of https://github.com/mProjectsCode/obsidian-media-db-plugin
This commit is contained in:
commit
12ebebc228
7 changed files with 33 additions and 7 deletions
|
|
@ -145,6 +145,7 @@ export class MALAPI extends APIModel {
|
|||
image: result.images?.jpg?.image_url,
|
||||
|
||||
released: true,
|
||||
ageRating: result.rating,
|
||||
premiere: this.plugin.dateFormatter.format(result.aired?.from, this.apiDateFormat),
|
||||
streamingServices: result.streaming?.map(x => x.name).filter(isTruthy),
|
||||
|
||||
|
|
@ -174,6 +175,7 @@ export class MALAPI extends APIModel {
|
|||
image: result.images?.jpg?.image_url,
|
||||
|
||||
released: true,
|
||||
ageRating: result.rating,
|
||||
premiere: this.plugin.dateFormatter.format(result.aired?.from, this.apiDateFormat),
|
||||
streamingServices: result.streaming?.map(x => x.name).filter(isTruthy),
|
||||
|
||||
|
|
@ -203,6 +205,7 @@ export class MALAPI extends APIModel {
|
|||
image: result.images?.jpg?.image_url,
|
||||
|
||||
released: true,
|
||||
ageRating: result.rating,
|
||||
airedFrom: this.plugin.dateFormatter.format(result.aired?.from, this.apiDateFormat),
|
||||
airedTo: this.plugin.dateFormatter.format(result.aired?.to, this.apiDateFormat),
|
||||
airing: result.airing,
|
||||
|
|
|
|||
|
|
@ -75,6 +75,7 @@ interface IdResponse {
|
|||
|
||||
export class MusicBrainzAPI extends APIModel {
|
||||
plugin: MediaDbPlugin;
|
||||
apiDateFormat: string = 'YYYY-MM-DD';
|
||||
|
||||
constructor(plugin: MediaDbPlugin) {
|
||||
super();
|
||||
|
|
@ -117,10 +118,11 @@ export class MusicBrainzAPI extends APIModel {
|
|||
title: result.title,
|
||||
englishTitle: result.title,
|
||||
year: new Date(result['first-release-date']).getFullYear().toString(),
|
||||
releaseDate: this.plugin.dateFormatter.format(result['first-release-date'], this.apiDateFormat) ?? 'unknown',
|
||||
dataSource: this.apiName,
|
||||
url: 'https://musicbrainz.org/release-group/' + result.id,
|
||||
id: result.id,
|
||||
image: 'https://coverartarchive.org/release-group/' + result.id + '/front',
|
||||
image: 'https://coverartarchive.org/release-group/' + result.id + '/front-500.jpg',
|
||||
|
||||
artists: result['artist-credit'].map(a => a.name),
|
||||
subType: result['primary-type'],
|
||||
|
|
@ -153,10 +155,11 @@ export class MusicBrainzAPI extends APIModel {
|
|||
title: result.title,
|
||||
englishTitle: result.title,
|
||||
year: new Date(result['first-release-date']).getFullYear().toString(),
|
||||
releaseDate: this.plugin.dateFormatter.format(result['first-release-date'], this.apiDateFormat) ?? 'unknown',
|
||||
dataSource: this.apiName,
|
||||
url: 'https://musicbrainz.org/release-group/' + result.id,
|
||||
id: result.id,
|
||||
image: 'https://coverartarchive.org/release-group/' + result.id + '/front',
|
||||
image: 'https://coverartarchive.org/release-group/' + result.id + '/front-500.jpg',
|
||||
|
||||
artists: result['artist-credit'].map(a => a.name),
|
||||
genres: result.genres.map(g => g.name),
|
||||
|
|
|
|||
|
|
@ -229,6 +229,9 @@ export class OMDbAPI extends APIModel {
|
|||
image: result.Poster.replace('_SX300', '_SX600'),
|
||||
|
||||
released: true,
|
||||
country: result.Country?.split(', '),
|
||||
boxOffice: result.BoxOffice,
|
||||
ageRating: result.Rated,
|
||||
premiere: this.plugin.dateFormatter.format(result.Released, this.apiDateFormat),
|
||||
|
||||
userData: {
|
||||
|
|
@ -258,6 +261,8 @@ export class OMDbAPI extends APIModel {
|
|||
image: result.Poster.replace('_SX300', '_SX600'),
|
||||
|
||||
released: true,
|
||||
country: result.Country?.split(', '),
|
||||
ageRating: result.Rated,
|
||||
airedFrom: this.plugin.dateFormatter.format(result.Released, this.apiDateFormat),
|
||||
|
||||
userData: {
|
||||
|
|
|
|||
|
|
@ -17,6 +17,9 @@ export class MovieModel extends MediaTypeModel {
|
|||
image: string;
|
||||
|
||||
released: boolean;
|
||||
country: string[];
|
||||
boxOffice: string;
|
||||
ageRating: string;
|
||||
streamingServices: string[];
|
||||
premiere: string;
|
||||
|
||||
|
|
@ -40,6 +43,9 @@ export class MovieModel extends MediaTypeModel {
|
|||
this.image = '';
|
||||
|
||||
this.released = false;
|
||||
this.country = [];
|
||||
this.boxOffice = '';
|
||||
this.ageRating = '';
|
||||
this.streamingServices = [];
|
||||
this.premiere = '';
|
||||
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ export class MusicReleaseModel extends MediaTypeModel {
|
|||
artists: string[];
|
||||
image: string;
|
||||
rating: number;
|
||||
releaseDate: string;
|
||||
|
||||
userData: {
|
||||
personalRating: number;
|
||||
|
|
@ -22,6 +23,8 @@ export class MusicReleaseModel extends MediaTypeModel {
|
|||
this.artists = [];
|
||||
this.image = '';
|
||||
this.rating = 0;
|
||||
this.releaseDate = '';
|
||||
|
||||
this.userData = {
|
||||
personalRating: 0,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -17,6 +17,8 @@ export class SeriesModel extends MediaTypeModel {
|
|||
image: string;
|
||||
|
||||
released: boolean;
|
||||
country: string[];
|
||||
ageRating: string;
|
||||
streamingServices: string[];
|
||||
airing: boolean;
|
||||
airedFrom: string;
|
||||
|
|
@ -42,6 +44,8 @@ export class SeriesModel extends MediaTypeModel {
|
|||
this.image = '';
|
||||
|
||||
this.released = false;
|
||||
this.country = [];
|
||||
this.ageRating = '';
|
||||
this.streamingServices = [];
|
||||
this.airing = false;
|
||||
this.airedFrom = '';
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue