Made some small optims when checking if files are removed
This commit is contained in:
@@ -208,4 +208,29 @@ namespace lms::db::tests
|
||||
ASSERT_TRUE(visited);
|
||||
}
|
||||
}
|
||||
|
||||
TEST_F(DatabaseFixture, ArtistInfo_findAbsoluteFilePath)
|
||||
{
|
||||
ScopedArtistInfo artistInfo{ session };
|
||||
|
||||
const std::filesystem::path absoluteFilePath{ "/path/to/artist.nfo" };
|
||||
{
|
||||
auto transaction{ session.createWriteTransaction() };
|
||||
artistInfo.get().modify()->setAbsoluteFilePath(absoluteFilePath);
|
||||
}
|
||||
|
||||
{
|
||||
auto transaction{ session.createReadTransaction() };
|
||||
|
||||
ArtistInfoId lastRetrievedId;
|
||||
|
||||
std::filesystem::path retrievedFilePath;
|
||||
ArtistInfo::findAbsoluteFilePath(session, lastRetrievedId, 1, [&](ArtistInfoId artistInfoId, const std::filesystem::path& filePath) {
|
||||
EXPECT_EQ(artistInfoId, artistInfo.getId());
|
||||
retrievedFilePath = filePath;
|
||||
});
|
||||
|
||||
EXPECT_EQ(retrievedFilePath, absoluteFilePath);
|
||||
}
|
||||
}
|
||||
} // namespace lms::db::tests
|
||||
Reference in New Issue
Block a user