Media Item Discrepancies (cmsMedia and cmsPropertyData)
Hello,
I'm working on a process that queries our Umbraco db to find media items that have been added to our site. I've come across a discrepancy in the number of files recorded in the cmsMedia table and the cmsPropertyData table.
In testing this process, I was originally querying the cmsMedia table to find all PDFs we are currently hosting. I found that this list was NOT comprehensive and that our website has links to documents (which do exist) that are not recorded in this table.
I started to look around and found a package (FALM Housekeeping) that queries the cmsPropertyData table to find this information. After a little testing, I've found this table to be more reliable for this information.
I see that the cmsMedia table is a relatively new addition to Umbraco. Has anyone else experienced this issue? Are there any reasons why a document would be recorded in cmsPropertyData but not in cmsMedia?
Media Item Discrepancies (cmsMedia and cmsPropertyData)
Hello,
I'm working on a process that queries our Umbraco db to find media items that have been added to our site. I've come across a discrepancy in the number of files recorded in the cmsMedia table and the cmsPropertyData table.
In testing this process, I was originally querying the cmsMedia table to find all PDFs we are currently hosting. I found that this list was NOT comprehensive and that our website has links to documents (which do exist) that are not recorded in this table.
I started to look around and found a package (FALM Housekeeping) that queries the cmsPropertyData table to find this information. After a little testing, I've found this table to be more reliable for this information.
I see that the cmsMedia table is a relatively new addition to Umbraco. Has anyone else experienced this issue? Are there any reasons why a document would be recorded in cmsPropertyData but not in cmsMedia?
Thanks for your help, Kyle
I have no idea how why there are 2 tables to store similar information, that's a question for HQ.
As a general rule, I try to avoid looking in the database to get the information that is stored in umbraco.
If you want to get all media items, use examine
+__IndexType:media +(__NodeTypeAlias: file __NodeTypeAlias:image)
If you want to know when an item is added/removed from media use the MediaService events https://our.umbraco.com/documentation/reference/events/mediaservice-events
Hopes this helps to finish your process.
is working on a reply...