Skip to content

Add video groups support

This addressed #128 (closed).

Please review the API and let me know if that works for you :)

For fetching groups:

/**
     * @brief videoGroups Returns the media, grouped by their first characters
     * @param params Some query parameter. Only Alpha & NbMedia/NbVideo sorting criteria
     *               are supported. The default is Alpha
     * @return A query object, or nullptr in case of an error.
     */
    virtual Query<IVideoGroup> videoGroups( const QueryParameters* params = nullptr ) const = 0;
    /**
     * @brief setVideoGroupsPrefixLength Sets the size of the common prefix for
     *                                   a video group
     *
     * The provided value is the size of each group. For instance, if set to 4
     * "TestGroup" and "TestSomething" will be part of the same group, but if set
     * to 5, they will not.
     * This can be called at any point during the program lifetime.
     * The value will persist in database across multiple executions
     * The default value is 6
     */
    virtual void setVideoGroupsPrefixLength( uint32_t prefixLength ) = 0;

For getting groups info & media:

class IVideoGroup
{
public:
    virtual ~IVideoGroup() = default;
    /**
     * @brief name returns the name of this group
     */
    virtual const std::string& name() const = 0;
    /**
     * @brief count Returns the number of media in this group
     */
    virtual size_t count() const = 0;
    /**
     * @brief media Returns a query object to fetch this group's media
     */
    virtual Query<IMedia> media( const QueryParameters* params ) const = 0;
};
Edited by Hugo Beauzée-Luyssen

Merge request reports