Or if not mapped to a specific category, a Category object looks like this:
{
"id": null,
"label": "Unknown"
}
The public interface should look something like this:
class VideoService {
private videos = [];
// extracted from "category" info in private videos list
public getVideoCategoryLabels(): Array[CategoryLabel]
// relies on first getting category labels
public getVideosForCategory(categoryLabel): Array[Video]
}
The React components will use VideoService.getVideoCategoryLabels() and VideoService.getVideosForCategory() to render their contents.
Acceptance criterion:
[ ] Use test data with 2 categories + 1 "Unknown"
[ ] Spread 10 videos across the different categories, one category with 1 video, one category with 7 videos, one category with 2 videos
[ ] Unit test coverage for the public interface of the VideoService
From #3, we need a service that provides categories and video data per the format used in PeerTube.
Add data model representing a subset of a PeerTube video object:
A Category object looks like this if set:
Or if not mapped to a specific category, a Category object looks like this:
The public interface should look something like this:
The React components will use
VideoService.getVideoCategoryLabels()
andVideoService.getVideosForCategory()
to render their contents.Acceptance criterion:
VideoService