mirror of
https://github.com/sakaljurgis/kodi-api-server.git
synced 2026-07-09 04:47:41 +00:00
add recent searches module
This commit is contained in:
@@ -2,12 +2,14 @@ import { Injectable } from '@nestjs/common';
|
||||
import ApiResponse from '../Dto/api-response.dto';
|
||||
import { KodiApiResponseFactory } from '../kodi-api-response.factory';
|
||||
import { LrtApiClient } from './LrtApiClient/lrt-api.client';
|
||||
import { RecentSearchesService } from '../RecentSearches/recent-searches.service';
|
||||
|
||||
@Injectable()
|
||||
export class LrtService {
|
||||
constructor(
|
||||
private readonly kodiApiResponseFactory: KodiApiResponseFactory,
|
||||
private readonly lrtApiClient: LrtApiClient,
|
||||
private readonly recentSearchesService: RecentSearchesService
|
||||
) {}
|
||||
|
||||
getMainMenu(): ApiResponse {
|
||||
@@ -19,7 +21,9 @@ export class LrtService {
|
||||
}
|
||||
|
||||
private createMainMenu(apiResponse: ApiResponse): void {
|
||||
//todo - refactor to 5 most recent searches + viskas?
|
||||
const items = {
|
||||
'lrt/recent': 'neseniai ieskoti',
|
||||
'lrt/tema/vaikams': 'vaikams',
|
||||
'lrt/tema/sportas': 'sportas',
|
||||
'lrt/tema/kultura': 'kultura',
|
||||
@@ -82,4 +86,8 @@ export class LrtService {
|
||||
|
||||
return apiResponse;
|
||||
}
|
||||
|
||||
async getRecentSearches(): Promise<ApiResponse> {
|
||||
return this.recentSearchesService.getRecentSearches('lrt', 'lrt/search');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user