From 442916d130b71f5bf151445cec8e3927e5e2cd7a Mon Sep 17 00:00:00 2001 From: Aleksandr Statciuk Date: Fri, 11 Feb 2022 10:52:38 +0300 Subject: [PATCH] Rename to id.js --- scripts/commands/create-database.js | 4 ++-- scripts/core/{cid.js => id.js} | 6 +++--- scripts/core/index.js | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) rename scripts/core/{cid.js => id.js} (84%) diff --git a/scripts/commands/create-database.js b/scripts/commands/create-database.js index 777ab22a2..5d170ef05 100644 --- a/scripts/commands/create-database.js +++ b/scripts/commands/create-database.js @@ -1,4 +1,4 @@ -const { db, file, parser, store, logger, cid } = require('../core') +const { db, file, parser, store, logger, id } = require('../core') const { program } = require('commander') const _ = require('lodash') @@ -62,7 +62,7 @@ async function saveToDatabase(streams = []) { stream.set('cluster_id', { cluster_id: i + 1 }) if (!stream.get('channel_id')) { - const channel_id = cid.generate(item.name, item.filepath) + const channel_id = id.generate(item.name, item.filepath) stream.set('channel_id', { channel_id }) stream.set('updated', { updated: true }) diff --git a/scripts/core/cid.js b/scripts/core/id.js similarity index 84% rename from scripts/core/cid.js rename to scripts/core/id.js index 11ab5fae3..0c21a7b9d 100644 --- a/scripts/core/cid.js +++ b/scripts/core/id.js @@ -2,9 +2,9 @@ const file = require('./file') const parser = require('./parser') const transliteration = require('transliteration') -const cid = {} +const id = {} -cid.generate = function (title, filepath) { +id.generate = function (title, filepath) { const name = parser.parseChannelName(title) const code = parser.parseCountryCode(filepath) @@ -20,4 +20,4 @@ cid.generate = function (title, filepath) { return null } -module.exports = cid +module.exports = id diff --git a/scripts/core/index.js b/scripts/core/index.js index 32b9e6865..ebb274394 100644 --- a/scripts/core/index.js +++ b/scripts/core/index.js @@ -9,5 +9,5 @@ exports.playlist = require('./playlist') exports.store = require('./store') exports.markdown = require('./markdown') exports.api = require('./api') -exports.cid = require('./cid') +exports.id = require('./id') exports.blocklist = require('./blocklist')