Skip to content

Commit

Permalink
chore: added logging for dts
Browse files Browse the repository at this point in the history
  • Loading branch information
marco79cgn committed Dec 12, 2023
1 parent 213a6f9 commit c75f9b9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ard-eventhub",
"version": "1.7.0",
"version": "1.7.1",
"description": "ARD system to distribute real-time (live) metadata for primarily radio broadcasts.",
"main": "./src/ingest/index.js",
"engines": {
Expand Down
7 changes: 5 additions & 2 deletions src/ingest/events/post.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,10 @@ module.exports = async (req, res) => {
// add opt-out plugins
const isDtsPluginSet = message.plugins?.find((plugin) => plugin.type === 'dts')
const isMusic = req.body.type === 'music'
if (!isDtsPluginSet && isMusic && DTS_INSTITUTION_ALLOW_LIST.includes(req.user.institutionId)) {
const isInDtsAllowList = DTS_INSTITUTION_ALLOW_LIST.includes(req.user.institutionId)
const institutionId = req.user.institutionId || 'unknown'

if (!isDtsPluginSet && isMusic && isInDtsAllowList) {
message.plugins.push({
type: 'dts',
isDeactivated: false,
Expand Down Expand Up @@ -182,7 +185,7 @@ module.exports = async (req, res) => {
// log success
logger.log({
level: 'info',
message: `event processed > ${eventName} > ${message.services.length}x services (${message.services[0]?.publisherId})`,
message: `event processed > ${eventName} > institution ${institutionId} > isInDtsAllowList ${isInDtsAllowList} > ${message.services.length}x services (${message.services[0]?.publisherId})`,
source,
data: { ...data, body: req.body, isDtsPluginSet },
})
Expand Down

0 comments on commit c75f9b9

Please sign in to comment.