fix(actions): handle non download client actions (#903)

fix(actions): handle non download clients
This commit is contained in:
ze0s 2023-05-03 00:10:29 +02:00 committed by GitHub
parent c1746dc7d6
commit 1ca2677f9f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 10 deletions

View file

@ -102,18 +102,20 @@ func (s *service) RunAction(ctx context.Context, action *domain.Action, release
Filter: release.Filter.Name,
Indexer: release.Indexer,
InfoHash: release.TorrentHash,
Size: release.Size,
Status: domain.ReleasePushStatusApproved,
Action: action.Name,
ActionType: action.Type,
ActionClient: action.Client.Name,
Rejections: []string{},
Protocol: domain.ReleaseProtocolTorrent,
Protocol: release.Protocol,
Implementation: release.Implementation,
Timestamp: time.Now(),
}
if action.Client != nil {
payload.ActionClient = action.Client.Name
}
if err != nil {
s.log.Error().Err(err).Msgf("process action failed: %v for '%v'", action.Name, release.TorrentName)

View file

@ -109,18 +109,23 @@ type ReleaseActionStatus struct {
}
func NewReleaseActionStatus(action *Action, release *Release) *ReleaseActionStatus {
return &ReleaseActionStatus{
s := &ReleaseActionStatus{
ID: 0,
Status: ReleasePushStatusPending,
Action: action.Name,
Type: action.Type,
Client: action.Client.Name,
Filter: release.Filter.Name,
FilterID: int64(release.Filter.ID),
Rejections: []string{},
Timestamp: time.Now(),
ReleaseID: release.ID,
}
if action.Client != nil {
s.Client = action.Client.Name
}
return s
}
type DownloadTorrentFileResponse struct {