MCPcopy Create free account
hub / github.com/blizzard4591/openMittsu / insertMediaItem

Method insertMediaItem

src/database/SimpleDatabase.cpp:1353–1361  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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);

Callers

nothing calls this directly

Calls 2

errorMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected