Browse Source

Add override keyword to torrent-search service

dev
David Ludwig 4 years ago
parent
commit
3933b9426d
4 changed files with 8 additions and 8 deletions
  1. +2
    -2
      services/torrent-search/src/services/IpcInterface.ts
  2. +1
    -1
      services/torrent-search/src/services/TorrentSearch.ts
  3. +4
    -4
      services/torrent-search/src/torrents/providers/rarbg/index.ts
  4. +1
    -1
      services/torrent-search/src/torrents/providers/torrentgalaxy/index.ts

+ 2
- 2
services/torrent-search/src/services/IpcInterface.ts View File

@ -23,14 +23,14 @@ export default class IpcInterface extends IpcServerService
/**
* Link the IPC service to other required internal services
*/
public link(app: Microservice) {
public override link(app: Microservice) {
this.search = app.service<TorrentSearch>("Torrent Search");
}
/**
* Install the the event handlers
*/
protected installMessageHandlers() {
protected override installMessageHandlers() {
this.addMessageHandler("search_movie", this.searchMovie);
}


+ 1
- 1
services/torrent-search/src/services/TorrentSearch.ts View File

@ -29,7 +29,7 @@ export default class TorrentSearch extends InternalService
/**
* Boot the torrent search sorvice
*/
public async boot() {
public override async boot() {
let providerClasses = Object.values(providers);
this.providers = providerClasses.map(ProviderClass => new ProviderClass());
this.movieProviders = this.providers.filter(provider => provider.PROVIDES & MediaType.Movies);


+ 4
- 4
services/torrent-search/src/torrents/providers/rarbg/index.ts View File

@ -33,7 +33,7 @@ export default class Rarbg extends Provider
/**
* Since the API is sereverly broken, we need a bunch of retries
*/
protected readonly SEARCH_RETRIES = 30;
protected override readonly SEARCH_RETRIES = 30;
/**
* Store the time when the API needs to re-authenticate
@ -48,14 +48,14 @@ export default class Rarbg extends Provider
/**
* Indicate if the API is currently authenticated
*/
protected async isAuthenticated() {
protected override async isAuthenticated() {
return Date.now() < this.nextAuthenticationTime;
}
/**
* Authenticate the RARBG context
*/
protected async authenticate() {
protected override async authenticate() {
let now = Date.now();
let [status, response] = await jsonRequest<ITokenResponse>(
`${URL_BASE}&get_token=get_token`
@ -71,7 +71,7 @@ export default class Rarbg extends Provider
/**
* Search for a movie
*/
public async searchMovieImdb(imdbId: string, movie: IMovieSearchInfo) {
public override async searchMovieImdb(imdbId: string, movie: IMovieSearchInfo) {
let [_, response] = await jsonRequest<ISearchResult>(
`${URL_BASE}&token=${this.token}`
+ `&mode=search&search_imdb=${imdbId}`


+ 1
- 1
services/torrent-search/src/torrents/providers/torrentgalaxy/index.ts View File

@ -23,7 +23,7 @@ export default class TorrentGalaxy extends Provider
/**
* Search for a movie
*/
public async searchMovieImdb(imdbId: string, movie: IMovieSearchInfo) {
public override async searchMovieImdb(imdbId: string, movie: IMovieSearchInfo) {
let torrents = await search(imdbId, undefined, Sort.Seeders);
return torrents.torrents.map(torrent => this.createTorrent(
movie, torrent.name, torrent.size,torrent.seeders, torrent.magnet


Loading…
Cancel
Save