Use current language for TV and movies requests

This commit is contained in:
Florian Dupret 2021-11-02 15:29:37 +01:00
commit dc1e71e77f
4 changed files with 6 additions and 6 deletions

View file

@ -124,7 +124,7 @@ export class DiscoverCardComponent implements OnInit {
dialog.afterClosed().subscribe((result) => { dialog.afterClosed().subscribe((result) => {
if (result) { if (result) {
this.requestService.requestMovie({ theMovieDbId: +this.result.id, this.requestService.requestMovie({ theMovieDbId: +this.result.id,
languageCode: navigator.language, languageCode: this.translate.currentLang,
qualityPathOverride: result.radarrPathId, qualityPathOverride: result.radarrPathId,
requestOnBehalf: result.username?.id, requestOnBehalf: result.username?.id,
rootFolderOverride: result.radarrFolderId, }).subscribe(x => { rootFolderOverride: result.radarrFolderId, }).subscribe(x => {
@ -138,7 +138,7 @@ export class DiscoverCardComponent implements OnInit {
} }
}); });
} else { } else {
this.requestService.requestMovie({ theMovieDbId: +this.result.id, languageCode: navigator.language, requestOnBehalf: null, qualityPathOverride: null, rootFolderOverride: null }).subscribe(x => { this.requestService.requestMovie({ theMovieDbId: +this.result.id, languageCode: this.translate.currentLang, requestOnBehalf: null, qualityPathOverride: null, rootFolderOverride: null }).subscribe(x => {
if (x.result) { if (x.result) {
this.result.requested = true; this.result.requested = true;
this.messageService.send(this.translate.instant("Requests.RequestAddedSuccessfully", { title: this.result.title }), "Ok"); this.messageService.send(this.translate.instant("Requests.RequestAddedSuccessfully", { title: this.result.title }), "Ok");

View file

@ -92,7 +92,7 @@ export class MovieDetailsComponent {
dialog.afterClosed().subscribe(async (result) => { dialog.afterClosed().subscribe(async (result) => {
if (result) { if (result) {
const requestResult = await this.requestService.requestMovie({ theMovieDbId: this.theMovidDbId, const requestResult = await this.requestService.requestMovie({ theMovieDbId: this.theMovidDbId,
languageCode: navigator.language, languageCode: this.translate.currentLang,
qualityPathOverride: result.radarrPathId, qualityPathOverride: result.radarrPathId,
requestOnBehalf: result.username?.id, requestOnBehalf: result.username?.id,
rootFolderOverride: result.radarrFolderId, }).toPromise(); rootFolderOverride: result.radarrFolderId, }).toPromise();
@ -107,7 +107,7 @@ export class MovieDetailsComponent {
} }
}); });
} else { } else {
const result = await this.requestService.requestMovie({ theMovieDbId: this.theMovidDbId, languageCode: navigator.language, requestOnBehalf: userId, qualityPathOverride: undefined, rootFolderOverride: undefined }).toPromise(); const result = await this.requestService.requestMovie({ theMovieDbId: this.theMovidDbId, languageCode: this.translate.currentLang, requestOnBehalf: userId, qualityPathOverride: undefined, rootFolderOverride: undefined }).toPromise();
if (result.result) { if (result.result) {
this.movie.requested = true; this.movie.requested = true;
this.movie.requestId = result.requestId; this.movie.requestId = result.requestId;

View file

@ -44,7 +44,7 @@ export class TvRequestGridComponent {
const viewModel = <ITvRequestViewModelV2>{ const viewModel = <ITvRequestViewModelV2>{
firstSeason: this.tv.firstSeason, latestSeason: this.tv.latestSeason, requestAll: this.tv.requestAll, theMovieDbId: this.tv.id, firstSeason: this.tv.firstSeason, latestSeason: this.tv.latestSeason, requestAll: this.tv.requestAll, theMovieDbId: this.tv.id,
requestOnBehalf: null, languageCode: navigator.language requestOnBehalf: null, languageCode: this.translate.currentLang
}; };
viewModel.seasons = []; viewModel.seasons = [];
this.tv.seasonRequests.forEach((season) => { this.tv.seasonRequests.forEach((season) => {

View file

@ -45,7 +45,7 @@ export class EpisodeRequestComponent {
const viewModel = <ITvRequestViewModelV2>{ const viewModel = <ITvRequestViewModelV2>{
firstSeason: this.data.series.firstSeason, latestSeason: this.data.series.latestSeason, requestAll: this.data.series.requestAll, theMovieDbId: this.data.series.id, firstSeason: this.data.series.firstSeason, latestSeason: this.data.series.latestSeason, requestAll: this.data.series.requestAll, theMovieDbId: this.data.series.id,
requestOnBehalf: this.data.requestOnBehalf, languageCode: navigator.language requestOnBehalf: this.data.requestOnBehalf, languageCode: this.translate.currentLang
}; };
viewModel.seasons = []; viewModel.seasons = [];
this.data.series.seasonRequests.forEach((season) => { this.data.series.seasonRequests.forEach((season) => {