diff --git a/src/app/components/content-list/content-list.component.ts b/src/app/components/content-list/content-list.component.ts index 2d2efd1..fb2b05f 100644 --- a/src/app/components/content-list/content-list.component.ts +++ b/src/app/components/content-list/content-list.component.ts @@ -69,17 +69,17 @@ export class ContentListComponent extends SettingsBase implements OnInit { }); } - homeRoute(){ + homeRoute() { return this.router.url === "/"; } getPlayerStatus() { this.playerService.getPlayerStatus().subscribe((item) => { this.playerState = item; - if (this.playerState?.item.type == "track") { - this.currentAlbum = this.playerState?.item.album.id - } else if (this.playerState?.item.type == "episode") { - this.currentAlbum = this.playerState?.item.show.id + if (this.playerState?.item.type === "track") { + this.currentAlbum = this.playerState?.item.album.id; + } else if (this.playerState?.item.type === "episode") { + this.currentAlbum = this.playerState?.item.show.id; } else { this.currentAlbum = ""; } diff --git a/src/app/components/language-switcher/language-switcher.component.ts b/src/app/components/language-switcher/language-switcher.component.ts index 543a221..439dc7c 100644 --- a/src/app/components/language-switcher/language-switcher.component.ts +++ b/src/app/components/language-switcher/language-switcher.component.ts @@ -12,7 +12,7 @@ export class LanguageSwitcherComponent implements OnInit { currentLang: any; languages: any[] = []; - hidden: boolean = true; + hidden = true; ngOnInit() { const defaultLanguage = window.localStorage.getItem("languageSelected") || this.translate.getDefaultLang(); @@ -37,7 +37,7 @@ export class LanguageSwitcherComponent implements OnInit { this.translate.getTranslation(x.code).subscribe(t => { x.flag = t.FlagCode, x.name = t.LanguageName, - x.direction = t.direction + x.direction = t.direction; }); }); } diff --git a/src/app/components/player/player.component.ts b/src/app/components/player/player.component.ts index c8c7d04..541091d 100644 --- a/src/app/components/player/player.component.ts +++ b/src/app/components/player/player.component.ts @@ -93,15 +93,15 @@ export class PlayerComponent extends SettingsBase implements OnInit, OnChanges { (this.playerStatus?.item?.duration_ms || 0)) * 100; this.seekStyle = { - background: `linear-gradient(to ${this.defaultLanguage != 'he' ? 'right' : 'left'}, var(--spt-green) 0%, var(--spt-green) ${progressPercentage}%, #343a40 ${progressPercentage}%, #343a40 100%)`, + background: `linear-gradient(to ${this.defaultLanguage !== 'he' ? 'right' : 'left'}, var(--spt-green) 0%, var(--spt-green) ${progressPercentage}%, #343a40 ${progressPercentage}%, #343a40 100%)`, }; } addScript() { - const script = document.createElement('script') - script.async = true - script.src = "https://sdk.scdn.co/spotify-player.js" - document.head.appendChild(script) + const script = document.createElement('script'); + script.async = true; + script.src = "https://sdk.scdn.co/spotify-player.js"; + document.head.appendChild(script); } initPlayer() { @@ -113,7 +113,7 @@ export class PlayerComponent extends SettingsBase implements OnInit, OnChanges { name: "Litefy Player", getOAuthToken: (cb) => { cb(token); - this.addScript() + this.addScript(); }, }); @@ -207,7 +207,7 @@ export class PlayerComponent extends SettingsBase implements OnInit, OnChanges { this.playerService.getCurrentState().subscribe((item) => { this.playerStatus = item; - if (this.playerStatus?.item.type == "track") { + if (this.playerStatus?.item.type === "track") { this.trackTitle = this.playerStatus?.item.name; this.trackAlbum = this.playerStatus?.item.album.name; this.trackAuthor = this.playerStatus?.item.album.artists[0]?.name; @@ -215,10 +215,10 @@ export class PlayerComponent extends SettingsBase implements OnInit, OnChanges { this.trackId = this.playerStatus?.item.id; this.albumId = 'album/' + this.playerStatus?.item.album.id; this.artistId = 'artist/' + this.playerStatus?.item.album.artists[0]?.id; - } else if (this.playerStatus?.item.type == "episode") { + } else if (this.playerStatus?.item.type === "episode") { this.trackTitle = this.playerStatus?.item.name; this.trackAlbum = this.playerStatus?.item.show.name; - this.trackAuthor = this.playerStatus?.item.show.publisher;; + this.trackAuthor = this.playerStatus?.item.show.publisher; this.trackImage = this.playerStatus?.item.images[2].url; this.trackId = this.playerStatus?.item.id; this.albumId = 'show/' + this.playerStatus?.item.show.id; diff --git a/src/app/components/youtube-player/youtube-player.component.spec.ts b/src/app/components/youtube-player/youtube-player.component.spec.ts index 0e64589..7310fb1 100644 --- a/src/app/components/youtube-player/youtube-player.component.spec.ts +++ b/src/app/components/youtube-player/youtube-player.component.spec.ts @@ -1,7 +1,4 @@ -/* tslint:disable:no-unused-variable */ -import { async, ComponentFixture, TestBed } from "@angular/core/testing"; -import { By } from "@angular/platform-browser"; -import { DebugElement } from "@angular/core"; +import { waitForAsync, ComponentFixture, TestBed } from "@angular/core/testing"; import { YoutubePlayerComponent } from "./youtube-player.component"; @@ -9,7 +6,7 @@ describe("YoutubePlayerComponent", () => { let component: YoutubePlayerComponent; let fixture: ComponentFixture; - beforeEach(async(() => { + beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ declarations: [YoutubePlayerComponent], }).compileComponents(); diff --git a/src/app/pages/home/home.component.ts b/src/app/pages/home/home.component.ts index d52c852..deae65b 100644 --- a/src/app/pages/home/home.component.ts +++ b/src/app/pages/home/home.component.ts @@ -24,12 +24,12 @@ export class HomeComponent implements OnInit { topArtists: SpotifyApi.PagingObject; topTracks: SpotifyApi.PagingObject; featuredPlaylists: SpotifyApi.PagingObject; - + requisicoesCompletas = false; activeUser: User; - range = "medium_term" + range = "medium_term"; ngOnInit() { this.getAllHomeData(); @@ -55,7 +55,7 @@ export class HomeComponent implements OnInit { }); } - changeRange(recievedRange: any){ + changeRange(recievedRange: any) { this.range = recievedRange; this.getAllHomeData(); const shortButt = document.getElementById("short_term"); @@ -68,5 +68,5 @@ export class HomeComponent implements OnInit { clickedButt.style.backgroundColor = "#0e512a"; } - + } diff --git a/src/app/pages/playlist/playlist.component.ts b/src/app/pages/playlist/playlist.component.ts index aea90d6..e870f81 100644 --- a/src/app/pages/playlist/playlist.component.ts +++ b/src/app/pages/playlist/playlist.component.ts @@ -13,7 +13,12 @@ import { TranslateService } from "@ngx-translate/core"; }) export class PlaylistComponent extends SettingsBase implements OnInit { - constructor(private playlistService: SpotifyPlaylistService, private activatedRoute: ActivatedRoute, injector: Injector, public translateService: TranslateService,) { + constructor( + private playlistService: SpotifyPlaylistService, + private activatedRoute: ActivatedRoute, + injector: Injector, + public translateService: TranslateService + ) { super(injector); } diff --git a/src/app/pages/settings/settings.component.spec.ts b/src/app/pages/settings/settings.component.spec.ts index 2811b74..d148411 100644 --- a/src/app/pages/settings/settings.component.spec.ts +++ b/src/app/pages/settings/settings.component.spec.ts @@ -1,7 +1,4 @@ -/* tslint:disable:no-unused-variable */ -import { async, ComponentFixture, TestBed } from '@angular/core/testing'; -import { By } from '@angular/platform-browser'; -import { DebugElement } from '@angular/core'; +import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing'; import { SettingsComponent } from './settings.component'; @@ -9,7 +6,7 @@ describe('SettingsComponent', () => { let component: SettingsComponent; let fixture: ComponentFixture; - beforeEach(async(() => { + beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ declarations: [ SettingsComponent ] }) diff --git a/src/app/pages/show/show.component.spec.ts b/src/app/pages/show/show.component.spec.ts index a8db615..1e4a0f4 100644 --- a/src/app/pages/show/show.component.spec.ts +++ b/src/app/pages/show/show.component.spec.ts @@ -1,3 +1,5 @@ +// tslint:disable:max-line-length + import { SpotifyShowService } from '@services/spotify-show.service'; import { AppModule } from './../../app.module'; import { waitForAsync, ComponentFixture, inject, TestBed } from '@angular/core/testing'; diff --git a/src/app/pipes/number-locale.ts b/src/app/pipes/number-locale.ts index 1d71e6f..ffb31b0 100644 --- a/src/app/pipes/number-locale.ts +++ b/src/app/pipes/number-locale.ts @@ -12,9 +12,9 @@ export class NumberLocale implements PipeTransform { } - transform(value: number | string, locale: string = 'pt') : string { + transform(value: number | string, locale: string = 'pt'): string { return new Intl.NumberFormat(locale, { minimumFractionDigits: 0 }).format(Number(value)); } -} \ No newline at end of file +} diff --git a/src/app/services/settings.service.spec.ts b/src/app/services/settings.service.spec.ts index 591cf4c..ad22247 100644 --- a/src/app/services/settings.service.spec.ts +++ b/src/app/services/settings.service.spec.ts @@ -23,7 +23,7 @@ describe("SettingsService", () => { it("#setSettings should save settings to Local Storage", () => { service.setSettings([settingsObj]); - + const result = window.localStorage.getItem(keySettings); expect(result).toBe(JSON.stringify([settingsObj])); @@ -34,7 +34,7 @@ describe("SettingsService", () => { result.subscribe(res => { expect(res).toBeNull(); - }) + }); })); it("#getSettings should return settings object from observable if there are settings stored", waitForAsync(() => { @@ -44,7 +44,7 @@ describe("SettingsService", () => { result.subscribe(res => { expect(res).toEqual([settingsObj]); - }) + }); })); it("#hasLocalstorageData should return true if there is settings data in Local Storage", () => { diff --git a/src/app/services/spotify-user.service.ts b/src/app/services/spotify-user.service.ts index f16d48b..bcb9f78 100644 --- a/src/app/services/spotify-user.service.ts +++ b/src/app/services/spotify-user.service.ts @@ -24,12 +24,12 @@ export class SpotifyUserService { } getUserTopArtists(range: any): Observable { - range = (range !== '') ? range : "medium_term" + range = (range !== '') ? range : "medium_term"; return this.service.Get('https://api.spotify.com/v1/me/top/artists?limit=24&time_range=' + range); } getUserTopTracks(range: any): Observable { - range = (range !== '') ? range : "medium_term" + range = (range !== '') ? range : "medium_term"; return this.service.Get('https://api.spotify.com/v1/me/top/tracks?time_range=' + range); }