Skip to content

Commit c1f813c

Browse files
committed
Update scripts
1 parent 8dc5424 commit c1f813c

File tree

6 files changed

+10
-65
lines changed

6 files changed

+10
-65
lines changed

scripts/commands/playlist/generate.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import {
1010
IndexLanguageGenerator,
1111
IndexCountryGenerator,
1212
SubdivisionsGenerator,
13-
IndexRegionGenerator,
1413
CategoriesGenerator,
1514
CountriesGenerator,
1615
LanguagesGenerator,
@@ -124,9 +123,6 @@ async function main() {
124123
logger.info('generating index.language.m3u...')
125124
await new IndexLanguageGenerator({ streams, logFile }).generate()
126125

127-
logger.info('generating index.region.m3u...')
128-
await new IndexRegionGenerator({ streams, regions, logFile }).generate()
129-
130126
logger.info('saving generators.log...')
131127
const logStorage = new Storage(LOGS_DIR)
132128
logStorage.saveFile(logFile)

scripts/generators/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ export * from './indexCountryGenerator'
66
export * from './indexGenerator'
77
export * from './indexLanguageGenerator'
88
export * from './indexNsfwGenerator'
9-
export * from './indexRegionGenerator'
109
export * from './languagesGenerator'
1110
export * from './rawGenerator'
1211
export * from './regionsGenerator'

scripts/generators/indexCountryGenerator.ts

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,6 @@ export class IndexCountryGenerator implements Generator {
2626
.orderBy((stream: Stream) => stream.getTitle())
2727
.filter((stream: Stream) => stream.isSFW())
2828
.forEach((stream: Stream) => {
29-
if (stream.isInternational()) {
30-
const streamClone = stream.clone()
31-
streamClone.groupTitle = 'International'
32-
groupedStreams.add(streamClone)
33-
return
34-
}
35-
3629
if (!stream.hasBroadcastArea()) {
3730
const streamClone = stream.clone()
3831
streamClone.groupTitle = 'Undefined'
@@ -45,6 +38,12 @@ export class IndexCountryGenerator implements Generator {
4538
streamClone.groupTitle = country.name
4639
groupedStreams.add(streamClone)
4740
})
41+
42+
if (stream.isInternational()) {
43+
const streamClone = stream.clone()
44+
streamClone.groupTitle = 'International'
45+
groupedStreams.add(streamClone)
46+
}
4847
})
4948

5049
groupedStreams = groupedStreams.orderBy((stream: Stream) => {

scripts/generators/indexRegionGenerator.ts

Lines changed: 0 additions & 51 deletions
This file was deleted.

scripts/generators/regionsGenerator.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@ export class RegionsGenerator implements Generator {
2828
.filter((stream: Stream) => stream.isSFW())
2929

3030
this.regions.forEach(async (region: Region) => {
31-
if (region.isWorldwide()) return
32-
3331
const regionStreams = streams.filter((stream: Stream) => stream.isBroadcastInRegion(region))
3432

3533
const playlist = new Playlist(regionStreams, { public: true })

scripts/models/broadcastArea.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,23 +32,27 @@ export class BroadcastArea {
3232
if (!city) return
3333
citiesIncluded.add(city)
3434
regionsIncluded = regionsIncluded.concat(city.getRegions())
35+
break
3536
}
3637
case 's': {
3738
const subdivision: Subdivision = subdivisionsKeyByCode.get(code)
3839
if (!subdivision) return
3940
subdivisionsIncluded.add(subdivision)
4041
regionsIncluded = regionsIncluded.concat(subdivision.getRegions())
42+
break
4143
}
4244
case 'c': {
4345
const country: Country = countriesKeyByCode.get(code)
4446
if (!country) return
4547
countriesIncluded.add(country)
4648
regionsIncluded = regionsIncluded.concat(country.getRegions())
49+
break
4750
}
4851
case 'r': {
4952
const region: Region = regionsKeyByCode.get(code)
5053
if (!region) return
5154
regionsIncluded = regionsIncluded.concat(region.getRegions())
55+
break
5256
}
5357
}
5458
})

0 commit comments

Comments
 (0)