add re-scan all option

This commit is contained in:
Jurgis Sakalauskas
2023-10-30 11:42:38 +02:00
parent e707fa838b
commit 67dc81090e
4 changed files with 19 additions and 2 deletions
@@ -30,6 +30,11 @@ export class AllFilesController {
return this.allFilesService.scanNewFiles();
}
@Get('scan-all')
scanAllFiles(): KodiApiResponse {
return this.allFilesService.scanAllFiles();
}
@Get('delete/:fileId')
async deleteFile(@Param('fileId') fileId: string): Promise<KodiApiResponse> {
return this.allFilesService.deleteFile(fileId);
@@ -26,6 +26,7 @@ export class AllFilesService {
['Movies', 'movie'],
['Shows', 'show'],
['Scan for new Files', 'scan'],
['Re-Scan Files', 'scan-all'],
],
'all/',
)
@@ -203,6 +204,14 @@ export class AllFilesService {
);
}
public scanAllFiles(): NotificationResponse {
this.videoFilesFacade.updateFsVideoFiles(true);
return this.koiApiResponseFactory.createNotificationResponse(
'Scanning for all files.',
false,
);
}
async deleteFile(fileId: string) {
const id = parseInt(fileId);
const result = await this.videoFilesFacade.deleteFile(id);