| 1 | #ifndef SRC_SQL_RECORDINGSDB_H_ |
| 2 | #define SRC_SQL_RECORDINGSDB_H_ |
| 3 | |
| 4 | #include "SQLConnection.h" |
| 5 | |
| 6 | struct RecordingDBInfo |
| 7 | { |
| 8 | std::string recordingId; |
| 9 | int playCount = 0; |
| 10 | int lastPlayedPosition = 0; |
| 11 | time_t lastSeen = 0; |
| 12 | }; |
| 13 | |
| 14 | class RecordingsDB : public SQLConnection |
| 15 | { |
| 16 | public: |
| 17 | RecordingsDB(std::string folder); |
| 18 | ~RecordingsDB(); |
| 19 | bool Set(RecordingDBInfo& recordingDBInfo); |
| 20 | RecordingDBInfo Get(std::string recordingsId); |
| 21 | void Cleanup(); |
| 22 | private: |
| 23 | bool MigrateDbIfRequired(); |
| 24 | bool Migrate0To1(); |
| 25 | }; |
| 26 | |
| 27 | #endif /* SRC_SQL_RECORDINGSDB_H_ */ |