fix repair; repair.json, remove arr details from endpoint

This commit is contained in:
Mukhtar Akere
2025-03-12 04:53:01 +01:00
parent a30861984c
commit c0589d4ad2
5 changed files with 32 additions and 34 deletions

View File

@@ -94,7 +94,8 @@ func (a *Arr) GetMedia(mediaId string) ([]Content, error) {
files = append(files, ContentFile{
FileId: file.Id,
Path: file.Path,
Id: eId,
Id: d.Id,
EpisodeId: eId,
SeasonNumber: file.SeasonNumber,
})
}
@@ -179,7 +180,7 @@ func (a *Arr) searchSonarr(files []ContentFile) error {
errs <- fmt.Errorf("failed to automatic search: %v", err)
return
}
if statusOk := strconv.Itoa(resp.StatusCode)[0] == '2'; !statusOk {
if resp.StatusCode >= 300 || resp.StatusCode < 200 {
errs <- fmt.Errorf("failed to automatic search. Status Code: %s", resp.Status)
return
}

View File

@@ -17,6 +17,7 @@ type ContentFile struct {
Name string `json:"name"`
Path string `json:"path"`
Id int `json:"id"`
EpisodeId int `json:"showId"`
FileId int `json:"fileId"`
TargetPath string `json:"targetPath"`
IsSymlink bool `json:"isSymlink"`