From c3ee8245901a9406c23a873a79a2fab634ff801b Mon Sep 17 00:00:00 2001 From: freearhey <7253922+freearhey@users.noreply.github.com> Date: Sat, 18 Jan 2025 13:39:18 +0300 Subject: [PATCH 1/3] Update dependencies --- package-lock.json | 69 ++++++++++++++++++++++++----------------------- package.json | 3 +-- yarn.lock | 43 ++++++++++++++--------------- 3 files changed, 58 insertions(+), 57 deletions(-) diff --git a/package-lock.json b/package-lock.json index 3587a667..1a2e9abf 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6,7 +6,6 @@ "": { "name": "@iptv-org/database", "dependencies": { - "@eslint/eslintrc": "^3.2.0", "@eslint/js": "^9.16.0", "@freearhey/core": "^0.2.2", "@joi/date": "^2.1.0", @@ -22,7 +21,7 @@ "chalk": "^4.1.2", "commander": "^9.0.0", "csvtojson": "^2.0.10", - "eslint": "^9.16.0", + "eslint": "^9.18.0", "eslint-config-prettier": "^9.0.0", "fs-extra": "^11.2.0", "globals": "^15.13.0", @@ -1092,9 +1091,9 @@ } }, "node_modules/@eslint/core": { - "version": "0.9.1", - "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.9.1.tgz", - "integrity": "sha512-GuUdqkyyzQI5RMIWkHhvTWLCyLo1jNK3vzkSyaExH5kHPDHcuL2VOpHjmMY+y3+NC69qAKToBqldTBgYeLSr9Q==", + "version": "0.10.0", + "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.10.0.tgz", + "integrity": "sha512-gFHJ+xBOo4G3WRlR1e/3G8A6/KZAH6zcE/hkLRCZTi/B9avAG365QhFA8uOGzTMqgTghpn7/fSnscW++dpMSAw==", "dependencies": { "@types/json-schema": "^7.0.15" }, @@ -1136,9 +1135,9 @@ } }, "node_modules/@eslint/js": { - "version": "9.16.0", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.16.0.tgz", - "integrity": "sha512-tw2HxzQkrbeuvyj1tG2Yqq+0H9wGoI2IMk4EOsQeX+vmd75FtJAzf+gTA69WF+baUKRYQ3x2kbLE08js5OsTVg==", + "version": "9.18.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.18.0.tgz", + "integrity": "sha512-fK6L7rxcq6/z+AaQMtiFTkvbHkBLNlwyRxHpKawP0x3u9+NC6MQTnFW+AdpwC6gfHTW0051cokQgtTN2FqlxQA==", "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" } @@ -1152,10 +1151,11 @@ } }, "node_modules/@eslint/plugin-kit": { - "version": "0.2.4", - "resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.2.4.tgz", - "integrity": "sha512-zSkKow6H5Kdm0ZUQUB2kV5JIXqoG0+uH5YADhaEHswm664N9Db8dXSi0nMJpacpMf+MyyglF1vnZohpEg5yUtg==", + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.2.5.tgz", + "integrity": "sha512-lB05FkqEdUg2AA0xEbUz0SnkXT1LcCTa438W4IWTUh4hdOnVbQyOJ81OrDXsJk/LSiJHubgGEFoR5EHq1NsH1A==", "dependencies": { + "@eslint/core": "^0.10.0", "levn": "^0.4.1" }, "engines": { @@ -3085,17 +3085,17 @@ } }, "node_modules/eslint": { - "version": "9.16.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.16.0.tgz", - "integrity": "sha512-whp8mSQI4C8VXd+fLgSM0lh3UlmcFtVwUQjyKCFfsp+2ItAIYhlq/hqGahGqHE6cv9unM41VlqKk2VtKYR2TaA==", + "version": "9.18.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.18.0.tgz", + "integrity": "sha512-+waTfRWQlSbpt3KWE+CjrPPYnbq9kfZIYUqapc0uBXyjTp8aYXZDsUH16m39Ryq3NjAVP4tjuF7KaukeqoCoaA==", "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", "@eslint-community/regexpp": "^4.12.1", "@eslint/config-array": "^0.19.0", - "@eslint/core": "^0.9.0", + "@eslint/core": "^0.10.0", "@eslint/eslintrc": "^3.2.0", - "@eslint/js": "9.16.0", - "@eslint/plugin-kit": "^0.2.3", + "@eslint/js": "9.18.0", + "@eslint/plugin-kit": "^0.2.5", "@humanfs/node": "^0.16.6", "@humanwhocodes/module-importer": "^1.0.1", "@humanwhocodes/retry": "^0.4.1", @@ -3103,7 +3103,7 @@ "@types/json-schema": "^7.0.15", "ajv": "^6.12.4", "chalk": "^4.0.0", - "cross-spawn": "^7.0.5", + "cross-spawn": "^7.0.6", "debug": "^4.3.2", "escape-string-regexp": "^4.0.0", "eslint-scope": "^8.2.0", @@ -6800,9 +6800,9 @@ } }, "@eslint/core": { - "version": "0.9.1", - "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.9.1.tgz", - "integrity": "sha512-GuUdqkyyzQI5RMIWkHhvTWLCyLo1jNK3vzkSyaExH5kHPDHcuL2VOpHjmMY+y3+NC69qAKToBqldTBgYeLSr9Q==", + "version": "0.10.0", + "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.10.0.tgz", + "integrity": "sha512-gFHJ+xBOo4G3WRlR1e/3G8A6/KZAH6zcE/hkLRCZTi/B9avAG365QhFA8uOGzTMqgTghpn7/fSnscW++dpMSAw==", "requires": { "@types/json-schema": "^7.0.15" } @@ -6831,9 +6831,9 @@ } }, "@eslint/js": { - "version": "9.16.0", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.16.0.tgz", - "integrity": "sha512-tw2HxzQkrbeuvyj1tG2Yqq+0H9wGoI2IMk4EOsQeX+vmd75FtJAzf+gTA69WF+baUKRYQ3x2kbLE08js5OsTVg==" + "version": "9.18.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.18.0.tgz", + "integrity": "sha512-fK6L7rxcq6/z+AaQMtiFTkvbHkBLNlwyRxHpKawP0x3u9+NC6MQTnFW+AdpwC6gfHTW0051cokQgtTN2FqlxQA==" }, "@eslint/object-schema": { "version": "2.1.5", @@ -6841,10 +6841,11 @@ "integrity": "sha512-o0bhxnL89h5Bae5T318nFoFzGy+YE5i/gGkoPAgkmTVdRKTiv3p8JHevPiPaMwoloKfEiiaHlawCqaZMqRm+XQ==" }, "@eslint/plugin-kit": { - "version": "0.2.4", - "resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.2.4.tgz", - "integrity": "sha512-zSkKow6H5Kdm0ZUQUB2kV5JIXqoG0+uH5YADhaEHswm664N9Db8dXSi0nMJpacpMf+MyyglF1vnZohpEg5yUtg==", + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.2.5.tgz", + "integrity": "sha512-lB05FkqEdUg2AA0xEbUz0SnkXT1LcCTa438W4IWTUh4hdOnVbQyOJ81OrDXsJk/LSiJHubgGEFoR5EHq1NsH1A==", "requires": { + "@eslint/core": "^0.10.0", "levn": "^0.4.1" } }, @@ -8264,17 +8265,17 @@ "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=" }, "eslint": { - "version": "9.16.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.16.0.tgz", - "integrity": "sha512-whp8mSQI4C8VXd+fLgSM0lh3UlmcFtVwUQjyKCFfsp+2ItAIYhlq/hqGahGqHE6cv9unM41VlqKk2VtKYR2TaA==", + "version": "9.18.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.18.0.tgz", + "integrity": "sha512-+waTfRWQlSbpt3KWE+CjrPPYnbq9kfZIYUqapc0uBXyjTp8aYXZDsUH16m39Ryq3NjAVP4tjuF7KaukeqoCoaA==", "requires": { "@eslint-community/eslint-utils": "^4.2.0", "@eslint-community/regexpp": "^4.12.1", "@eslint/config-array": "^0.19.0", - "@eslint/core": "^0.9.0", + "@eslint/core": "^0.10.0", "@eslint/eslintrc": "^3.2.0", - "@eslint/js": "9.16.0", - "@eslint/plugin-kit": "^0.2.3", + "@eslint/js": "9.18.0", + "@eslint/plugin-kit": "^0.2.5", "@humanfs/node": "^0.16.6", "@humanwhocodes/module-importer": "^1.0.1", "@humanwhocodes/retry": "^0.4.1", @@ -8282,7 +8283,7 @@ "@types/json-schema": "^7.0.15", "ajv": "^6.12.4", "chalk": "^4.0.0", - "cross-spawn": "^7.0.5", + "cross-spawn": "^7.0.6", "debug": "^4.3.2", "escape-string-regexp": "^4.0.0", "eslint-scope": "^8.2.0", diff --git a/package.json b/package.json index 2fa1f69f..2e284597 100644 --- a/package.json +++ b/package.json @@ -23,7 +23,6 @@ "testRegex": "tests/(.*?/)?.*test.(js|ts)$" }, "dependencies": { - "@eslint/eslintrc": "^3.2.0", "@eslint/js": "^9.16.0", "@freearhey/core": "^0.2.2", "@joi/date": "^2.1.0", @@ -39,7 +38,7 @@ "chalk": "^4.1.2", "commander": "^9.0.0", "csvtojson": "^2.0.10", - "eslint": "^9.16.0", + "eslint": "^9.18.0", "eslint-config-prettier": "^9.0.0", "fs-extra": "^11.2.0", "globals": "^15.13.0", diff --git a/yarn.lock b/yarn.lock index 91a49e56..b05cc960 100644 --- a/yarn.lock +++ b/yarn.lock @@ -335,10 +335,10 @@ debug "^4.3.1" minimatch "^3.1.2" -"@eslint/core@^0.9.0": - version "0.9.1" - resolved "https://registry.npmjs.org/@eslint/core/-/core-0.9.1.tgz" - integrity sha512-GuUdqkyyzQI5RMIWkHhvTWLCyLo1jNK3vzkSyaExH5kHPDHcuL2VOpHjmMY+y3+NC69qAKToBqldTBgYeLSr9Q== +"@eslint/core@^0.10.0": + version "0.10.0" + resolved "https://registry.npmjs.org/@eslint/core/-/core-0.10.0.tgz" + integrity sha512-gFHJ+xBOo4G3WRlR1e/3G8A6/KZAH6zcE/hkLRCZTi/B9avAG365QhFA8uOGzTMqgTghpn7/fSnscW++dpMSAw== dependencies: "@types/json-schema" "^7.0.15" @@ -357,21 +357,22 @@ minimatch "^3.1.2" strip-json-comments "^3.1.1" -"@eslint/js@^9.16.0", "@eslint/js@9.16.0": - version "9.16.0" - resolved "https://registry.npmjs.org/@eslint/js/-/js-9.16.0.tgz" - integrity sha512-tw2HxzQkrbeuvyj1tG2Yqq+0H9wGoI2IMk4EOsQeX+vmd75FtJAzf+gTA69WF+baUKRYQ3x2kbLE08js5OsTVg== +"@eslint/js@^9.16.0", "@eslint/js@9.18.0": + version "9.18.0" + resolved "https://registry.npmjs.org/@eslint/js/-/js-9.18.0.tgz" + integrity sha512-fK6L7rxcq6/z+AaQMtiFTkvbHkBLNlwyRxHpKawP0x3u9+NC6MQTnFW+AdpwC6gfHTW0051cokQgtTN2FqlxQA== "@eslint/object-schema@^2.1.5": version "2.1.5" resolved "https://registry.npmjs.org/@eslint/object-schema/-/object-schema-2.1.5.tgz" integrity sha512-o0bhxnL89h5Bae5T318nFoFzGy+YE5i/gGkoPAgkmTVdRKTiv3p8JHevPiPaMwoloKfEiiaHlawCqaZMqRm+XQ== -"@eslint/plugin-kit@^0.2.3": - version "0.2.4" - resolved "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.2.4.tgz" - integrity sha512-zSkKow6H5Kdm0ZUQUB2kV5JIXqoG0+uH5YADhaEHswm664N9Db8dXSi0nMJpacpMf+MyyglF1vnZohpEg5yUtg== +"@eslint/plugin-kit@^0.2.5": + version "0.2.5" + resolved "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.2.5.tgz" + integrity sha512-lB05FkqEdUg2AA0xEbUz0SnkXT1LcCTa438W4IWTUh4hdOnVbQyOJ81OrDXsJk/LSiJHubgGEFoR5EHq1NsH1A== dependencies: + "@eslint/core" "^0.10.0" levn "^0.4.1" "@freearhey/core@^0.2.2": @@ -1483,7 +1484,7 @@ cross-spawn@^7.0.3: shebang-command "^2.0.0" which "^2.0.1" -cross-spawn@^7.0.5: +cross-spawn@^7.0.6: version "7.0.6" resolved "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz" integrity sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA== @@ -1648,18 +1649,18 @@ eslint-visitor-keys@^4.2.0: resolved "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.0.tgz" integrity sha512-UyLnSehNt62FFhSwjZlHmeokpRK59rcz29j+F1/aDgbkbRTk7wIc9XzdoasMUbRNKDM0qQt/+BJ4BrpFeABemw== -"eslint@^6.0.0 || ^7.0.0 || >=8.0.0", "eslint@^8.57.0 || ^9.0.0", eslint@^9.16.0, eslint@>=7.0.0: - version "9.16.0" - resolved "https://registry.npmjs.org/eslint/-/eslint-9.16.0.tgz" - integrity sha512-whp8mSQI4C8VXd+fLgSM0lh3UlmcFtVwUQjyKCFfsp+2ItAIYhlq/hqGahGqHE6cv9unM41VlqKk2VtKYR2TaA== +"eslint@^6.0.0 || ^7.0.0 || >=8.0.0", "eslint@^8.57.0 || ^9.0.0", eslint@^9.18.0, eslint@>=7.0.0: + version "9.18.0" + resolved "https://registry.npmjs.org/eslint/-/eslint-9.18.0.tgz" + integrity sha512-+waTfRWQlSbpt3KWE+CjrPPYnbq9kfZIYUqapc0uBXyjTp8aYXZDsUH16m39Ryq3NjAVP4tjuF7KaukeqoCoaA== dependencies: "@eslint-community/eslint-utils" "^4.2.0" "@eslint-community/regexpp" "^4.12.1" "@eslint/config-array" "^0.19.0" - "@eslint/core" "^0.9.0" + "@eslint/core" "^0.10.0" "@eslint/eslintrc" "^3.2.0" - "@eslint/js" "9.16.0" - "@eslint/plugin-kit" "^0.2.3" + "@eslint/js" "9.18.0" + "@eslint/plugin-kit" "^0.2.5" "@humanfs/node" "^0.16.6" "@humanwhocodes/module-importer" "^1.0.1" "@humanwhocodes/retry" "^0.4.1" @@ -1667,7 +1668,7 @@ eslint-visitor-keys@^4.2.0: "@types/json-schema" "^7.0.15" ajv "^6.12.4" chalk "^4.0.0" - cross-spawn "^7.0.5" + cross-spawn "^7.0.6" debug "^4.3.2" escape-string-regexp "^4.0.0" eslint-scope "^8.2.0" From 106acefe87126158b634b93f4052776fe26df527 Mon Sep 17 00:00:00 2001 From: freearhey <7253922+freearhey@users.noreply.github.com> Date: Sat, 18 Jan 2025 14:04:24 +0300 Subject: [PATCH 2/3] Update tests/__data__ --- tests/__data__/expected/data/blocklist.csv | 1 + tests/__data__/expected/data/channels.csv | 2 +- tests/__data__/input/data/blocklist.csv | 3 ++- tests/__data__/input/data/channels.csv | 2 +- 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/tests/__data__/expected/data/blocklist.csv b/tests/__data__/expected/data/blocklist.csv index ff5b8c90..47888afd 100644 --- a/tests/__data__/expected/data/blocklist.csv +++ b/tests/__data__/expected/data/blocklist.csv @@ -1,2 +1,3 @@ channel,ref +beINMoviesTurk.tr,https://github.com/iptv-org/iptv/issues/1831 HGTVHungary.hu,https://github.com/iptv-org/iptv/issues/1831 \ No newline at end of file diff --git a/tests/__data__/expected/data/channels.csv b/tests/__data__/expected/data/channels.csv index 9a39b05b..494f3030 100644 --- a/tests/__data__/expected/data/channels.csv +++ b/tests/__data__/expected/data/channels.csv @@ -1,6 +1,6 @@ id,name,alt_names,network,owners,country,subdivision,city,broadcast_area,languages,categories,is_nsfw,launched,closed,replaced_by,website,logo beINMoviesTurk.tr,beIN Movies Turk,beIN Movies Türk,BBC,Gazprom Media,TR,US-CA,London,c/TR,tur,movies,FALSE,1979-05-16,1980-05-16,M5.hu,http://www.digiturk.com.tr/,https://i.imgur.com/nw8Sa2z.png -M5.hu,M5,,,Duna Médiaszolgáltató Nonprofit Zrt.,HU,,,c/HU,hun,,TRUE,,,,https://www.mediaklikk.hu/m5/,https://i.imgur.com/y21wFd0.png +M5.hu,M5,,,Duna Médiaszolgáltató Nonprofit Zrt.,HU,,,c/HU,hun,,TRUE,,,beINMoviesTurk.tr,https://www.mediaklikk.hu/m5/,https://i.imgur.com/y21wFd0.png WenzhouEconomicandEducation.cn,Wenzhou Economic and Education,,,,CN,,Wenzhou,c/CN,zho,science,FALSE,,,,,https://www.tvchinese.net/uploads/tv/wzjjkj.jpg YiwuBusinessChannel.cn,Yiwu Business Channel,,,,CN,,,c/CN,zho,business,FALSE,,,,,https://www.tvchinese.net/uploads/tv/yiwutv.jpg YiwuNewsIntegratedChannel.cn,Yiwu News Integrated Channel,,,,CN,,,c/CN,zho,news,FALSE,,,,,https://www.tvchinese.net/uploads/tv/yiwutv.jpg \ No newline at end of file diff --git a/tests/__data__/input/data/blocklist.csv b/tests/__data__/input/data/blocklist.csv index 6695ea21..004c3324 100644 --- a/tests/__data__/input/data/blocklist.csv +++ b/tests/__data__/input/data/blocklist.csv @@ -1,2 +1,3 @@ channel,ref -AnimalPlanetAfrica.za,https://github.com/iptv-org/iptv/issues/1831 \ No newline at end of file +AnimalPlanetAfrica.za,https://github.com/iptv-org/iptv/issues/1831 +BeijingSatelliteTV.cn,https://github.com/iptv-org/iptv/issues/1831 \ No newline at end of file diff --git a/tests/__data__/input/data/channels.csv b/tests/__data__/input/data/channels.csv index d1a71b53..9625a3a6 100644 --- a/tests/__data__/input/data/channels.csv +++ b/tests/__data__/input/data/channels.csv @@ -1,4 +1,4 @@ id,name,alt_names,network,owners,country,subdivision,city,broadcast_area,languages,categories,is_nsfw,launched,closed,replaced_by,website,logo 002RadioTV.do,002 Radio TV,,,,DO,,,c/DO,spa,general,FALSE,,,,https://www.002radio.com/,https://i.imgur.com/7oNe8xj.png BeijingSatelliteTV.cn,Beijing Satellite TV,北京卫视,,,CN,,Beijing,c/CN,zho,general,FALSE,1979-05-16,,,https://www.brtn.cn/btv/,https://i.imgur.com/vsktAez.png -M5.hu,M5,,,,HU,,,c/HU,hun,auto,TRUE,,2001-01-01,,https://www.mediaklikk.hu/m5/,https://i.imgur.com/y21wFd0.png \ No newline at end of file +M5.hu,M5,,,,HU,,,c/HU,hun,auto,TRUE,,2001-01-01,BeijingSatelliteTV.cn,https://www.mediaklikk.hu/m5/,https://i.imgur.com/y21wFd0.png \ No newline at end of file From 418d428b6fbb7043f9952921e43abd28ec18023e Mon Sep 17 00:00:00 2001 From: freearhey <7253922+freearhey@users.noreply.github.com> Date: Sat, 18 Jan 2025 14:04:45 +0300 Subject: [PATCH 3/3] Update update.ts --- scripts/db/update.ts | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/scripts/db/update.ts b/scripts/db/update.ts index 18e88bae..1833d7a6 100644 --- a/scripts/db/update.ts +++ b/scripts/db/update.ts @@ -85,6 +85,8 @@ async function editChannels({ loader, idCreator }: { loader: IssueLoader; idCrea const country = data.getString('country') || found.country if (name && country) { channelId = idCreator.create(name, country) + updateBlocklistId(found.id, channelId) + updateChannelReplacedBy(found.id, channelId) } } @@ -196,3 +198,23 @@ async function blockChannels({ loader }: { loader: IssueLoader }) { processedIssues.push(issue) }) } + +function updateBlocklistId(oldId: string, newId: string) { + const filtered: Collection = blocklist.filter((blocked: Blocked) => blocked.channel === oldId) + if (filtered.isEmpty()) return + + filtered.forEach(item => { + item.channel = newId + }) +} + +function updateChannelReplacedBy(channelId: string, newReplacedBy: string) { + const filtered: Collection = channels.filter( + (channel: Channel) => channel.replaced_by === channelId + ) + if (filtered.isEmpty()) return + + filtered.forEach(item => { + item.replaced_by = newReplacedBy + }) +}