feat(frontend): plex library scan

This commit is contained in:
sct
2020-10-30 14:38:19 +00:00
parent 97e30367fb
commit 1bc3f7be4b
7 changed files with 271 additions and 52 deletions

View File

@@ -13,6 +13,14 @@ const imdbRegex = new RegExp(/imdb:\/\/(tt[0-9]+)/);
const tmdbRegex = new RegExp(/tmdb:\/\/([0-9]+)/);
const plexRegex = new RegExp(/plex:\/\//);
export interface SyncStatus {
running: boolean;
progress: number;
total: number;
currentLibrary: Library;
libraries: Library[];
}
class JobPlexSync {
private tmdb: TheMovieDb;
private plexClient: PlexAPI;
@@ -161,7 +169,7 @@ class JobPlexSync {
}
}
public status() {
public status(): SyncStatus {
return {
running: this.running,
progress: this.progress,

View File

@@ -106,7 +106,7 @@ settingsRoutes.get('/plex/library', async (req, res) => {
settingsRoutes.get('/plex/sync', (req, res) => {
if (req.query.cancel) {
jobPlexSync.cancel();
} else {
} else if (req.query.start) {
jobPlexSync.run();
}