Skip to content

Commit

Permalink
add eventType to payloads
Browse files Browse the repository at this point in the history
  • Loading branch information
tillkruss authored Jun 8, 2024
1 parent 35334c4 commit d0bd8cb
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,7 @@ function buildNotificationPayload(payload) {
'sound': 'ping.aiff',
'relevance-score': 0.2,
},
eventType: payload.eventType,
}

case 'ApplicationUpdate':
Expand All @@ -300,6 +301,7 @@ function buildNotificationPayload(payload) {
'sound': 'ping.aiff',
'relevance-score': 1.0,
},
eventType: payload.eventType,
}

case 'Health':
Expand All @@ -314,6 +316,7 @@ function buildNotificationPayload(payload) {
'thread-id': `health:${payload.type}`,
'relevance-score': 0.8,
},
eventType: `${payload.eventType}:${payload.type}`,
}

case 'HealthRestored':
Expand All @@ -328,6 +331,7 @@ function buildNotificationPayload(payload) {
'thread-id': `health:${payload.type}`,
'relevance-score': 1.0,
},
eventType: `${payload.eventType}:${payload.type}`,
}

case 'MovieAdded':
Expand All @@ -343,6 +347,7 @@ function buildNotificationPayload(payload) {
'thread-id': `movie:${threadId}`,
'relevance-score': 0.6,
},
eventType: payload.eventType,
deeplink: `ruddarr://movies/open/${payload.movie?.id}`,
hideInForeground: true,
}
Expand All @@ -360,6 +365,7 @@ function buildNotificationPayload(payload) {
'thread-id': `series:${threadId}`,
'relevance-score': 0.6,
},
eventType: payload.eventType,
deeplink: `ruddarr://series/open/${payload.series?.id}`,
hideInForeground: true,
}
Expand All @@ -382,6 +388,7 @@ function buildNotificationPayload(payload) {
'thread-id': `movie:${threadId}`,
'relevance-score': 0.8,
},
eventType: payload.eventType,
deeplink: `ruddarr://movies/open/${payload.movie?.id}`,
hideInForeground: true,
}
Expand All @@ -401,6 +408,7 @@ function buildNotificationPayload(payload) {
'thread-id': `series:${threadId}`,
'relevance-score': 0.8,
},
eventType: payload.eventType,
deeplink: `ruddarr://series/open/${payload.series?.id}`,
hideInForeground: true,
}
Expand All @@ -421,6 +429,7 @@ function buildNotificationPayload(payload) {
'thread-id': `movie:${threadId}`,
'relevance-score': 1.0,
},
eventType: payload.eventType,
deeplink: `ruddarr://movies/open/${payload.movie?.id}`,
}
}
Expand Down Expand Up @@ -452,6 +461,7 @@ function buildNotificationPayload(payload) {
'thread-id': `series:${threadId}`,
'relevance-score': 1.0,
},
eventType: payload.eventType,
deeplink: `ruddarr://series/open/${payload.series?.id}`,
}
}
Expand All @@ -468,6 +478,7 @@ function buildNotificationPayload(payload) {
'thread-id': `series:${threadId}`,
'relevance-score': 1.0,
},
eventType: payload.eventType,
deeplink: `ruddarr://series/open/${payload.series?.id}`,
}
}
Expand Down

0 comments on commit d0bd8cb

Please sign in to comment.