MediaLibrary.h 1.48 KB
Newer Older
1
2
3
#ifndef MEDIALIBRARY_H
#define MEDIALIBRARY_H

4
5
class Parser;

6
7
8
9
10
11
12
13
#include <sqlite3.h>

#include "IMediaLibrary.h"

class MediaLibrary : public IMediaLibrary
{
    public:
        MediaLibrary();
14
        ~MediaLibrary();
15
        virtual bool initialize( const std::string& dbPath );
16

Hugo Beauzée-Luyssen's avatar
Hugo Beauzée-Luyssen committed
17
18
19
        virtual bool files( std::vector<FilePtr>& res );
        virtual FilePtr file( const std::string& path );
        virtual FilePtr addFile( const std::string& path );
20
        virtual FolderPtr addFolder( const std::string& path ) override;
21
22
        virtual bool deleteFile( const std::string& mrl );
        virtual bool deleteFile( FilePtr file );
23
        virtual bool deleteFolder( FolderPtr folder ) override;
24

Hugo Beauzée-Luyssen's avatar
Hugo Beauzée-Luyssen committed
25
26
27
        virtual LabelPtr createLabel( const std::string& label );
        virtual bool deleteLabel(const std::string& text );
        virtual bool deleteLabel( LabelPtr label );
28

29
30
        virtual AlbumPtr album( const std::string& title );
        virtual AlbumPtr createAlbum( const std::string& title );
31

32
33
34
        virtual ShowPtr show( const std::string& name );
        virtual ShowPtr createShow( const std::string& name );

Hugo Beauzée-Luyssen's avatar
Hugo Beauzée-Luyssen committed
35
36
37
        virtual MoviePtr movie( const std::string& title );
        virtual MoviePtr createMovie( const std::string& title );

38
        virtual void addMetadataService( IMetadataService* service );
39
40
        virtual void parse( FilePtr file, IParserCb* cb );

41
    private:
42
        std::shared_ptr<sqlite3> m_dbConnection;
43
        std::unique_ptr<Parser> m_parser;
44
45
};
#endif // MEDIALIBRARY_H