mirror of
https://github.com/4gray/iptvnator.git
synced 2026-10-08 17:06:15 -08:00
refactor: improve user agent related handling
This commit is contained in:
1 parent
2695239559
commit
277b627f7e
2 files changed
+6
-7
No files matched your search
@@ -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;
|
||||
})
|
||||
);
|
||||
|
||||
Reference in new issue
Block a user