Update OMDb urls to https

This commit is contained in:
Zack Boehm 2024-06-03 01:55:31 -04:00
parent b856c18207
commit f488018f15

View file

@ -17,7 +17,7 @@ export class OMDbAPI extends APIModel {
this.plugin = plugin;
this.apiName = 'OMDbAPI';
this.apiDescription = 'A free API for Movies, Series and Games.';
this.apiUrl = 'http://www.omdbapi.com/';
this.apiUrl = 'https://www.omdbapi.com/';
this.types = [MediaType.Movie, MediaType.Series, MediaType.Game];
this.typeMappings = new Map<string, string>();
this.typeMappings.set('movie', 'movie');
@ -32,7 +32,7 @@ export class OMDbAPI extends APIModel {
throw Error(`MDB | OMDb ${this.apiName} API key missing.`);
}
const searchUrl = `http://www.omdbapi.com/?s=${encodeURIComponent(title)}&apikey=${this.plugin.settings.OMDbKey}`;
const searchUrl = `https://www.omdbapi.com/?s=${encodeURIComponent(title)}&apikey=${this.plugin.settings.OMDbKey}`;
const fetchData = await fetch(searchUrl);
if (fetchData.status === 401) {
@ -110,7 +110,7 @@ export class OMDbAPI extends APIModel {
throw Error(`MDB | OMDb ${this.apiName} API key missing.`);
}
const searchUrl = `http://www.omdbapi.com/?i=${encodeURIComponent(id)}&apikey=${this.plugin.settings.OMDbKey}`;
const searchUrl = `https://www.omdbapi.com/?i=${encodeURIComponent(id)}&apikey=${this.plugin.settings.OMDbKey}`;
const fetchData = await fetch(searchUrl);
if (fetchData.status === 401) {