(front) Albums: link to artist/albums + Play count
Improve ngIf part Use a script in ELS query to sort on avg play count
This commit is contained in:
@@ -9,22 +9,31 @@
|
||||
<th>Track Count</th>
|
||||
<th>Artist/Album Artist</th>
|
||||
<th>Avg Bit Rate (min)</th>
|
||||
<th>Play Count</th>
|
||||
<th>Rating</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr *ngFor="let album of albums">
|
||||
<td>
|
||||
{{album.Album}}
|
||||
<a [routerLink]="['/album', album.Album]">{{album.Album}}</a>
|
||||
<span class="glyphicon glyphicon-remove-circle" style="cursor:pointer" (click)="exlude('Album', album)"></span>
|
||||
</td>
|
||||
|
||||
<td>{{album['Track Count']}}</td>
|
||||
|
||||
<td>
|
||||
{{album['Album Artist'] ? album['Album Artist'] : album.Artist}}
|
||||
<span *ngIf="album['Album Artist']; else removeArtistButton"
|
||||
class="glyphicon glyphicon-remove-circle" style="cursor:pointer" (click)="exlude('Album Artist', album)"></span>
|
||||
<ng-template #removeArtistButton>
|
||||
<span class="glyphicon glyphicon-remove-circle" style="cursor:pointer" (click)="exlude('Artist', album)"></span>
|
||||
<!-- {{album['Album Artist'] ? album['Album Artist'] : album.Artist}} -->
|
||||
<span *ngIf="album['Album Artist']; else artistSection">
|
||||
<a [routerLink]="['/artist', album['Album Artist']]">{{album['Album Artist']}}</a>
|
||||
<span class="glyphicon glyphicon-ban-circle" style="cursor:pointer" (click)="exlude('Album Artist', album)"></span>
|
||||
</span>
|
||||
|
||||
<ng-template #artistSection>
|
||||
<span>
|
||||
<a [routerLink]="['/artist', album.Artist[0]]">{{album.Artist}}</a>
|
||||
<span class="glyphicon glyphicon-ban-circle" style="cursor:pointer" (click)="exlude('Artist', album)"></span>
|
||||
</span>
|
||||
</ng-template>
|
||||
</td>
|
||||
|
||||
@@ -33,6 +42,10 @@
|
||||
<span *ngIf="album['Avg Bit Rate'] != album['Min Bit Rate']">({{album['Min Bit Rate']}})</span>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
{{album['Play Count']}} ({{album['Play Count']/album['Track Count'] | number:'1.0-0'}}/songs)
|
||||
</td>
|
||||
|
||||
<td class="star" [title]="(album['Album Rating Computed']?'Computed Rating: ':'Rating: ') + album['Album Rating']">
|
||||
<span *ngFor="let item of numberToArray(album['Album Rating'], 20)">
|
||||
<span class="glyphicon" [ngClass]="album['Album Rating Computed']?'glyphicon-star-empty':'glyphicon-star'"></span>
|
||||
|
||||
@@ -14,7 +14,16 @@ export class ElsAlbumService extends ElsService {
|
||||
'Avg Bit Rate': {
|
||||
'order': 'asc'
|
||||
}
|
||||
} ],
|
||||
}, {
|
||||
'_script' : {
|
||||
'type' : 'number',
|
||||
'script' : {
|
||||
'lang': 'painless',
|
||||
'source': 'doc[\'Play Count\'].value / doc[\'Track Count\'].value'
|
||||
},
|
||||
'order' : 'desc'
|
||||
}
|
||||
} ],
|
||||
'size': ElsService.DEFAULT_SIZE
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user