+
{{errorMessage}}
+
+
iTunes stats
+
+
+
+
+
+
+
+
+
+
+
+
{{totalTimeSt}}
+
Total time
+
+
+
+
+
+
+
+
+
+
+
+
+
+
{{totalSizeSt}}
+
Total size
+
+
+
+
+
+
+
+
+
+
+
+
+
+
{{trackCountSong}}
+
Total Songs
+
+
+
+
+
-
-
{{e['Play Count']}}: {{e.Name}} - {{e.Artist}} - {{e.Album}}
+
Top Played Songs
+
\ No newline at end of file
diff --git a/dashboard/src/app/dashboard.component.ts b/dashboard/src/app/dashboard.component.ts
index 584f800..2f808ca 100644
--- a/dashboard/src/app/dashboard.component.ts
+++ b/dashboard/src/app/dashboard.component.ts
@@ -47,6 +47,11 @@ export class DashboardComponent implements OnInit {
);
}
+
+ /**
+ * UTILS FUNCTION - TODO MOVE
+ */
+
convertMsToTime(ms: number): string {
let x = ms / 1000
let seconds = Math.round(x % 60)
@@ -58,8 +63,8 @@ export class DashboardComponent implements OnInit {
x /= 24
let days = Math.round(x);
- // return days + "d" + hours + "h" + minutes + ":" + seconds;
- return days + " days, " + hours + " hours, " + minutes + " minutes and " + seconds + " seconds";
+ return days + "d, " + hours + ":" + minutes + "." + seconds;
+ // return days + " days, " + hours + " hours, " + minutes + " minutes and " + seconds + " seconds";
}
convertSizeToString(size: number) {
diff --git a/dashboard/src/app/sortby.pipe.ts b/dashboard/src/app/sortby.pipe.ts
index 7ff497d..653ae7d 100644
--- a/dashboard/src/app/sortby.pipe.ts
+++ b/dashboard/src/app/sortby.pipe.ts
@@ -4,29 +4,21 @@ import { Pipe, PipeTransform } from '@angular/core';
export class SortPipe implements PipeTransform {
transform(array: Array
, args: string): Array {
array.sort((a: any, b: any) => {
- console.log("a: " + a[args]);
- console.log("b: " + b[args]);
if (a[args] == undefined && b[args] == undefined) {
- console.log("und: " + 0)
return 0;
}
if (a[args] == undefined && b[args] != undefined) {
- console.log("und: " + "-1")
return -1;
}
if (a[args] != undefined && b[args] == undefined) {
- console.log("und: " + "-1")
return 1;
}
if ( a[args] < b[args] ){
- console.log(-1);
return -1;
}else if( a[args] > b[args] ){
- console.log(1);
return 1;
}else{
- console.log(0);
return 0;
}
});