This commit is contained in:
Moritz Jung 2025-08-08 16:35:42 +02:00
commit 12ebebc228
7 changed files with 33 additions and 7 deletions

View file

@ -1,12 +1,12 @@
## Obsidian Media DB Plugin
A plugin that can query multiple APIs for movies, series, anime, manga, books, games, music and wiki articles, and import them into your vault.
A plugin that can query multiple APIs for movies, series, anime, manga, books, comics, games, music and wiki articles, and import them into your vault.
### Features
#### Search by Title
Search a movie, series, anime, game, music release or wiki article by its name across multiple APIs.
Search a movie, series, anime, manga, book, comic, game, music release or wiki articles by its name across multiple APIs.
#### Search by ID
@ -162,9 +162,11 @@ Now you select the result you want and the plugin will cast it's magic and creat
- you can find this ID in the URL
- e.g. for "Factorio" the URL looks like this `https://store.steampowered.com/app/427520/Factorio/` so the ID is `427520`
- [Open Library](https://openlibrary.org)
- The ID you need is the "work" ID and not the "book" ID, it needs to start with `/works/`. You can find this ID in the URL
- e.g. for "Fantastic Mr. Fox" the URL looks like this `https://openlibrary.org/works/OL45804W` so the ID is `/works/OL45804W`
- This URL is located near the top of the page above the title, see `An edition of Fantastic Mr Fox (1970) `
- The ID can either be the "/work/" ID, the "/book/" ID, or the "/isbn/" ID it needs to start with `/works/`. You can find this ID in the URL
- e.g. for "Fantastic Mr. Fox" the "/works/" URL looks like this `https://openlibrary.org/works/OL45804W` so the ID is `/works/OL45804W`
- This URL is located near the top of the page above the title, see `An edition of Fantastic Mr Fox (1970) `
- For a specific edition of "Fantastic Mr. Fox" the "/books/" URL looks like this `https://openlibrary.org/books/OL3567303M/` so the ID is `/books/OL3567303M`
- This URL is located in the editions section`
- [Moby Games](https://www.mobygames.com)
- you can find this ID in the URL
- e.g. for "Bioshock 2" the URL looks like this `https://www.mobygames.com/game/45089/bioshock-2/` so the ID is `45089`

View file

@ -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,

View file

@ -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),

View file

@ -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: {

View file

@ -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 = '';

View file

@ -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,
};

View file

@ -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 = '';