Inconsistent amount of assets in DB and in the Desktop

Database shows

select count(*) from Asset where shown = 1
19959

While UI shows only 19944 assets

2021-04-13_16-37-17

How can I identify the missing 15 assets and find out why there is the discrepancy?

That count of assets are all assets with a When tag.

That really should be all your assets: if something doesn’t have a parseable captured-at time, it shouldn’t be imported.

To find the stragglers:

SELECT DISTINCT
  a.id AS assetId,
  a.shown as assetIsValid,
  af.uri AS uri,
  af.shown as primaryAssetFileVariant
FROM
  Asset a
  JOIN AssetFile af ON af.assetId = a.id
WHERE
  a.id NOT IN (
    SELECT
      assetId
    FROM
      AssetTag at
      JOIN Tag t ON t.id = at.tagId
    WHERE
      t._path LIKE 'When%'
  )
ORDER BY
  assetId,
  uri
1 Like

Thanks. Actually after some time Desktop started to show 19959 as well