we use CMS 3.3.7 in a docker installation on a ubuntu server and I am actually cleaning up the library.
I found more than 100 old ticker files that should be removed.
How can I achieve that? Just deleting the files is not enough because they are also in the media table.
I would like to remove all ticker_* files that are older than e.g. 30 days.
When they get added to the library they are given an expiry date according to the cache settings of the widget they are linked to. All the time that widget is using the file, they won’t be deleted, but after that the maintenance task will clear them up if that expiry date has passed.
If you’re sure that they aren’t being used anymore, you can manually unlink them from the widgets that use them, and then run maintenance.
DELETE FROM `lkwidgetmedia`
WHERE `mediaId` IN (
SELECT `mediaId`
FROM `media`
WHERE `expires` < 1694620129
AND IFNULL(`expires`, 0) <> 0
AND `type` = 'module'
);
I’d run the query inside the IN first to make sure the results look sensible.
Thank you very much for the help.
I have changed the request a little:
DELETE FROM `lkwidgetmedia`
WHERE `mediaId` IN (
SELECT `mediaId`
FROM `media`
WHERE `name` LIKE "ticker_%"
AND IFNULL(`expires`, 0) <> 0
AND `type` = 'module'
);
This deletes all ticker relations.
After that I deleted all “ticker_%” records in media table and all ticker_* files in folder shared/cms/library/
This is my “cleanup” of ticker files of the RSS feeds.
My idea was to solve the problem with the random not shown images when playing RSS feeds, but unfortunately that did not help.
We us Windows and webOS players with latest v3 version for testing.
We found out, that the file requiredFiles.xml does not contain all images that are necessary for the ticker.
It seems that the issue comes from CMS side, but it’s to complicated to find the reason in the code for me actually…
So it seems that the “ticker.htm” (a number as filename) is getting updated before the requiredFiles.xml is being updated.
I want to get this problem solved, but where to find this code snipset that is responsible for that…?
Yes that would be the case - but the next time require files gets regenerated those images will be included.
Its a really difficult problem to solve and another reason behind our architecture changes in v4. In v4 the only place that images are cached and linked to displays is by the Widget Sync task. The players then call GetData in XMDS and receive a new JSON file with the data, alongside the links to download all files currently referenced in that data.
We’ve broken the direct link between required files being generated and new data being made available.
If you can give it a few weeks for v4 to settle down and for us to iron out some of the remaining issues, I think you could solve with an upgrade.