mirror of
https://github.com/sakaljurgis/kodi-api-server.git
synced 2026-07-09 04:47:41 +00:00
add re-scan all option
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user