Switch "file" type to "audio" type, whoops

pull/15/head
Facinorous-420 3 years ago
parent 82ecf72c1d
commit 42cad9de61

@ -90,12 +90,12 @@ export class Pager {
data: usersData,
allImages: usersData.filter(item=> item.type.includes('image')),
allVideos: usersData.filter(item=> item.type.includes('video')),
allFiles: usersData.filter(item=> item.type.includes('file')),
allAudio: usersData.filter(item=> item.type.includes('audio')),
allOthers: usersData.filter(item=> item.type.includes('other')),
totalSize:formatSize(usersData.map(item => item.size).reduce((prev, curr) => prev + curr, 0)),
totalImageSize: formatSize(usersData.filter(item=> item.type.includes('image')).map(item => item.size).reduce((prev, curr) => prev + curr, 0)),
totalVideosSize: formatSize(usersData.filter(item=> item.type.includes('video')).map(item => item.size).reduce((prev, curr) => prev + curr, 0)),
totalFilesSize: formatSize(usersData.filter(item=> item.type.includes('file')).map(item => item.size).reduce((prev, curr) => prev + curr, 0)),
totalAudioSize: formatSize(usersData.filter(item=> item.type.includes('audio')).map(item => item.size).reduce((prev, curr) => prev + curr, 0)),
totalOthersSize: formatSize(usersData.filter(item=> item.type.includes('other')).map(item => item.size).reduce((prev, curr) => prev + curr, 0))
}
@ -108,12 +108,12 @@ export class Pager {
data: targetData,
allImages: targetData.filter(item=> item.type.includes('image')),
allVideos: targetData.filter(item=> item.type.includes('video')),
allFiles: targetData.filter(item=> item.type.includes('file')),
allAudio: targetData.filter(item=> item.type.includes('audio')),
allOthers: targetData.filter(item=> item.type.includes('other')),
totalSize:formatSize(targetData.map(item => item.size).reduce((prev, curr) => prev + curr, 0)),
totalImageSize: formatSize(targetData.filter(item=> item.type.includes('image')).map(item => item.size).reduce((prev, curr) => prev + curr, 0)),
totalVideosSize: formatSize(targetData.filter(item=> item.type.includes('video')).map(item => item.size).reduce((prev, curr) => prev + curr, 0)),
totalFilesSize: formatSize(targetData.filter(item=> item.type.includes('file')).map(item => item.size).reduce((prev, curr) => prev + curr, 0)),
totalAudioSize: formatSize(targetData.filter(item=> item.type.includes('file')).map(item => item.size).reduce((prev, curr) => prev + curr, 0)),
totalOthersSize: formatSize(targetData.filter(item=> item.type.includes('other')).map(item => item.size).reduce((prev, curr) => prev + curr, 0))
}
}

@ -85,14 +85,14 @@
<div class="flex">
<i data-lucide="file" class="text-orange-400 mr-2"></i>
<p class="ml-auto text-slate-500 text-sm">
<%= usersDataObj.totalFilesSize %>
<%= usersDataObj.totalAudioSize %>
</p>
</div>
<div class="text-color-primary sm:text-lg md:text-3xl font-medium leading-8 mt-6">
<%= usersDataObj.allFiles.length %>
<%= usersDataObj.allAudio.length %>
</div>
<div class="sm:text-sm md:text-base text-base text-slate-500 mt-1">
<% if(usersDataObj.allFiles.length==1){ %> File <% } else { %> Files <% } %>
<% if(usersDataObj.allAudio.length==1){ %> Audio File <% } else { %> Audio Files <% } %>
</div>
</div>
</div>
@ -109,7 +109,7 @@
<%= usersDataObj.allOthers.length %>
</div>
<div class="sm:text-sm md:text-base text-slate-500 mt-1">
<% if(usersDataObj.allOthers.length==1){ %> Other <% } else { %> Others <% } %>
<% if(usersDataObj.allOthers.length==1){ %> Other File <% } else { %> Other Files <% } %>
</div>
</div>
</div>

Loading…
Cancel
Save