Skip to content

Commit

Permalink
fix: don't retry when no subtitles
Browse files Browse the repository at this point in the history
  • Loading branch information
tympanix committed Jul 9, 2018
1 parent b2c5e8f commit a139b69
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion app/app_subtitle.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,11 @@ func (a *Application) downloadBestSubtitle(ctx notify.Context, m types.Video, l
}
srt, err := onl.Download()
if err != nil && retries > 0 {
c <- ctx.WithError(err).Debug("Retrying subtitle")
p := list.RatedSubtitles(l.List()[1:])
if p.Len() <= 0 {
return nil, ctx.Error(err.Error())
}
c <- ctx.WithError(err).Debug("Retrying subtitle")
return a.downloadBestSubtitle(ctx, m, p, retries-1, c)
}
if err != nil {
Expand Down

0 comments on commit a139b69

Please sign in to comment.