feat: Series requesting and local file management

This commit is contained in:
Aleksi Lassila
2024-04-07 16:54:04 +03:00
parent 3afafb573a
commit 8ed688d816
23 changed files with 410 additions and 173 deletions

View File

@@ -133,7 +133,7 @@ export class RadarrApi implements Api<paths> {
})
.then((r) => r.data || []) || Promise.resolve([]);
downloadRadarrMovie = (guid: string, indexerId: number) =>
downloadMovie = (guid: string, indexerId: number) =>
this.getClient()
?.POST('/api/v3/release', {
params: {},
@@ -144,7 +144,7 @@ export class RadarrApi implements Api<paths> {
})
.then((res) => res.response.ok) || Promise.resolve(false);
getMovieFilesByMovieId = (movieId: number): Promise<MovieFileResource[]> =>
getFilesByMovieId = (movieId: number): Promise<MovieFileResource[]> =>
this.getClient()
?.GET('/api/v3/moviefile', {
params: {
@@ -154,7 +154,7 @@ export class RadarrApi implements Api<paths> {
}
})
.then((r) => r.data || []) || Promise.resolve([]);
deleteRadarrMovieFile = (id: number) =>
deleteMovieFile = (id: number) =>
this.getClient()
?.DELETE('/api/v3/moviefile/{id}', {
params: {
@@ -177,7 +177,7 @@ export class RadarrApi implements Api<paths> {
.then((r) => (r.data?.records?.filter((record) => record.movie) as MovieDownload[]) || []) ||
Promise.resolve([]);
getRadarrDownloadsById = (radarrId: number) =>
getDownloadsById = (radarrId: number) =>
this.getRadarrDownloads().then((downloads) => downloads.filter((d) => d.movie.id === radarrId));
getRadarrDownloadsByTmdbId = (tmdbId: number) =>