Skip to content

Commit

Permalink
fix: availability sync file detection (#3371)
Browse files Browse the repository at this point in the history
* fix: added extra check for unmonitored movies in radarr

* feat: created new radarr/sonarr routes  to grab existing series data

* refactor: updated job routes to check by external service id

* fix: season check will now also look at episode file count
  • Loading branch information
OwsleyJr committed May 11, 2023
1 parent 77a33cb commit 7522aa3
Show file tree
Hide file tree
Showing 2 changed files with 320 additions and 229 deletions.
19 changes: 19 additions & 0 deletions server/api/servarr/sonarr.ts
Expand Up @@ -76,6 +76,15 @@ export interface SonarrSeries {
ignoreEpisodesWithoutFiles?: boolean;
searchForMissingEpisodes?: boolean;
};
statistics: {
seasonCount: number;
episodeFileCount: number;
episodeCount: number;
totalEpisodeCount: number;
sizeOnDisk: number;
releaseGroups: string[];
percentOfEpisodes: number;
};
}

export interface AddSeriesOptions {
Expand Down Expand Up @@ -116,6 +125,16 @@ class SonarrAPI extends ServarrBase<{
}
}

public async getSeriesById(id: number): Promise<SonarrSeries> {
try {
const response = await this.axios.get<SonarrSeries>(`/series/${id}`);

return response.data;
} catch (e) {
throw new Error(`[Sonarr] Failed to retrieve series by ID: ${e.message}`);
}
}

public async getSeriesByTitle(title: string): Promise<SonarrSeries[]> {
try {
const response = await this.axios.get<SonarrSeries[]>('/series/lookup', {
Expand Down

0 comments on commit 7522aa3

Please sign in to comment.