Skip to content

Commit

Permalink
add plot option in settings
Browse files Browse the repository at this point in the history
add option to choose short or full plot from Omdb
  • Loading branch information
Superschnizel committed Nov 29, 2023
1 parent 9345509 commit 0829b9b
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
13 changes: 13 additions & 0 deletions main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ export default class Moviegrabber extends Plugin {

url.searchParams.append('apikey', this.settings.OMDb_API_Key);
url.searchParams.append('i', movie.imdbID);
url.searchParams.append('plot', this.settings.PlotLength);

// fetch data
var response;
Expand Down Expand Up @@ -502,6 +503,18 @@ class MoviegrabberSettingTab extends PluginSettingTab {
this.plugin.settings.YouTube_API_Key = value;
await this.plugin.saveSettings();
}));

new Setting(containerEl)
.setName('Plot length')
.setDesc('choose the plot length option for Omdb.')
.addDropdown(dropDown => dropDown
.addOption('short', 'short')
.addOption('full', 'full')
.setValue(this.plugin.settings.PlotLength)
.onChange(async (value) => {
this.plugin.settings.PlotLength = value;
await this.plugin.saveSettings();
}))

new Setting(containerEl)
.setName('Switch to generated notes')
Expand Down
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"id": "moviegrabber",
"name": "Moviegrabber",
"version": "1.1.10",
"version": "1.1.11",
"minAppVersion": "0.15.0",
"description": "Grab movie data from public APIs and transform it into notes that can be used with dataview and properties",
"author": "Superschnizel",
Expand Down
5 changes: 4 additions & 1 deletion src/MoviegrabberSettings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ export interface MoviegrabberSettings {

MovieTemplatePath: string;
SeriesTemplatePath: string;

PlotLength: string;
}

export const DEFAULT_SETTINGS: MoviegrabberSettings = {
Expand All @@ -16,7 +18,8 @@ export const DEFAULT_SETTINGS: MoviegrabberSettings = {
YouTube_API_Key: '',
SwitchToCreatedNote: true,
MovieTemplatePath: '',
SeriesTemplatePath: ''
SeriesTemplatePath: '',
PlotLength: 'short'
}

export const DEFAULT_TEMPLATE: string = "---\n"+
Expand Down

0 comments on commit 0829b9b

Please sign in to comment.