Skip to content

Commit

Permalink
New entry in table is empty
Browse files Browse the repository at this point in the history
  • Loading branch information
klein0r committed Apr 3, 2024
1 parent 795ef00 commit 96de478
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
6 changes: 3 additions & 3 deletions admin/jsonConfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
},
"filter": true,
"sort": true,
"default": "hausAutomatisierungCom"
"default": ""
},
{
"type": "text",
Expand All @@ -85,11 +85,11 @@
},
"filter": false,
"sort": false,
"default": "UCRDCsZvUg75Bibp9qYbHivw"
"default": ""
}
]
}
}
}
}
}
}
8 changes: 6 additions & 2 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,12 @@ class Youtube extends utils.Adapter {
this.log.debug(`[onReady] found ${channels.length} channels in config, fetching data`);

for (const channel of channels) {
if (channel.name.trim().length > 0 && channel.id.trim().length > 0) {
const cleanChannelName = channel.name.replace(/\s/g, '').replace(/[^\p{Ll}\p{Lu}\p{Nd}]+/gu, '_');
const cleanChannelName = channel.name
.trim()
.replace(/\s/g, '')
.replace(/[^\p{Ll}\p{Lu}\p{Nd}]+/gu, '_');

if (cleanChannelName.length > 0 && channel.id.trim().length > 0) {
const cpath = `channels.${cleanChannelName}`;

channelsKeep.push(cpath);
Expand Down

0 comments on commit 96de478

Please sign in to comment.