codicocodes / dotfyle

Find the best Neovim plugins

Home Page:https://dotfyle.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Remove old media from plugin?

scottmckendry opened this issue · comments

I have a plugin in Dotfyle where there is an image that no longer exists on the main branch but persists on the plugin page.

It would be good (as an author) to have an option to clean up old media. Or even if there was some additional logic in the media indexer to remove legacy images etc.

Makes sense, I know of the issue but haven't gotten to it!

There will be some issues with previously published TWiN issues containing stale image urls -> but I'm not sure how to solve that without storing the images myself, which I will not do at this time.

I'd likely go with deleting stale images that are no longer available in the readme, this would be the relevant code if anyone wants to pick this up

// TODO: 1. allow multiple plugins per media url
// TODO: 2. Remove stale media
await Promise.all([
data.map(async (m) => {
return await prismaClient.media.upsert({
where: {
url: m.url
},
create: m,
update: m
});
})
]);
}

I tried making a patch for this issue in PR #140, but I ran a few more testes and realized I still need to do some more work on it, because my delete query is crashing the seeder. I closed the PR for now because Its not working code

I'll try and work on it more tomorrow.