Skip to content

Commit

Permalink
✨ feat: Add stream count to list view
Browse files Browse the repository at this point in the history
  • Loading branch information
caoccao committed Aug 28, 2024
1 parent 86e4800 commit ed32f53
Showing 1 changed file with 29 additions and 3 deletions.
32 changes: 29 additions & 3 deletions src/routes/list.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,26 @@
.setHeader("Encoded Date")
.setInCardView()
.setInListView(),
new PropertyDefinition("Video:Count")
.setOrderByNumber()
.setHeader("V")
.setInListView(),
new PropertyDefinition("Audio:Count")
.setOrderByNumber()
.setHeader("A")
.setInListView(),
new PropertyDefinition("Text:Count")
.setOrderByNumber()
.setHeader("T")
.setInListView(),
new PropertyDefinition("Image:Count")
.setOrderByNumber()
.setHeader("I")
.setInListView(),
new PropertyDefinition("Menu:Count")
.setOrderByNumber()
.setHeader("M")
.setInListView(),
];
const COMMON_PROPERTIES_VIDEO: Array<PropertyDefinition> = [
Expand Down Expand Up @@ -400,8 +420,8 @@
);
$: dataOfListView = [...fileToPropertyMaps.entries()].map(
([file, propertyMaps]) =>
propertyMaps
([file, propertyMaps]) => {
const newPropertyMap = propertyMaps
.filter((map) => map.num == 0)
.map((map) => {
const newProperty: Record<string, string> = {};
Expand All @@ -410,7 +430,13 @@
});
return newProperty;
})
.reduce((acc, cur) => ({ ...acc, ...cur }), {})
.reduce((acc, cur) => ({ ...acc, ...cur }), {});
fileToStreamCountMap.get(file)?.forEach((streamCount, stream) => {
newPropertyMap[`General:${stream}:Count`] =
streamCount.count.toString();
});
return newPropertyMap;
}
);
$: columnsOfListView = [...COMMON_PROPERTIES_MAP.entries()]
Expand Down

0 comments on commit ed32f53

Please sign in to comment.