| 1351 | } |
| 1352 | |
| 1353 | bool SimpleDatabase::insertMediaItem(QString const& uuid, QByteArray const& data, MediaFileType const& fileType) { |
| 1354 | try { |
| 1355 | m_mediaFileStorage.insertMediaItem(uuid, data, fileType); |
| 1356 | } catch (openmittsu::exceptions::UuidAlreadyExistsExceptionImpl&) { |
| 1357 | LOGGER()->error("Detected UUID duplication when inserting file with UUID {}, size {} and file type {} (if this message appears multiple times, something major is broken!).", uuid.toStdString(), data.size(), MediaFileTypeHelper::toInt(fileType)); |
| 1358 | return false; |
| 1359 | } |
| 1360 | return true; |
| 1361 | } |
| 1362 | |
| 1363 | void SimpleDatabase::removeMediaItem(QString const& uuid, MediaFileType const& fileType) { |
| 1364 | m_mediaFileStorage.removeMediaItem(uuid, fileType); |