F: implemented config service in components
This commit is contained in:
1 parent
cfda451f71
commit
4c5a355dc6
11 files changed
+74
-43
No files matched your search
+6
-7
@@ -12,7 +12,6 @@ import { SeenModalComponent } from '../../../shared/components/modals/seen-modal
|
||||
import { ConfirmModalComponent } from '../../../shared/components/modals/confirm-modal/confirm-modal.component';
|
||||
|
||||
import { EntrySeenService } from '../../../core/services/entry-seen.service';
|
||||
import { EntryRatingsService } from '../../../core/services/entry-ratings.service';
|
||||
import { EntryService } from '../../../core/services/entry.service';
|
||||
import { EpisodeSeenService } from '../../../core/services/episode-seen.service';
|
||||
import { SeasonService } from '../../../core/services/season.service';
|
||||
@@ -21,9 +20,9 @@ import { ToastrService } from 'ngx-toastr';
|
||||
import { EntrySeen } from '../../../shared/models/entry-seen.model';
|
||||
import { EpisodeSeenModalComponent } from '../../../shared/components/modals/episode-seen-modal/episode-seen-modal.component';
|
||||
import { MediaModalComponent } from '../media-modal/media-modal.component';
|
||||
import { environment } from '../../../../environments/environment.prod';
|
||||
import { Collection } from '../../../shared/models/collection.model';
|
||||
import { EntrySettingsModalComponent } from '../entry-settings-modal/entry-settings-modal.component';
|
||||
import { ConfigService } from '../../../core/services/config.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-alternate-entry-page',
|
||||
@@ -64,7 +63,7 @@ export class AlternateEntryPageComponent implements OnInit {
|
||||
private entryService: EntryService,
|
||||
private seasonService: SeasonService,
|
||||
private entrySeenService: EntrySeenService,
|
||||
private entryRatingsService: EntryRatingsService,
|
||||
private configService: ConfigService,
|
||||
private libraryService: LibraryService,
|
||||
private dialog: MatDialog,
|
||||
private route: ActivatedRoute,
|
||||
@@ -369,7 +368,7 @@ export class AlternateEntryPageComponent implements OnInit {
|
||||
}
|
||||
|
||||
return (
|
||||
environment.API_URL +
|
||||
this.configService.getBackendApiUrl() +
|
||||
`/media/collections/backdrops/preview/${selectedBackdrop}`
|
||||
);
|
||||
}
|
||||
@@ -687,7 +686,7 @@ export class AlternateEntryPageComponent implements OnInit {
|
||||
selectedPosters[0].path
|
||||
) {
|
||||
poster =
|
||||
environment.API_URL +
|
||||
this.configService.getBackendApiUrl() +
|
||||
`/media/entries/posters/original/${selectedPosters[0].path}`;
|
||||
}
|
||||
}
|
||||
@@ -776,7 +775,7 @@ export class AlternateEntryPageComponent implements OnInit {
|
||||
selectedPosters[0].path
|
||||
) {
|
||||
return (
|
||||
environment.API_URL +
|
||||
this.configService.getBackendApiUrl() +
|
||||
`/media/entries/posters/original/${selectedPosters[0].path}`
|
||||
);
|
||||
}
|
||||
@@ -803,7 +802,7 @@ export class AlternateEntryPageComponent implements OnInit {
|
||||
selectedBackdrop[0].path
|
||||
) {
|
||||
return (
|
||||
environment.API_URL +
|
||||
this.configService.getBackendApiUrl() +
|
||||
`/media/entries/backdrops/original/${selectedBackdrop[0].path}`
|
||||
);
|
||||
}
|
||||
|
||||
@@ -12,7 +12,6 @@ import { SeenModalComponent } from '../../../shared/components/modals/seen-modal
|
||||
import { ConfirmModalComponent } from '../../../shared/components/modals/confirm-modal/confirm-modal.component';
|
||||
|
||||
import { EntrySeenService } from '../../../core/services/entry-seen.service';
|
||||
import { EntryRatingsService } from '../../../core/services/entry-ratings.service';
|
||||
import { EntryService } from '../../../core/services/entry.service';
|
||||
import { EpisodeSeenService } from '../../../core/services/episode-seen.service';
|
||||
import { SeasonService } from '../../../core/services/season.service';
|
||||
@@ -21,9 +20,9 @@ import { ToastrService } from 'ngx-toastr';
|
||||
import { EntrySeen } from '../../../shared/models/entry-seen.model';
|
||||
import { EpisodeSeenModalComponent } from '../../../shared/components/modals/episode-seen-modal/episode-seen-modal.component';
|
||||
import { MediaModalComponent } from '../media-modal/media-modal.component';
|
||||
import { environment } from '../../../../environments/environment.prod';
|
||||
import { Collection } from '../../../shared/models/collection.model';
|
||||
import { EntrySettingsModalComponent } from '../entry-settings-modal/entry-settings-modal.component';
|
||||
import { ConfigService } from '../../../core/services/config.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-entry-page',
|
||||
@@ -64,7 +63,7 @@ export class EntryPageComponent implements OnInit {
|
||||
private entryService: EntryService,
|
||||
private seasonService: SeasonService,
|
||||
private entrySeenService: EntrySeenService,
|
||||
private entryRatingsService: EntryRatingsService,
|
||||
private configService: ConfigService,
|
||||
private libraryService: LibraryService,
|
||||
private dialog: MatDialog,
|
||||
private route: ActivatedRoute,
|
||||
@@ -369,7 +368,7 @@ export class EntryPageComponent implements OnInit {
|
||||
}
|
||||
|
||||
return (
|
||||
environment.API_URL +
|
||||
this.configService.getBackendApiUrl() +
|
||||
`/media/collections/backdrops/preview/${selectedBackdrop}`
|
||||
);
|
||||
}
|
||||
@@ -687,7 +686,7 @@ export class EntryPageComponent implements OnInit {
|
||||
selectedPosters[0].path
|
||||
) {
|
||||
poster =
|
||||
environment.API_URL +
|
||||
this.configService.getBackendApiUrl() +
|
||||
`/media/entries/posters/original/${selectedPosters[0].path}`;
|
||||
}
|
||||
}
|
||||
@@ -776,7 +775,7 @@ export class EntryPageComponent implements OnInit {
|
||||
selectedPosters[0].path
|
||||
) {
|
||||
return (
|
||||
environment.API_URL +
|
||||
this.configService.getBackendApiUrl() +
|
||||
`/media/entries/posters/original/${selectedPosters[0].path}`
|
||||
);
|
||||
}
|
||||
@@ -803,7 +802,7 @@ export class EntryPageComponent implements OnInit {
|
||||
selectedBackdrop[0].path
|
||||
) {
|
||||
return (
|
||||
environment.API_URL +
|
||||
this.configService.getBackendApiUrl() +
|
||||
`/media/entries/backdrops/original/${selectedBackdrop[0].path}`
|
||||
);
|
||||
}
|
||||
|
||||
@@ -5,9 +5,9 @@ import {
|
||||
MatDialog,
|
||||
} from '@angular/material/dialog';
|
||||
import { Entry } from '../../../shared/models/entry.model';
|
||||
import { environment } from '../../../../environments/environment.prod';
|
||||
import { MediaUploadModalComponent } from '../media-upload-modal/media-upload-modal.component';
|
||||
import { EntryService } from '../../../core/services/entry.service';
|
||||
import { ConfigService } from '../../../core/services/config.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-media-modal',
|
||||
@@ -22,7 +22,8 @@ export class MediaModalComponent implements OnInit {
|
||||
public dialogRef: MatDialogRef<MediaModalComponent>,
|
||||
@Inject(MAT_DIALOG_DATA) public data: any,
|
||||
private dialog: MatDialog,
|
||||
private entryService: EntryService
|
||||
private entryService: EntryService,
|
||||
private configService: ConfigService
|
||||
) {}
|
||||
|
||||
ngOnInit(): void {
|
||||
@@ -58,7 +59,7 @@ export class MediaModalComponent implements OnInit {
|
||||
}
|
||||
|
||||
getPath(fileType: string, filePath: string) {
|
||||
return `${environment.API_URL}/media/entries/${fileType}/preview/${filePath}`;
|
||||
return `${this.configService.getBackendApiUrl()}/media/entries/${fileType}/preview/${filePath}`;
|
||||
}
|
||||
|
||||
setTab(tab: string) {
|
||||
@@ -96,7 +97,9 @@ export class MediaModalComponent implements OnInit {
|
||||
}
|
||||
|
||||
expandMedia(media: any) {
|
||||
const fullSizePath = `${environment.API_URL}/media/entries/${media.type}s/original/${media.path}`;
|
||||
const fullSizePath = `${this.configService.getBackendApiUrl()}/media/entries/${
|
||||
media.type
|
||||
}s/original/${media.path}`;
|
||||
window.open(fullSizePath, '_blank');
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user