refactor: improve user agent related handling

This commit is contained in:
4gray committed 2023-05-25 08:11:15 +02:00
1 parent 2695239559
commit 277b627f7e
2 files changed
+6 -7

No files matched your search

-1
View File
@@ -284,7 +284,6 @@ export class Api {
* @param referer referer to use
*/
setUserAgent(userAgent: string, referer?: string): void {
console.log('here we go', userAgent);
if (userAgent === undefined || userAgent === null || userAgent === '') {
userAgent = this.defaultUserAgent;
}
@@ -132,15 +132,15 @@ export class VideoPlayerComponent implements OnInit, OnDestroy {
);
return this.playlistsService.getPlaylist(params.id).pipe(
map((playlist) => {
if (playlist.userAgent) {
this.dataService.sendIpcEvent(
CHANNEL_SET_USER_AGENT,
{
this.dataService.sendIpcEvent(
CHANNEL_SET_USER_AGENT,
playlist.userAgent
? {
referer: 'localhost',
userAgent: playlist.userAgent,
}
);
}
: {}
);
return playlist.playlist.items;
})
);