Fix lint errors

pull/2467/head
Kenton Royal 6 years ago
parent d12e46b451
commit e770d321eb

@ -6,8 +6,8 @@ import { debounceTime, distinctUntilChanged } from "rxjs/operators";
import { AuthService } from "../auth/auth.service"; import { AuthService } from "../auth/auth.service";
import { FilterType, IFilter, IIssueCategory, IMovieRequests, IPagenator, IRadarrProfile, IRadarrRootFolder, OrderType } from "../interfaces"; import { FilterType, IFilter, IIssueCategory, IMovieRequests, IPagenator, IRadarrProfile, IRadarrRootFolder, OrderType } from "../interfaces";
import { NotificationService, RadarrService, RequestService } from "../services";
import { IRemainingRequests } from "../interfaces/IRemainingRequests"; import { IRemainingRequests } from "../interfaces/IRemainingRequests";
import { NotificationService, RadarrService, RequestService } from "../services";
@Component({ @Component({
selector: "movie-requests", selector: "movie-requests",

@ -1,6 +1,7 @@
import { Component, OnInit, Input } from "@angular/core"; import { IRemainingRequests } from "../interfaces/IRemainingRequests";
import { RequestService } from "../services"; import { RequestService } from "../services";
import { IRemainingRequests } from "../interfaces/IRemainingRequests";
import { Component, Input, OnInit } from "@angular/core";
@Component({ @Component({
selector: "remaining-requests", selector: "remaining-requests",
@ -14,29 +15,29 @@ export class RemainingRequestsComponent implements OnInit {
public hoursUntil: number; public hoursUntil: number;
public minutesUntil: number; public minutesUntil: number;
constructor(private requestService: RequestService) constructor(private requestService: RequestService) {
{
} }
ngOnInit(): void { public ngOnInit() {
var self = this; const self = this;
this.update(); this.update();
this.requestService.onRequested().subscribe(m => { this.requestService.onRequested().subscribe(m => {
this.update(); this.update();
}); });
setInterval(function(){ setInterval(() => {
self.calculateTime(); self.calculateTime();
}, 10000) }, 10000);
setInterval(function(){ setInterval(() => {
self.update() self.update();
}, 60000) }, 60000);
} }
update(): void { public update(): void {
var callback = (remaining => { const callback = (remaining => {
this.remaining = remaining; this.remaining = remaining;
this.calculateTime(); this.calculateTime();
}); });
@ -48,21 +49,21 @@ export class RemainingRequestsComponent implements OnInit {
} }
} }
calculateTime(): void { private calculateTime(): void {
this.daysUntil = Math.ceil(this.daysUntilNextRequest()); this.daysUntil = Math.ceil(this.daysUntilNextRequest());
this.hoursUntil = Math.ceil(this.hoursUntilNextRequest()); this.hoursUntil = Math.ceil(this.hoursUntilNextRequest());
this.minutesUntil = Math.ceil(this.minutesUntilNextRequest()) this.minutesUntil = Math.ceil(this.minutesUntilNextRequest());
} }
daysUntilNextRequest(): number { private daysUntilNextRequest(): number {
return (new Date(this.remaining.nextRequest).getTime() - new Date().getTime()) / 1000 / 60 / 60 / 24; return (new Date(this.remaining.nextRequest).getTime() - new Date().getTime()) / 1000 / 60 / 60 / 24;
} }
hoursUntilNextRequest(): number { private hoursUntilNextRequest(): number {
return (new Date(this.remaining.nextRequest).getTime() - new Date().getTime()) / 1000 / 60 / 60; return (new Date(this.remaining.nextRequest).getTime() - new Date().getTime()) / 1000 / 60 / 60;
} }
minutesUntilNextRequest(): number { private minutesUntilNextRequest(): number {
return (new Date(this.remaining.nextRequest).getTime() - new Date().getTime()) / 1000 / 60; return (new Date(this.remaining.nextRequest).getTime() - new Date().getTime()) / 1000 / 60;
} }
} }

@ -18,8 +18,8 @@ import { SearchService } from "../services";
import { AuthGuard } from "../auth/auth.guard"; import { AuthGuard } from "../auth/auth.guard";
import { SharedModule } from "../shared/shared.module";
import { RemainingRequestsComponent } from "../requests/remainingrequests.component"; import { RemainingRequestsComponent } from "../requests/remainingrequests.component";
import { SharedModule } from "../shared/shared.module";
const routes: Routes = [ const routes: Routes = [
{ path: "", component: SearchComponent, canActivate: [AuthGuard] }, { path: "", component: SearchComponent, canActivate: [AuthGuard] },

@ -8,6 +8,7 @@ import { TreeNode } from "primeng/primeng";
import { FilterType, IChildRequests, IFilter, IMovieRequestModel, IMovieRequests, IMovieUpdateModel, IRequestEngineResult, IRequestsViewModel, ITvRequests, ITvUpdateModel, OrderType } from "../interfaces"; import { FilterType, IChildRequests, IFilter, IMovieRequestModel, IMovieRequests, IMovieUpdateModel, IRequestEngineResult, IRequestsViewModel, ITvRequests, ITvUpdateModel, OrderType } from "../interfaces";
import { ITvRequestViewModel } from "../interfaces"; import { ITvRequestViewModel } from "../interfaces";
import { ServiceHelpers } from "./service.helpers"; import { ServiceHelpers } from "./service.helpers";
import { IRemainingRequests } from "../interfaces/IRemainingRequests"; import { IRemainingRequests } from "../interfaces/IRemainingRequests";
@Injectable() @Injectable()
@ -30,7 +31,7 @@ export class RequestService extends ServiceHelpers {
} }
public requestMovie(movie: IMovieRequestModel): Observable<IRequestEngineResult> { public requestMovie(movie: IMovieRequestModel): Observable<IRequestEngineResult> {
var observer = Observable.create(observer => { const observer = Observable.create(observer => {
this.http.post<IRequestEngineResult>(`${this.url}Movie/`, JSON.stringify(movie), {headers: this.headers}).subscribe(m => { this.http.post<IRequestEngineResult>(`${this.url}Movie/`, JSON.stringify(movie), {headers: this.headers}).subscribe(m => {
observer.next(m); observer.next(m);
this.requestEvents.next(m); this.requestEvents.next(m);
@ -49,7 +50,7 @@ export class RequestService extends ServiceHelpers {
} }
public requestTv(tv: ITvRequestViewModel): Observable<IRequestEngineResult> { public requestTv(tv: ITvRequestViewModel): Observable<IRequestEngineResult> {
var observer = Observable.create(observer => { const observer = Observable.create(observer => {
return this.http.post<IRequestEngineResult>(`${this.url}TV/`, JSON.stringify(tv), { headers: this.headers }).subscribe(m => { return this.http.post<IRequestEngineResult>(`${this.url}TV/`, JSON.stringify(tv), { headers: this.headers }).subscribe(m => {
observer.next(m); observer.next(m);
this.requestEvents.next(m); this.requestEvents.next(m);

Loading…
Cancel
Save