diff --git a/.vscode/settings.json b/.vscode/settings.json index e9c22ae..28e8d6e 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -18,6 +18,7 @@ "ijmap", "nestjs", "tsviewer", - "uglifycss" + "uglifycss", + "cspacer0" ], } \ No newline at end of file diff --git a/server/src/app/controllers/app.controller.ts b/server/src/app/controllers/app.controller.ts index c91d19a..bb43e0d 100644 --- a/server/src/app/controllers/app.controller.ts +++ b/server/src/app/controllers/app.controller.ts @@ -8,7 +8,7 @@ export class AppController { @Get() @Render('index.hbs') async getIndex(): Promise> { - const channels = await this.teamspeakService.getPopulatedChannelList(); + const channels = await this.teamspeakService.getCleanedPopulatedChannelList(); return { title: 'Cliffbreak.de TS-Viewer', channels }; } } \ No newline at end of file diff --git a/server/src/app/services/teamspeak.service.ts b/server/src/app/services/teamspeak.service.ts index 6ae5f9e..adcb9e7 100644 --- a/server/src/app/services/teamspeak.service.ts +++ b/server/src/app/services/teamspeak.service.ts @@ -78,4 +78,17 @@ export class TeamspeakService { return channelList; } + async getCleanedPopulatedChannelList(): Promise { + const populatedChannels = await this.getPopulatedChannelList(); + const channelList: IPopulatedChannel[] = []; + for(const channel of populatedChannels) { + if(channel.name.includes('[*spacer')) { + continue; + } else if(channel.name.includes('[cspacer0]')) { + channel.name = channel.name.replace('[cspacer0]', ''); + } + channelList.push(channel); + } + return channelList; + } } \ No newline at end of file