Skip to content

Commit 9ab6a74

Browse files
dotarrrobbeverhelstclaude
authored
feat(radarr): add getRelease/addRelease client methods (#225)
* feat(radarr): Adds getRelease/addRelease client methods Mirrors the release search + grab (etc) endpoints already generated in the SDK (getApiV3Release/postApiV3Release) so RadarrClient exposes them. * docs(usage): replace nonexistent grabRelease example with getRelease/addRelease Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> --------- Co-authored-by: Robbe Verhelst <robbe.verhelst@gmail.com> Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
1 parent 8e6652b commit 9ab6a74

3 files changed

Lines changed: 23 additions & 2 deletions

File tree

docs/usage.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,11 @@ const queue = await radarr.getQueue();
127127
// Remove item from queue
128128
await radarr.deleteQueueItem(queueId);
129129

130-
// Grab release
131-
await radarr.grabRelease(releaseGuid);
130+
// Search releases for a movie
131+
const releases = await radarr.getRelease(movieId);
132+
133+
// Grab/push a release
134+
await radarr.addRelease(release);
132135
```
133136

134137
### Quality Management

src/clients/radarr.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -805,6 +805,20 @@ export class RadarrClient extends ServarrBaseClient {
805805
async getDiskSpace() {
806806
return RadarrApi.getApiV3Diskspace();
807807
}
808+
809+
/**
810+
* Search for releases, optionally scoped to a movie
811+
*/
812+
async getRelease(movieId?: number) {
813+
return RadarrApi.getApiV3Release(movieId === undefined ? {} : { query: { movieId } });
814+
}
815+
816+
/**
817+
* Grab/push a release
818+
*/
819+
async addRelease(release: RadarrApi.ReleaseResource) {
820+
return RadarrApi.postApiV3Release({ body: release });
821+
}
808822
}
809823

810824
// Re-export types for external consumption

tests/clients-unit.test.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,10 @@ describe('Client Unit Tests', () => {
165165

166166
// Config methods
167167
expect(typeof client.updateConfig).toBe('function');
168+
169+
// Release methods
170+
expect(typeof client.getRelease).toBe('function');
171+
expect(typeof client.addRelease).toBe('function');
168172
});
169173

170174
it('should update configuration and return new config', () => {

0 commit comments

Comments
 (0)