prep for release
This commit is contained in:
parent
fac8abf701
commit
bf33e7567c
8 changed files with 113 additions and 6026 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
|
@ -34,3 +34,5 @@ exampleVault/.obsidian/*
|
|||
exampleVault/.obsidian/plugins/*
|
||||
exampleVault/.obsidian/plugins/obsidian-media-db-plugin/*
|
||||
!exampleVault/.obsidian/plugins/obsidian-media-db-plugin/.hotreload
|
||||
|
||||
exampleVault/Media DB/*
|
||||
|
|
|
|||
|
|
@ -6,5 +6,6 @@
|
|||
"description": "A plugin that can query multiple APIs for movies, series, anime, games, music and wiki articles, and import them into your vault.",
|
||||
"author": "Moritz Jung",
|
||||
"authorUrl": "https://www.moritzjung.dev",
|
||||
"fundingUrl": "https://github.com/sponsors/mProjectsCode",
|
||||
"isDesktopOnly": false
|
||||
}
|
||||
|
|
|
|||
5912
package-lock.json
generated
5912
package-lock.json
generated
File diff suppressed because it is too large
Load diff
|
|
@ -18,13 +18,14 @@ export abstract class APIModel {
|
|||
|
||||
abstract getById(id: string): Promise<MediaTypeModel>;
|
||||
|
||||
hasType(type: MediaType): boolean {
|
||||
if (
|
||||
this.types.contains(type) &&
|
||||
(Boolean((this.plugin.settings.apiToggle as any)?.[this.apiName]?.[type]) === true || (this.plugin.settings.apiToggle as any)?.[this.apiName]?.[type] === undefined)
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
hasType(_type: MediaType): boolean {
|
||||
// if (
|
||||
// this.types.contains(type) &&
|
||||
// (Boolean((this.plugin.settings.apiToggle as any)?.[this.apiName]?.[type]) === true || (this.plugin.settings.apiToggle as any)?.[this.apiName]?.[type] === undefined)
|
||||
// ) {
|
||||
// return true;
|
||||
// }
|
||||
return true;
|
||||
}
|
||||
|
||||
hasTypeOverlap(types: MediaType[]): boolean {
|
||||
|
|
|
|||
|
|
@ -143,7 +143,6 @@ export class OMDbAPI extends APIModel {
|
|||
onlineRating: Number.parseFloat(result.imdbRating ?? 0),
|
||||
actors: result.Actors?.split(', ') ?? [],
|
||||
image: result.Poster ?? '',
|
||||
plot: result.Plot ?? '',
|
||||
|
||||
released: true,
|
||||
streamingServices: [],
|
||||
|
|
@ -176,7 +175,6 @@ export class OMDbAPI extends APIModel {
|
|||
onlineRating: Number.parseFloat(result.imdbRating ?? 0),
|
||||
actors: result.Actors?.split(', ') ?? [],
|
||||
image: result.Poster ?? '',
|
||||
plot: result.Plot ?? '',
|
||||
|
||||
released: true,
|
||||
streamingServices: [],
|
||||
|
|
|
|||
|
|
@ -12,7 +12,6 @@ export class MovieModel extends MediaTypeModel {
|
|||
onlineRating: number;
|
||||
actors: string[];
|
||||
image: string;
|
||||
plot: string;
|
||||
|
||||
released: boolean;
|
||||
streamingServices: string[];
|
||||
|
|
@ -36,7 +35,6 @@ export class MovieModel extends MediaTypeModel {
|
|||
this.onlineRating = undefined;
|
||||
this.actors = undefined;
|
||||
this.image = undefined;
|
||||
this.plot = undefined;
|
||||
|
||||
this.released = undefined;
|
||||
this.streamingServices = undefined;
|
||||
|
|
|
|||
|
|
@ -21,7 +21,6 @@ export class SeriesModel extends MediaTypeModel {
|
|||
onlineRating: number;
|
||||
actors: string[];
|
||||
image: string;
|
||||
plot: string;
|
||||
|
||||
released: boolean;
|
||||
streamingServices: string[];
|
||||
|
|
@ -47,7 +46,6 @@ export class SeriesModel extends MediaTypeModel {
|
|||
this.onlineRating = undefined;
|
||||
this.actors = undefined;
|
||||
this.image = undefined;
|
||||
this.plot = undefined;
|
||||
|
||||
this.released = undefined;
|
||||
this.streamingServices = undefined;
|
||||
|
|
|
|||
|
|
@ -18,23 +18,24 @@ export interface MediaDbPluginSettings {
|
|||
openNoteInNewTab: boolean;
|
||||
useDefaultFrontMatter: boolean;
|
||||
enableTemplaterIntegration: boolean;
|
||||
apiToggle: {
|
||||
OMDbAPI: {
|
||||
movie: boolean;
|
||||
series: boolean;
|
||||
game: boolean;
|
||||
};
|
||||
MALAPI: {
|
||||
movie: boolean;
|
||||
series: boolean;
|
||||
};
|
||||
SteamAPI: {
|
||||
game: boolean;
|
||||
};
|
||||
MobyGamesAPI: {
|
||||
game: boolean;
|
||||
};
|
||||
};
|
||||
// TODO: disabled for now, as i currently don't have the time to fix this from the original PR that introduced it (#133)
|
||||
// apiToggle: {
|
||||
// OMDbAPI: {
|
||||
// movie: boolean;
|
||||
// series: boolean;
|
||||
// game: boolean;
|
||||
// };
|
||||
// MALAPI: {
|
||||
// movie: boolean;
|
||||
// series: boolean;
|
||||
// };
|
||||
// SteamAPI: {
|
||||
// game: boolean;
|
||||
// };
|
||||
// MobyGamesAPI: {
|
||||
// game: boolean;
|
||||
// };
|
||||
// };
|
||||
movieTemplate: string;
|
||||
seriesTemplate: string;
|
||||
mangaTemplate: string;
|
||||
|
|
@ -83,23 +84,23 @@ const DEFAULT_SETTINGS: MediaDbPluginSettings = {
|
|||
openNoteInNewTab: true,
|
||||
useDefaultFrontMatter: true,
|
||||
enableTemplaterIntegration: false,
|
||||
apiToggle: {
|
||||
OMDbAPI: {
|
||||
movie: true,
|
||||
series: true,
|
||||
game: true,
|
||||
},
|
||||
MALAPI: {
|
||||
movie: true,
|
||||
series: true,
|
||||
},
|
||||
SteamAPI: {
|
||||
game: true,
|
||||
},
|
||||
MobyGamesAPI: {
|
||||
game: true,
|
||||
},
|
||||
},
|
||||
// apiToggle: {
|
||||
// OMDbAPI: {
|
||||
// movie: true,
|
||||
// series: true,
|
||||
// game: true,
|
||||
// },
|
||||
// MALAPI: {
|
||||
// movie: true,
|
||||
// series: true,
|
||||
// },
|
||||
// SteamAPI: {
|
||||
// game: true,
|
||||
// },
|
||||
// MobyGamesAPI: {
|
||||
// game: true,
|
||||
// },
|
||||
// },
|
||||
movieTemplate: '',
|
||||
seriesTemplate: '',
|
||||
mangaTemplate: '',
|
||||
|
|
@ -280,73 +281,73 @@ export class MediaDbSettingTab extends PluginSettingTab {
|
|||
});
|
||||
});
|
||||
|
||||
containerEl.createEl('h3', { text: 'APIs Per Media Type' });
|
||||
containerEl.createEl('h5', { text: 'Movies' });
|
||||
new Setting(containerEl)
|
||||
.setName('OMDb API')
|
||||
.setDesc('Use OMDb API for movies.')
|
||||
.addToggle(cb => {
|
||||
cb.setValue(this.plugin.settings.apiToggle.OMDbAPI.movie).onChange(data => {
|
||||
this.plugin.settings.apiToggle.OMDbAPI.movie = data;
|
||||
void this.plugin.saveSettings();
|
||||
});
|
||||
});
|
||||
new Setting(containerEl)
|
||||
.setName('MAL API')
|
||||
.setDesc('Use MAL API for movies.')
|
||||
.addToggle(cb => {
|
||||
cb.setValue(this.plugin.settings.apiToggle.MALAPI.movie).onChange(data => {
|
||||
this.plugin.settings.apiToggle.MALAPI.movie = data;
|
||||
void this.plugin.saveSettings();
|
||||
});
|
||||
});
|
||||
containerEl.createEl('h5', { text: 'Series' });
|
||||
new Setting(containerEl)
|
||||
.setName('OMDb API')
|
||||
.setDesc('Use OMDb API for series.')
|
||||
.addToggle(cb => {
|
||||
cb.setValue(this.plugin.settings.apiToggle.OMDbAPI.series).onChange(data => {
|
||||
this.plugin.settings.apiToggle.OMDbAPI.series = data;
|
||||
void this.plugin.saveSettings();
|
||||
});
|
||||
});
|
||||
new Setting(containerEl)
|
||||
.setName('MAL API')
|
||||
.setDesc('Use MAL API for series.')
|
||||
.addToggle(cb => {
|
||||
cb.setValue(this.plugin.settings.apiToggle.MALAPI.series).onChange(data => {
|
||||
this.plugin.settings.apiToggle.MALAPI.series = data;
|
||||
void this.plugin.saveSettings();
|
||||
});
|
||||
});
|
||||
containerEl.createEl('h5', { text: 'Games' });
|
||||
new Setting(containerEl)
|
||||
.setName('OMDb API')
|
||||
.setDesc('Use OMDb API for games.')
|
||||
.addToggle(cb => {
|
||||
cb.setValue(this.plugin.settings.apiToggle.OMDbAPI.game).onChange(data => {
|
||||
this.plugin.settings.apiToggle.OMDbAPI.game = data;
|
||||
void this.plugin.saveSettings();
|
||||
});
|
||||
});
|
||||
new Setting(containerEl)
|
||||
.setName('Steam API')
|
||||
.setDesc('Use OMDb API for games.')
|
||||
.addToggle(cb => {
|
||||
cb.setValue(this.plugin.settings.apiToggle.SteamAPI.game).onChange(data => {
|
||||
this.plugin.settings.apiToggle.SteamAPI.game = data;
|
||||
void this.plugin.saveSettings();
|
||||
});
|
||||
});
|
||||
new Setting(containerEl)
|
||||
.setName('MobyGames API')
|
||||
.setDesc('Use MobyGames API for games.')
|
||||
.addToggle(cb => {
|
||||
cb.setValue(this.plugin.settings.apiToggle.MobyGamesAPI.game).onChange(data => {
|
||||
this.plugin.settings.apiToggle.MobyGamesAPI.game = data;
|
||||
void this.plugin.saveSettings();
|
||||
});
|
||||
});
|
||||
// containerEl.createEl('h3', { text: 'APIs Per Media Type' });
|
||||
// containerEl.createEl('h5', { text: 'Movies' });
|
||||
// new Setting(containerEl)
|
||||
// .setName('OMDb API')
|
||||
// .setDesc('Use OMDb API for movies.')
|
||||
// .addToggle(cb => {
|
||||
// cb.setValue(this.plugin.settings.apiToggle.OMDbAPI.movie).onChange(data => {
|
||||
// this.plugin.settings.apiToggle.OMDbAPI.movie = data;
|
||||
// void this.plugin.saveSettings();
|
||||
// });
|
||||
// });
|
||||
// new Setting(containerEl)
|
||||
// .setName('MAL API')
|
||||
// .setDesc('Use MAL API for movies.')
|
||||
// .addToggle(cb => {
|
||||
// cb.setValue(this.plugin.settings.apiToggle.MALAPI.movie).onChange(data => {
|
||||
// this.plugin.settings.apiToggle.MALAPI.movie = data;
|
||||
// void this.plugin.saveSettings();
|
||||
// });
|
||||
// });
|
||||
// containerEl.createEl('h5', { text: 'Series' });
|
||||
// new Setting(containerEl)
|
||||
// .setName('OMDb API')
|
||||
// .setDesc('Use OMDb API for series.')
|
||||
// .addToggle(cb => {
|
||||
// cb.setValue(this.plugin.settings.apiToggle.OMDbAPI.series).onChange(data => {
|
||||
// this.plugin.settings.apiToggle.OMDbAPI.series = data;
|
||||
// void this.plugin.saveSettings();
|
||||
// });
|
||||
// });
|
||||
// new Setting(containerEl)
|
||||
// .setName('MAL API')
|
||||
// .setDesc('Use MAL API for series.')
|
||||
// .addToggle(cb => {
|
||||
// cb.setValue(this.plugin.settings.apiToggle.MALAPI.series).onChange(data => {
|
||||
// this.plugin.settings.apiToggle.MALAPI.series = data;
|
||||
// void this.plugin.saveSettings();
|
||||
// });
|
||||
// });
|
||||
// containerEl.createEl('h5', { text: 'Games' });
|
||||
// new Setting(containerEl)
|
||||
// .setName('OMDb API')
|
||||
// .setDesc('Use OMDb API for games.')
|
||||
// .addToggle(cb => {
|
||||
// cb.setValue(this.plugin.settings.apiToggle.OMDbAPI.game).onChange(data => {
|
||||
// this.plugin.settings.apiToggle.OMDbAPI.game = data;
|
||||
// void this.plugin.saveSettings();
|
||||
// });
|
||||
// });
|
||||
// new Setting(containerEl)
|
||||
// .setName('Steam API')
|
||||
// .setDesc('Use OMDb API for games.')
|
||||
// .addToggle(cb => {
|
||||
// cb.setValue(this.plugin.settings.apiToggle.SteamAPI.game).onChange(data => {
|
||||
// this.plugin.settings.apiToggle.SteamAPI.game = data;
|
||||
// void this.plugin.saveSettings();
|
||||
// });
|
||||
// });
|
||||
// new Setting(containerEl)
|
||||
// .setName('MobyGames API')
|
||||
// .setDesc('Use MobyGames API for games.')
|
||||
// .addToggle(cb => {
|
||||
// cb.setValue(this.plugin.settings.apiToggle.MobyGamesAPI.game).onChange(data => {
|
||||
// this.plugin.settings.apiToggle.MobyGamesAPI.game = data;
|
||||
// void this.plugin.saveSettings();
|
||||
// });
|
||||
// });
|
||||
|
||||
containerEl.createEl('h3', { text: 'New File Location' });
|
||||
// region new file location
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue