Improve Bit Rate translate processing

This commit is contained in:
2017-10-18 23:00:46 +02:00
parent b772584c56
commit ae76f916ae
2 changed files with 6 additions and 5 deletions

View File

@@ -111,7 +111,7 @@
<td>{{song['Play Count']}}</td>
<td><a [routerLink]="['/genre', song.Genre]">{{song.Genre}}</a></td>
<td [title]="song['Bit Rate']">
<span [class]="'signal signal-' + Math.round(song['Bit Rate']/64)"></span>
<span [class]="'signal signal-' + roundBitRate(song['Bit Rate'])"></span>
</td>
<td *ngIf="!song['Rating Computed']" [title]="'Rating: ' + song.Rating" class="star">
<span *ngIf="song.Rating >= 20" class="glyphicon glyphicon-star"></span>

View File

@@ -15,7 +15,6 @@ import { SortByPipe } from './../sort-by.pipe';
})
export class ArtistComponent implements OnInit {
Math: any;
artistName = '';
songs: Array<Song> = [];
artist: Artist = new Artist();
@@ -30,9 +29,7 @@ export class ArtistComponent implements OnInit {
private elsService: ElsService,
private route: ActivatedRoute,
private location: Location
) {
this.Math = Math;
}
) { }
ngOnInit(): void {
this.route.params.subscribe((params: Params) => this.artistName = params['name']);
@@ -99,4 +96,8 @@ export class ArtistComponent implements OnInit {
this.songs = new SortByPipe().transform(this.songs, 'Year', 'Album', 'Track Number', 'Play Count');
this.sortable = false;
}
roundBitRate(bitRate: number) {
return Math.round(bitRate / 64);
}
}