Set fallback values for statistics

This commit is contained in:
Bogdan 2024-01-07 15:30:54 +02:00
commit f0eb626324
9 changed files with 33 additions and 23 deletions

View file

@ -176,7 +176,7 @@ export const defaultState = {
const {
trackCount = 0,
trackFileCount
trackFileCount = 0
} = statistics;
const progress = trackCount ? trackFileCount / trackCount * 100 : 100;
@ -201,7 +201,7 @@ export const defaultState = {
albumCount: function(item) {
const { statistics = {} } = item;
return statistics.albumCount;
return statistics.albumCount || 0;
},
trackCount: function(item) {
@ -229,7 +229,7 @@ export const defaultState = {
const {
trackCount = 0,
trackFileCount
trackFileCount = 0
} = statistics;
const progress = trackCount ?