more lint !wip

pull/2411/head
TidusJar 6 years ago
parent 4c99acef75
commit b43e61f4cb

@ -147,13 +147,13 @@ export class MovieSearchGridComponent implements OnInit {
}
private processGrid(movies: ISearchMovieResult[]) {
let container = <ISearchMovieResultContainer>{ movies: [] };
let container = <ISearchMovieResultContainer> { movies: [] };
movies.forEach((movie, i) => {
i++;
if ((i % 4) === 0) {
container.movies.push(movie);
this.movieResultGrid.push(container);
container = <ISearchMovieResultContainer>{ movies: [] };
container = <ISearchMovieResultContainer> { movies: [] };
} else {
container.movies.push(movie);
}

@ -25,7 +25,7 @@ const routes: Routes = [
{ path: "show/:id", component: SeriesInformationComponent, canActivate: [AuthGuard] },
];
@NgModule({
imports: [
imports: [
CommonModule,
FormsModule,
RouterModule.forChild(routes),

@ -38,25 +38,25 @@ export class SeriesInformationComponent implements OnInit {
});
});
if(!selected) {
if (!selected) {
this.notificationService.error("You need to select some episodes!");
return;
}
this.series.requested = true;
const viewModel = <ITvRequestViewModel>{ firstSeason: this.series.firstSeason, latestSeason: this.series.latestSeason, requestAll: this.series.requestAll, tvDbId: this.series.id};
const viewModel = <ITvRequestViewModel> { firstSeason: this.series.firstSeason, latestSeason: this.series.latestSeason, requestAll: this.series.requestAll, tvDbId: this.series.id};
viewModel.seasons = [];
this.series.seasonRequests.forEach((season) => {
const seasonsViewModel = <ISeasonsViewModel>{seasonNumber: season.seasonNumber, episodes: []};
const seasonsViewModel = <ISeasonsViewModel> {seasonNumber: season.seasonNumber, episodes: []};
season.episodes.forEach(ep => {
if(!this.series.latestSeason || !this.series.requestAll || !this.series.firstSeason) {
if(ep.selected) {
if (!this.series.latestSeason || !this.series.requestAll || !this.series.firstSeason) {
if (ep.selected) {
seasonsViewModel.episodes.push({episodeNumber: ep.episodeNumber});
}
}
});
viewModel.seasons.push(seasonsViewModel);
});

@ -166,10 +166,10 @@ export class TvSearchComponent implements OnInit {
searchResult.approved = true;
}
const viewModel = <ITvRequestViewModel>{ firstSeason: searchResult.firstSeason, latestSeason: searchResult.latestSeason, requestAll: searchResult.requestAll, tvDbId: searchResult.id };
const viewModel = <ITvRequestViewModel> { firstSeason: searchResult.firstSeason, latestSeason: searchResult.latestSeason, requestAll: searchResult.requestAll, tvDbId: searchResult.id };
viewModel.seasons = [];
searchResult.seasonRequests.forEach((season) => {
const seasonsViewModel = <ISeasonsViewModel>{ seasonNumber: season.seasonNumber, episodes: [] };
const seasonsViewModel = <ISeasonsViewModel> { seasonNumber: season.seasonNumber, episodes: [] };
season.episodes.forEach(ep => {
if (!searchResult.latestSeason || !searchResult.requestAll || !searchResult.firstSeason) {
if (ep.requested) {

@ -20,21 +20,21 @@ export class ImageService extends ServiceHelpers {
public getTvBanner(tvdbid: number): Observable<string> {
return this.http.get<string>(`${this.url}tv/${tvdbid}`, {headers: this.headers});
}
public getMoviePoster(movieDbId: string): Observable<string> {
return this.http.get<string>(`${this.url}poster/movie/${movieDbId}`, { headers: this.headers });
}
public getTvPoster(tvdbid: number): Observable<string> {
return this.http.get<string>(`${this.url}poster/tv/${tvdbid}`, { headers: this.headers });
}
public getMovieBackground(movieDbId: string): Observable<string> {
return this.http.get<string>(`${this.url}background/movie/${movieDbId}`, { headers: this.headers });
}
public getTvBackground(tvdbid: number): Observable<string> {
return this.http.get<string>(`${this.url}background/tv/${tvdbid}`, { headers: this.headers });
}
}

@ -6,7 +6,7 @@ import { Observable } from "rxjs";
import { TreeNode } from "primeng/primeng";
import { IRequestEngineResult } from "../interfaces";
import { IChildRequests, IFilter, IMovieRequestModel, IMovieRequests, IMovieUpdateModel, IRequestsViewModel, ITvRequests,ITvUpdateModel, OrderType } from "../interfaces";
import { IChildRequests, IFilter, IMovieRequestModel, IMovieRequests, IMovieUpdateModel, IRequestsViewModel, ITvRequests, ITvUpdateModel, OrderType } from "../interfaces";
import { ITvRequestViewModel } from "../interfaces";
import { ServiceHelpers } from "./service.helpers";
@ -22,8 +22,8 @@ export class RequestService extends ServiceHelpers {
public getTotalMovies(): Observable<number> {
return this.http.get<number>(`${this.url}Movie/total`, {headers: this.headers});
}
}
public getTotalTv(): Observable<number> {
return this.http.get<number>(`${this.url}tv/total`, {headers: this.headers});
}
@ -87,7 +87,7 @@ export class RequestService extends ServiceHelpers {
public removeTvRequest(request: ITvRequests) {
this.http.delete(`${this.url}tv/${request.id}`, {headers: this.headers}).subscribe();
}
public markTvAvailable(movie: ITvUpdateModel): Observable<IRequestEngineResult> {
return this.http.post<IRequestEngineResult>(`${this.url}tv/available`, JSON.stringify(movie), {headers: this.headers});
}
@ -102,11 +102,11 @@ export class RequestService extends ServiceHelpers {
public updateChild(child: IChildRequests): Observable<IChildRequests> {
return this.http.put<IChildRequests>(`${this.url}tv/child`, JSON.stringify(child), {headers: this.headers});
}
}
public denyChild(child: ITvUpdateModel): Observable<IRequestEngineResult> {
return this.http.put<IRequestEngineResult>(`${this.url}tv/deny`, JSON.stringify(child), {headers: this.headers});
}
}
public approveChild(child: ITvUpdateModel): Observable<IRequestEngineResult> {
return this.http.post<IRequestEngineResult>(`${this.url}tv/approve`, JSON.stringify(child), {headers: this.headers});
@ -114,16 +114,16 @@ export class RequestService extends ServiceHelpers {
public deleteChild(child: IChildRequests): Observable<boolean> {
return this.http.delete<boolean>(`${this.url}tv/child/${child.id}`, {headers: this.headers});
}
public subscribeToMovie(requestId: number): Observable<boolean> {
return this.http.post<boolean>(`${this.url}movie/subscribe/${requestId}`, {headers: this.headers});
}
}
public unSubscribeToMovie(requestId: number): Observable<boolean> {
return this.http.post<boolean>(`${this.url}movie/unsubscribe/${requestId}`, {headers: this.headers});
}
public subscribeToTv(requestId: number): Observable<boolean> {
return this.http.post<boolean>(`${this.url}tv/subscribe/${requestId}`, {headers: this.headers});
}
}
public unSubscribeToTv(requestId: number): Observable<boolean> {
return this.http.post<boolean>(`${this.url}tv/unsubscribe/${requestId}`, {headers: this.headers});
}

@ -185,7 +185,7 @@ export class SettingsService extends ServiceHelpers {
public getMobileNotificationSettings(): Observable<IMobileNotifcationSettings> {
return this.http.get<IMobileNotifcationSettings>(`${this.url}/notifications/mobile`, {headers: this.headers});
}
public saveMobileNotificationSettings(settings: IMobileNotifcationSettings): Observable<boolean> {
return this.http.post<boolean>(`${this.url}/notifications/mobile`, JSON.stringify(settings), {headers: this.headers});
}
@ -228,7 +228,7 @@ export class SettingsService extends ServiceHelpers {
public getTelegramNotificationSettings(): Observable<ITelegramNotifcationSettings> {
return this.http.get<ITelegramNotifcationSettings>(`${this.url}/notifications/telegram`, {headers: this.headers});
}
}
public saveTelegramNotificationSettings(settings: ITelegramNotifcationSettings): Observable<boolean> {
return this.http
@ -242,13 +242,13 @@ export class SettingsService extends ServiceHelpers {
public saveJobSettings(settings: IJobSettings): Observable<IJobSettingsViewModel> {
return this.http
.post<IJobSettingsViewModel>(`${this.url}/jobs`, JSON.stringify(settings), {headers: this.headers});
}
}
public testCron(body: ICronViewModelBody): Observable<ICronTestModel> {
return this.http
.post<ICronTestModel>(`${this.url}/testcron`, JSON.stringify(body), {headers: this.headers});
}
public getSickRageSettings(): Observable<ISickRageSettings> {
return this.http.get<ISickRageSettings>(`${this.url}/sickrage`, {headers: this.headers});
}
@ -273,11 +273,11 @@ export class SettingsService extends ServiceHelpers {
public getNewsletterSettings(): Observable<INewsletterNotificationSettings> {
return this.http.get<INewsletterNotificationSettings>(`${this.url}/notifications/newsletter`, {headers: this.headers});
}
}
public updateNewsletterDatabase(): Observable<boolean> {
return this.http.post<boolean>(`${this.url}/notifications/newsletterdatabase`, {headers: this.headers});
}
}
public saveNewsletterSettings(settings: INewsletterNotificationSettings): Observable<boolean> {
return this.http

@ -39,7 +39,7 @@ export class DiscordComponent implements OnInit {
return;
}
const settings = <IDiscordNotifcationSettings>form.value;
const settings = <IDiscordNotifcationSettings> form.value;
settings.notificationTemplates = this.templates;
this.settingsService.saveDiscordNotificationSettings(settings).subscribe(x => {

@ -54,7 +54,7 @@ export class EmailNotificationComponent implements OnInit {
return;
}
const settings = <IEmailNotificationSettings>form.value;
const settings = <IEmailNotificationSettings> form.value;
settings.notificationTemplates = this.templates;
this.settingsService.saveEmailNotificationSettings(settings).subscribe(x => {

@ -29,7 +29,7 @@ export class MattermostComponent implements OnInit {
username: [x.username],
webhookUrl: [x.webhookUrl, [Validators.required]],
channel: [x.channel],
iconUrl:[x.iconUrl],
iconUrl: [x.iconUrl],
});
});
@ -41,7 +41,7 @@ export class MattermostComponent implements OnInit {
return;
}
const settings = <IMattermostNotifcationSettings>form.value;
const settings = <IMattermostNotifcationSettings> form.value;
settings.notificationTemplates = this.templates;
this.settingsService.saveMattermostNotificationSettings(settings).subscribe(x => {

@ -32,9 +32,9 @@ export class MobileComponent implements OnInit {
});
this.mobileService.getUserDeviceList().subscribe(x => {
if(x.length <= 0) {
if (x.length <= 0) {
this.userList = [];
this.userList.push({username:"None",devices:0, userId:""});
this.userList.push({username: "None", devices: 0, userId: ""});
} else {
this.userList = x;
}
@ -47,7 +47,7 @@ export class MobileComponent implements OnInit {
return;
}
const settings = <IMobileNotifcationSettings>form.value;
const settings = <IMobileNotifcationSettings> form.value;
settings.notificationTemplates = this.templates;
this.settingsService.saveMobileNotificationSettings(settings).subscribe(x => {
@ -65,8 +65,8 @@ export class MobileComponent implements OnInit {
this.notificationService.error("Please check your entered values");
return;
}
if(!this.testUserId) {
this.notificationService.warning("Warning","Please select a user to send the test notification");
if (!this.testUserId) {
this.notificationService.warning("Warning", "Please select a user to send the test notification");
return;
}

@ -49,12 +49,12 @@ export class NewsletterComponent implements OnInit {
});
}
public addEmail() {
public addEmail() {
if(this.emailToAdd) {
if (this.emailToAdd) {
const emailRegex = "[a-zA-Z0-9.-_]{1,}@[a-zA-Z.-]{2,}[.]{1}[a-zA-Z]{2,}";
const match = this.emailToAdd.match(emailRegex)!;
if(match && match.length > 0) {
if (match && match.length > 0) {
this.settings.externalEmails.push(this.emailToAdd);
this.emailToAdd = "";
} else {

@ -37,7 +37,7 @@ export class PushbulletComponent implements OnInit {
return;
}
const settings = <IPushbulletNotificationSettings>form.value;
const settings = <IPushbulletNotificationSettings> form.value;
settings.notificationTemplates = this.templates;
this.settingsService.savePushbulletNotificationSettings(settings).subscribe(x => {

@ -37,7 +37,7 @@ export class PushoverComponent implements OnInit {
return;
}
const settings = <IPushoverNotificationSettings>form.value;
const settings = <IPushoverNotificationSettings> form.value;
settings.notificationTemplates = this.templates;
this.settingsService.savePushoverNotificationSettings(settings).subscribe(x => {

@ -41,7 +41,7 @@ export class SlackComponent implements OnInit {
return;
}
const settings = <ISlackNotificationSettings>form.value;
const settings = <ISlackNotificationSettings> form.value;
if (settings.iconEmoji && settings.iconUrl) {
this.notificationService.error("You cannot have a Emoji icon and a URL icon");
@ -65,7 +65,7 @@ export class SlackComponent implements OnInit {
return;
}
const settings = <ISlackNotificationSettings>form.value;
const settings = <ISlackNotificationSettings> form.value;
if (settings.iconEmoji && settings.iconUrl) {
this.notificationService.error("You cannot have a Emoji icon and a URL icon");

@ -40,7 +40,7 @@ export class TelegramComponent implements OnInit {
return;
}
const settings = <ITelegramNotifcationSettings>form.value;
const settings = <ITelegramNotifcationSettings> form.value;
settings.notificationTemplates = this.templates;
this.settingsService.saveTelegramNotificationSettings(settings).subscribe(x => {

@ -41,9 +41,9 @@ export class OmbiComponent implements OnInit {
return;
}
const result = <IOmbiSettings>form.value;
if(result.baseUrl && result.baseUrl.length > 0) {
if(!result.baseUrl.startsWith("/")) {
const result = <IOmbiSettings> form.value;
if (result.baseUrl && result.baseUrl.length > 0) {
if (!result.baseUrl.startsWith("/")) {
this.notificationService.error("Please ensure your base url starts with a '/'");
return;
}

@ -71,7 +71,7 @@ export class PlexComponent implements OnInit, OnDestroy {
if (this.settings.servers == null) {
this.settings.servers = [];
}
this.settings.servers.push(<IPlexServer>{ name: "New*", id: Math.floor(Math.random() * (99999 - 0 + 1) + 1) });
this.settings.servers.push(<IPlexServer> { name: "New*", id: Math.floor(Math.random() * (99999 - 0 + 1) + 1) });
}

@ -54,7 +54,7 @@ export class RadarrComponent implements OnInit {
this.qualities = [];
this.qualities.push({ name: "Please Select", id: -1 });
this.rootFolders = [];
this.rootFolders.push({ path: "Please Select", id: -1 });
this.minimumAvailabilityOptions = [
@ -93,7 +93,7 @@ export class RadarrComponent implements OnInit {
this.notificationService.error("Please check your entered values");
return;
}
const settings = <IRadarrSettings>form.value;
const settings = <IRadarrSettings> form.value;
this.testerService.radarrTest(settings).subscribe(x => {
if (x === true) {
this.notificationService.success("Successfully connected to Radarr!");
@ -108,12 +108,12 @@ public onSubmit(form: FormGroup) {
this.notificationService.error("Please check your entered values");
return;
}
if(form.controls.defaultQualityProfile.value === "-1" || form.controls.defaultRootPath.value === "Please Select") {
if (form.controls.defaultQualityProfile.value === "-1" || form.controls.defaultRootPath.value === "Please Select") {
this.notificationService.error("Please check your entered values");
return;
}
const settings = <IRadarrSettings>form.value;
const settings = <IRadarrSettings> form.value;
this.settingsService.saveRadarr(settings).subscribe(x => {
if (x) {
this.notificationService.success("Successfully saved Radarr settings");

@ -40,7 +40,7 @@ export class SickRageComponent implements OnInit {
this.notificationService.error("Please check your entered values");
return;
}
const settings = <ISickRageSettings>form.value;
const settings = <ISickRageSettings> form.value;
this.testerService.sickrageTest(settings).subscribe(x => {
if (x) {
this.notificationService.success("Successfully connected to SickRage!");

@ -93,7 +93,7 @@ export class SonarrComponent implements OnInit {
this.notificationService.error("Please check your entered values");
return;
}
const settings = <ISonarrSettings>form.value;
const settings = <ISonarrSettings> form.value;
this.testerService.sonarrTest(settings).subscribe(x => {
if (x) {
this.notificationService.success("Successfully connected to Sonarr!");
@ -108,13 +108,13 @@ export class SonarrComponent implements OnInit {
this.notificationService.error("Please check your entered values");
return;
}
if(form.controls.defaultQualityProfile) {
if(form.controls.defaultQualityProfile.value === "-1") {
if (form.controls.defaultQualityProfile) {
if (form.controls.defaultQualityProfile.value === "-1") {
this.notificationService.error("Please check your entered values");
}
}
if(form.controls.defaultRootPath) {
if(form.controls.defaultRootPath.value === "Please Select") {
if (form.controls.defaultRootPath) {
if (form.controls.defaultRootPath.value === "Please Select") {
this.notificationService.error("Please check your entered values");
}
}

@ -17,8 +17,8 @@ import { SidebarModule } from "primeng/primeng";
CommonModule,
],
exports: [
TranslateModule,
CommonModule,
TranslateModule,
CommonModule,
FormsModule,
SidebarModule,
IssuesReportComponent,

@ -19,7 +19,7 @@ export class UpdateDetailsComponent implements OnInit {
this.identityService.getUser().subscribe(x => {
const localUser = x as IUpdateLocalUser;
this.form = this.fb.group({
id:[localUser.id],
id: [localUser.id],
username: [localUser.userName],
emailAddress: [localUser.emailAddress, [Validators.email]],
confirmNewPassword: [localUser.confirmNewPassword],

@ -13,7 +13,7 @@ import { NotificationService } from "../services";
export class UserManagementEditComponent {
public user: IUser;
public userId: string;
constructor(private identityService: IdentityService,
private route: ActivatedRoute,
private notificationService: NotificationService,
@ -45,13 +45,13 @@ export class UserManagementEditComponent {
this.notificationService.error(val);
});
}
});
},
reject: () => {
return;
},
});
});
}
public resetPassword() {

@ -22,8 +22,8 @@ export class UserManagementComponent implements OnInit {
public bulkEpisodeLimit?: number;
constructor(private identityService: IdentityService,
private settingsService: SettingsService,
private notificationService: NotificationService) { }
private settingsService: SettingsService,
private notificationService: NotificationService) { }
public ngOnInit() {
this.users = [];

@ -15,9 +15,9 @@ export class PlexComponent implements OnInit {
private clientId: string;
constructor(private plexService: PlexService, private router: Router,
private notificationService: NotificationService,
private identityService: IdentityService, private plexTv: PlexTvService,
private settingsService: SettingsService) { }
private notificationService: NotificationService,
private identityService: IdentityService, private plexTv: PlexTvService,
private settingsService: SettingsService) { }
public ngOnInit(): void {
this.settingsService.getClientId().subscribe(x => this.clientId = x);
@ -42,7 +42,7 @@ export class PlexComponent implements OnInit {
return;
}
});
}
},
);
}

@ -11,11 +11,11 @@ export class PlexOAuthComponent implements OnInit {
public pinId: number;
constructor(private route: ActivatedRoute,
private plexOauth: PlexOAuthService,
private identityService: IdentityService,
private settings: SettingsService,
private router: Router,
private auth: AuthService) {
private plexOauth: PlexOAuthService,
private identityService: IdentityService,
private settings: SettingsService,
private router: Router,
private auth: AuthService) {
this.route.params
.subscribe((params: any) => {

Loading…
Cancel
Save