Skip to content

Commit 5a582d7

Browse files
committed
2.3 - Fixed lint errors
1 parent 2c3d2f0 commit 5a582d7

9 files changed

+31
-44
lines changed

src/app/app.component.html

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,4 @@
11
<header>
2-
<div class="header-bar">
3-
<h1><span class="favicon-app"></span>YouTube Player v2.0</h1>
4-
<div class="win-controls">
5-
<button id="win-minimize" (click)="winMinimize();"></button>
6-
<button id="win-maximize" (click)="winMaximize();"></button>
7-
<button id="win-close" (click)="winClose();"></button>
8-
</div>
9-
<div class="linux-controls">
10-
<button id="linux-close" (click)="winMinimize();"></button>
11-
<button id="linux-minimize" (click)="winMaximize();"></button>
12-
<button id="linux-maximize" (click)="winClose();"></button>
13-
</div>
14-
</div>
152
<!-- <ng-container *ngIf="!globals.isLogged">
163
<button type="button" (click)="loginGoogle()">Login</button>
174
</ng-container>

src/app/app.component.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@ export class AppComponent implements OnInit {
6363

6464
constructor(
6565
private youtube: YoutubeGetVideo,
66-
private shared: SharedService,
67-
private globals: GlobalsService,
66+
public shared: SharedService,
67+
public globals: GlobalsService,
6868
private dragula: DragulaService,
6969

7070
private authService: AuthService,
@@ -236,7 +236,7 @@ export class AppComponent implements OnInit {
236236
}
237237

238238
findPlaylistItem() {
239-
const playlistItem = this.globals.playlistVideos.find(item => item.id === this.globals.currentVideo['id']);
239+
const playlistItem = this.globals.playlistVideos.find(item => item.id === this.globals.currentVideo['id']);
240240
this.currentPlaylistItem = this.globals.playlistVideos.indexOf(playlistItem);
241241
}
242242

@@ -364,7 +364,7 @@ export class AppComponent implements OnInit {
364364
}
365365

366366
preventOldSettings() {
367-
if (localStorage.length === 1 || !localStorage.getItem('version') || localStorage.getItem('version') == '1') {
367+
if (localStorage.length === 1 || !localStorage.getItem('version') || localStorage.getItem('version') === '1') {
368368
console.log('Updating localstorage...');
369369
localStorage.clear();
370370
this.globals.settings = null;
@@ -406,7 +406,7 @@ export class AppComponent implements OnInit {
406406

407407
playVideo(data: any) {
408408
if (data.id !== this.globals.currentVideo['id'] || this.currentState === -1) {
409-
this.globals.currentVideo = data
409+
this.globals.currentVideo = data;
410410
this.shared.addHistoryVideo(data);
411411
this.player.loadVideoById(this.globals.currentVideo['id']);
412412
this.getRelatedVideos();

src/app/components/category/category.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export class CategoryComponent implements OnInit {
1616
constructor(
1717
private youtube: YoutubeGetVideo,
1818
private shared: SharedService,
19-
private globals: GlobalsService,
19+
public globals: GlobalsService,
2020
private app: AppComponent,
2121
private activatedRoute: ActivatedRoute,
2222
private router: Router

src/app/components/youtube-history.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { GlobalsService } from '../services/globals.service';
1010
export class HistoryComponent implements OnInit {
1111

1212
constructor(
13-
private globals: GlobalsService,
13+
public globals: GlobalsService,
1414
private app: AppComponent
1515
) {
1616
}

src/app/components/youtube-settings.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ export class SettingsComponent implements OnInit {
9292
this.initExternalForm();
9393
this.loading = true;
9494
this.setForm();
95-
})
95+
});
9696
}
9797

9898
externalSave() {

src/app/models/video.model.ts

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
export interface VideoModel {
2-
id: string,
3-
title: string,
4-
channelTitle: string,
5-
channelId: string,
6-
categoryId: string,
2+
id: string;
3+
title: string;
4+
channelTitle: string;
5+
channelId: string;
6+
categoryId: string;
77
stats: {
8-
likes: string,
9-
dislikes: string,
10-
views: string
11-
},
8+
likes: string;
9+
dislikes: string;
10+
views: string;
11+
};
1212
thumbnails: {
13-
default: string,
14-
high: string,
15-
medium: string,
16-
}
13+
default: string;
14+
high: string;
15+
medium: string;
16+
};
1717
}

src/app/services/globals.service.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,12 @@ export class GlobalsService {
2727
displayVideoPlayer = true;
2828
repeatMode = true;
2929
darkMode = true;
30-
30+
3131
regionCode = '';
3232
apiKey = '';
3333
numSearchRes = '';
3434
numRelatedRes = '';
35-
35+
3636
settings: any;
3737

3838
constructor() { }

src/app/services/shared.service.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ export class SharedService {
119119
}
120120

121121
convertVideoObject(object: any, list: string) {
122-
let tempVideos = [];
122+
const tempVideos = [];
123123
let tempObject = {
124124
id: '',
125125
title: '',
@@ -136,14 +136,14 @@ export class SharedService {
136136
high: '',
137137
medium: '',
138138
}
139-
}
139+
};
140140

141141
// Populate temp object
142-
for (let i in object) {
143-
if (typeof object[i].id == 'string') {
144-
tempObject.id = object[i].id
142+
for (const i in object) {
143+
if (typeof object[i].id === 'string') {
144+
tempObject.id = object[i].id;
145145
} else {
146-
tempObject.id = object[i].id.videoId
146+
tempObject.id = object[i].id.videoId;
147147
}
148148
tempObject.title = object[i].snippet.title;
149149
tempObject.channelTitle = object[i].snippet.channelTitle;
@@ -190,7 +190,7 @@ export class SharedService {
190190
high: '',
191191
medium: '',
192192
}
193-
}
193+
};
194194
}
195195

196196
// Push tempObject into globals

src/app/services/youtube.service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ export class YoutubeGetVideo {
4949
return res;
5050
}
5151
}
52-
52+
5353
async categories() {
5454
if (this.globals.apiKey) {
5555
const res = await this.http.get(`${this.url}videoCategories?part=snippet&regionCode=${this.globals.regionCode}&key=${this.globals.apiKey}`)

0 commit comments

Comments
 (0)