Refactor search service

This commit is contained in:
Geomitron
2020-03-11 22:51:24 -04:00
parent 3a3c2b5476
commit 18afa01e5c
9 changed files with 110 additions and 44 deletions

View File

@@ -1,23 +1,35 @@
import { Component } from '@angular/core'
import { Component, OnInit } from '@angular/core'
import { SongResult } from '../../../../electron/shared/interfaces/search.interface'
import { ElectronService } from '../../../core/services/electron.service'
import { VersionResult } from '../../../../electron/shared/interfaces/songDetails.interface'
import { AlbumArtService } from '../../../core/services/album-art.service'
import { DownloadService } from '../../../core/services/download.service'
import { groupBy } from 'src/electron/shared/UtilFunctions'
import { SearchService } from 'src/app/core/services/search.service'
@Component({
selector: 'app-chart-sidebar',
templateUrl: './chart-sidebar.component.html',
styleUrls: ['./chart-sidebar.component.scss']
})
export class ChartSidebarComponent {
export class ChartSidebarComponent implements OnInit {
private songResult: SongResult
selectedVersion: VersionResult
charts: VersionResult[][]
constructor(private electronService: ElectronService, private albumArtService: AlbumArtService, private downloadService: DownloadService) { }
constructor(
private electronService: ElectronService,
private albumArtService: AlbumArtService,
private downloadService: DownloadService,
private searchService: SearchService
) { }
ngOnInit() {
this.searchService.onNewSearch(() => {
this.selectVersion(undefined)
})
}
/**
* Displays the information for the selected song.