Conversation
Greptile SummaryThis PR introduces support for a new custom VOD portal type, allowing users to connect to custom JSON-based VOD APIs through the existing Stalker portal infrastructure. A specially-formatted URL string identifies these portals, which are stored with Key changes:
Confidence Score: 4/5Safe to merge after fixing the getPlaylist regression that forces all stalker portals to the VoD section. One P1 regression exists: recent-playlists.component.ts getPlaylist() hardcodes the 'vod' section for every stalker portal click, breaking section memory for regular MAC-address stalker portals. The P2 findings (i18n strings, isRecord duplication, redundant IPC normalization, Portuguese comment) are quality improvements but do not block the feature from working. libs/playlist/shared/ui/src/lib/recent-playlists/recent-playlists.component.ts — the getPlaylist() regression affecting regular stalker portal navigation. Important Files Changed
|
| } | ||
|
|
||
| getPlaylist(playlistMeta: PlaylistMeta): void { | ||
| if (playlistMeta.isCustomPortal || playlistMeta.macAddress) { | ||
| this.router.navigate([ | ||
| '/workspace', | ||
| 'stalker', | ||
| playlistMeta._id, | ||
| 'vod', | ||
| ]); | ||
| return; | ||
| } |
There was a problem hiding this comment.
Regular Stalker portals forced to VoD section
getPlaylist() now navigates ALL stalker portals — including regular MAC-address portals — to the hardcoded 'vod' section. The old code navigated regular stalker portals to /workspace/stalker/:id without a section, allowing the router (or section memory) to pick the last-visited or default section. This is inconsistent with playlist-switcher.component.ts, where forceVodForCustomPortal is only applied when playlist.isCustomPortal === true, leaving regular stalker portals free to restore their previous section.
The combined effect is that users of regular (non-custom) stalker portals will always land on the VoD tab when clicking a playlist from the dashboard list, even if they were previously browsing ITV or Series.
| } | |
| getPlaylist(playlistMeta: PlaylistMeta): void { | |
| if (playlistMeta.isCustomPortal || playlistMeta.macAddress) { | |
| this.router.navigate([ | |
| '/workspace', | |
| 'stalker', | |
| playlistMeta._id, | |
| 'vod', | |
| ]); | |
| return; | |
| } | |
| getPlaylist(playlistMeta: PlaylistMeta): void { | |
| if (playlistMeta.isCustomPortal) { | |
| this.router.navigate([ | |
| '/workspace', | |
| 'stalker', | |
| playlistMeta._id, | |
| 'vod', | |
| ]); | |
| return; | |
| } | |
| if (playlistMeta.macAddress) { | |
| this.router.navigate(['/workspace', 'stalker', playlistMeta._id]); | |
| return; | |
| } | |
| if (playlistMeta.serverUrl) { | |
| this.router.navigate(['/workspace', 'xtreams', playlistMeta._id]); | |
| return; | |
| } | |
| this.router.navigate(['/workspace', 'playlists', playlistMeta._id]); | |
| this.playlistClicked.emit(playlistMeta._id); | |
| } |
Prompt To Fix With AI
This is a comment left during a code review.
Path: libs/playlist/shared/ui/src/lib/recent-playlists/recent-playlists.component.ts
Line: 158-169
Comment:
**Regular Stalker portals forced to VoD section**
`getPlaylist()` now navigates ALL stalker portals — including regular MAC-address portals — to the hardcoded `'vod'` section. The old code navigated regular stalker portals to `/workspace/stalker/:id` without a section, allowing the router (or section memory) to pick the last-visited or default section. This is inconsistent with `playlist-switcher.component.ts`, where `forceVodForCustomPortal` is only applied when `playlist.isCustomPortal === true`, leaving regular stalker portals free to restore their previous section.
The combined effect is that users of regular (non-custom) stalker portals will always land on the **VoD** tab when clicking a playlist from the dashboard list, even if they were previously browsing **ITV** or **Series**.
```suggestion
getPlaylist(playlistMeta: PlaylistMeta): void {
if (playlistMeta.isCustomPortal) {
this.router.navigate([
'/workspace',
'stalker',
playlistMeta._id,
'vod',
]);
return;
}
if (playlistMeta.macAddress) {
this.router.navigate(['/workspace', 'stalker', playlistMeta._id]);
return;
}
if (playlistMeta.serverUrl) {
this.router.navigate(['/workspace', 'xtreams', playlistMeta._id]);
return;
}
this.router.navigate(['/workspace', 'playlists', playlistMeta._id]);
this.playlistClicked.emit(playlistMeta._id);
}
```
How can I resolve this? If you propose a fix, please make it concise.| // Primeiro tenta o caminho mais direto quando o cmd já | ||
| // parece um stream válido. | ||
| if (canUseDirectUrl) { |
There was a problem hiding this comment.
Portuguese comment in English codebase
These comments are written in Portuguese and are inconsistent with the rest of the codebase, which uses English throughout.
| // Primeiro tenta o caminho mais direto quando o cmd já | |
| // parece um stream válido. | |
| if (canUseDirectUrl) { | |
| // First try the most direct path when the cmd already | |
| // looks like a valid stream. | |
| if (canUseDirectUrl) { |
Prompt To Fix With AI
This is a comment left during a code review.
Path: libs/portal/stalker/data-access/src/lib/stores/features/with-stalker-player.feature.ts
Line: 261-263
Comment:
**Portuguese comment in English codebase**
These comments are written in Portuguese and are inconsistent with the rest of the codebase, which uses English throughout.
```suggestion
// First try the most direct path when the cmd already
// looks like a valid stream.
if (canUseDirectUrl) {
```
How can I resolve this? If you propose a fix, please make it concise.Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
| if (!parsedPortal) { | ||
| this.snackBar.open('Invalid portal URL format.', undefined, { | ||
| duration: 4000, | ||
| }); | ||
| return; | ||
| } | ||
|
|
||
| const { | ||
| originalInput, | ||
| normalizedPortalUrl, | ||
| isFullStalkerPortal, | ||
| isCustomPortal, | ||
| customPortalKey, | ||
| } = parsedPortal; | ||
|
|
||
| const macAddress = this.form.value.macAddress?.trim() || undefined; | ||
|
|
||
| if (!isCustomPortal && !macAddress) { | ||
| this.snackBar.open( | ||
| 'MAC address is required for stalker portals.', | ||
| undefined, | ||
| { duration: 5000 } | ||
| ); | ||
| return; | ||
| } |
There was a problem hiding this comment.
Hardcoded untranslated UI strings
Two new user-facing validation messages bypass the i18n pipeline and are hardcoded in English:
'Invalid portal URL format.'(line 110)'MAC address is required for stalker portals.'(line 128)
All other snackbar messages in this file and elsewhere in the project use this.translate.instant(...) or equivalent. These should either be added to the translation files and accessed via the TranslateService, or at minimum be surfaced as named constants so they can be updated consistently.
Prompt To Fix With AI
This is a comment left during a code review.
Path: libs/playlist/import/feature/src/lib/stalker-portal-import/stalker-portal-import.component.ts
Line: 109-133
Comment:
**Hardcoded untranslated UI strings**
Two new user-facing validation messages bypass the i18n pipeline and are hardcoded in English:
- `'Invalid portal URL format.'` (line 110)
- `'MAC address is required for stalker portals.'` (line 128)
All other snackbar messages in this file and elsewhere in the project use `this.translate.instant(...)` or equivalent. These should either be added to the translation files and accessed via the `TranslateService`, or at minimum be surfaced as named constants so they can be updated consistently.
How can I resolve this? If you propose a fix, please make it concise.
No description provided.