mirror of
https://github.com/sakaljurgis/kodi-api-server.git
synced 2026-07-09 04:47:41 +00:00
add migrations (package, config, migrations), add exceptions filter for kodi, start VideoFiles module
This commit is contained in:
@@ -25,6 +25,7 @@ export class LrtApiSearchClient {
|
||||
const searchResponse: SearchResponseInterface = resp.data;
|
||||
|
||||
const cats = [];
|
||||
const loadedCategories = new Set();
|
||||
|
||||
//todo - move to mapper
|
||||
const responseDto = new SearchResponseDto(
|
||||
@@ -36,6 +37,9 @@ export class LrtApiSearchClient {
|
||||
if (cats.indexOf(searchItem.category_title) > -1) {
|
||||
continue;
|
||||
}
|
||||
if (loadedCategories.has(searchItem.category_title)) {
|
||||
continue;
|
||||
}
|
||||
const itemDto = new SearchResponseItemDto();
|
||||
itemDto.label = searchItem.category_title;
|
||||
itemDto.thumb =
|
||||
@@ -46,6 +50,7 @@ export class LrtApiSearchClient {
|
||||
itemDto.categoryId = await this.findCategoryId(searchItem.category_url);
|
||||
|
||||
cats.push(searchItem.category_title);
|
||||
loadedCategories.add(searchItem.category_title);
|
||||
responseDto.addItem(itemDto);
|
||||
}
|
||||
|
||||
@@ -83,7 +88,6 @@ export class LrtApiSearchClient {
|
||||
}
|
||||
|
||||
private async findCategoryIdInLrt(categoryUrl: string): Promise<string> {
|
||||
//todo - cache to database
|
||||
const url = 'https://www.lrt.lt' + categoryUrl;
|
||||
const resp = await firstValueFrom(this.httpService.get(url));
|
||||
const body: string = resp.data;
|
||||
|
||||
Reference in New Issue
Block a user