mirror of
https://github.com/4gray/iptvnator.git
synced 2026-10-08 17:06:15 -08:00
refactor(stalker): use new translation strings
This commit is contained in:
1 parent
633bc79fd4
commit
17b1777b65
3 files changed
+32
-12
No files matched your search
@@ -4,7 +4,7 @@ import { MatButtonModule } from '@angular/material/button';
|
||||
import { MatIconModule } from '@angular/material/icon';
|
||||
import { MatSnackBar } from '@angular/material/snack-bar';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { TranslateModule, TranslateService } from '@ngx-translate/core';
|
||||
import { PlaylistsService } from '../../services/playlists.service';
|
||||
|
||||
@Component({
|
||||
@@ -17,6 +17,7 @@ export class FavoritesButtonComponent implements OnInit {
|
||||
private playlistService = inject(PlaylistsService);
|
||||
private route = inject(ActivatedRoute);
|
||||
private snackBar = inject(MatSnackBar);
|
||||
private translateService = inject(TranslateService);
|
||||
|
||||
portalId = this.route.snapshot.paramMap.get('id');
|
||||
serialMeta = input.required<{
|
||||
@@ -53,9 +54,15 @@ export class FavoritesButtonComponent implements OnInit {
|
||||
this.serialMeta().movie_id
|
||||
)
|
||||
.subscribe(() => {
|
||||
this.snackBar.open('Removed from favorites', null, {
|
||||
duration: 1000,
|
||||
});
|
||||
this.snackBar.open(
|
||||
this.translateService.instant(
|
||||
'PORTALS.REMOVED_FROM_FAVORITES'
|
||||
),
|
||||
null,
|
||||
{
|
||||
duration: 1000,
|
||||
}
|
||||
);
|
||||
this.checkFavoriteStatus();
|
||||
});
|
||||
}
|
||||
@@ -64,9 +71,13 @@ export class FavoritesButtonComponent implements OnInit {
|
||||
this.playlistService
|
||||
.addPortalFavorite(this.portalId, this.serialMeta())
|
||||
.subscribe(() => {
|
||||
this.snackBar.open('Added to favorites', null, {
|
||||
duration: 1000,
|
||||
});
|
||||
this.snackBar.open(
|
||||
this.translateService.instant('PORTALS.ADDED_TO_FAVORITES'),
|
||||
null,
|
||||
{
|
||||
duration: 1000,
|
||||
}
|
||||
);
|
||||
this.checkFavoriteStatus();
|
||||
});
|
||||
}
|
||||
|
||||
@@ -2,10 +2,14 @@
|
||||
@if (seasons()[0]; as serial) {
|
||||
<div class="image">
|
||||
<img
|
||||
*ngIf="serial.screenshot_uri; else placeholderCover"
|
||||
[ngSrc]="serial.screenshot_uri"
|
||||
style="position: relative"
|
||||
fill
|
||||
/>
|
||||
<ng-template #placeholderCover>
|
||||
<div class="placeholder-cover"></div>
|
||||
</ng-template>
|
||||
</div>
|
||||
|
||||
<div class="details">
|
||||
@@ -34,15 +38,19 @@
|
||||
{{ serial.age }}
|
||||
</div>
|
||||
<div>
|
||||
<div class="label">IMDB Rating:</div>
|
||||
<div class="label">{{ 'XTREAM.IMDB_RATING' | translate }}:</div>
|
||||
{{ serial.rating_imdb }}
|
||||
</div>
|
||||
<div>
|
||||
<div class="label">Kinopoisk Rating:</div>
|
||||
<div class="label">
|
||||
{{ 'XTREAM.KINOPOISK_RATING' | translate }}:
|
||||
</div>
|
||||
{{ serial.rating_kinopoisk }}
|
||||
</div>
|
||||
<div>
|
||||
<div class="label">Added:</div>
|
||||
<div class="label">
|
||||
{{ 'HOME.PLAYLISTS.ADDED' | translate }}:
|
||||
</div>
|
||||
{{ serial.added }}
|
||||
</div>
|
||||
<div class="action-buttons">
|
||||
@@ -69,7 +77,7 @@
|
||||
playEpisode.emit({ series: episode, cmd: item.cmd })
|
||||
"
|
||||
>
|
||||
Episode {{ episode }}
|
||||
{{ 'XTREAM.EPISODE' | translate }} {{ episode }}
|
||||
</button>
|
||||
}
|
||||
</div>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { NgFor, NgOptimizedImage } from '@angular/common';
|
||||
import { NgFor, NgIf, NgOptimizedImage } from '@angular/common';
|
||||
import { Component, Signal, input, output } from '@angular/core';
|
||||
import { MatButtonModule } from '@angular/material/button';
|
||||
import { MatDividerModule } from '@angular/material/divider';
|
||||
@@ -33,6 +33,7 @@ function extractNumericValue(str: string) {
|
||||
FavoritesButtonComponent,
|
||||
MatButtonModule,
|
||||
MatDividerModule,
|
||||
NgIf,
|
||||
NgFor,
|
||||
NgOptimizedImage,
|
||||
TranslateModule,
|
||||
|
||||
Reference in new issue
Block a user