Update create-database.js

This commit is contained in:
Aleksandr Statciuk 2022-02-05 07:45:12 +03:00
parent 219539b70c
commit 244afb8088
4 changed files with 7 additions and 2 deletions

View file

@ -42,7 +42,7 @@ parser.parseChannelName = function (string) {
parser.parseCountryCode = function (filepath) {
if (!filepath) return null
const basename = file.basename(filepath)
const [code] = basename.split('_') || [null]
const [_, code] = basename.match(/^([a-z]{2})(_|\.)/) || [null, null]
return code
}