kirill19837 / mediaremove Goto Github PK
View Code? Open in Web Editor NEWUmbraco unused media remove
Home Page: https://oski.site/our-expertise/umbraco/
Umbraco unused media remove
Home Page: https://oski.site/our-expertise/umbraco/
Hello!
I've installed MediaRemove on an instance of Umbraco 9.1.2
When opening the Media Remove tab under settings I get 404 errors popping up on the following endpoints:
/umbraco/api/mediaRemove/GetRebuildStatus
/umbraco/api/mediaRemove/GetUnusedMediaStatus
/umbraco/api/mediaRemove/IsBuilt
/umbraco/api/mediaRemove/DeleteUnusedMediaStatus
The UI also only shows an empty panel. Did I install it wrong or is there something I could do to fix it?
Best regards,
Joshua
I added a parser for it:
public class BlockGridEditorParser : BaseTextParser
{
public override bool IsParserFor(string propertyEditorAlias)
{
return propertyEditorAlias.Equals("Umbraco.BlockGrid");
}
}
but it still does not find the images in the block grid editor content. Is there something else needed to be added?
We would like to use this plugin in a clients Umbraco 8 website but there a few things stopping us:
a) We need an option so that the media files get moved to the recycle bin instead of deleted: (MediaRemoveController)
mediaService.MoveToRecycleBin(mediaService.GetById(id));
b) One of our developers added a routine to look for non-referenced Media files in content.
if (!string.IsNullOrWhiteSpace(root.Model.Source))
{
string src = "";
if (root.Model.Source.ToLower().Trim().StartsWith("/media"))
{
src = root.Model.Source.ToLower().Trim();
}
else
{
JObject json = JObject.Parse(root.Model.Source);
src = json["src"].Value<string>();
}
if (!string.IsNullOrWhiteSpace(src))
{
this.logger.Info<MediaRemoveController>("querying: " + src);
var result = db.Query<string>("SELECT Data FROM [dbo].[cmsContentNu] where data like '%" + src + "%' and published > 0 and rv > 0 ");
if (result != null && result.Count() > 0)
{
//referenced in the site but not using Umbraco ID, so do not delete
mediaRemoveContext.JustAMessage += src + " |";
this.logger.Info<MediaRemoveController>("referenced but not using UDI: " + src);
}
else
{
this.logger.Info<MediaRemoveController>("unused: " + src);
mediaRemoveContext.UnusedMedia.Add(root);
}
}
}
c) Also since we use Continuous Integration it would be better to be able to install the plugin via Nuget.
Shall i submit a pull request with these changes?
Regards,
Marshall
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.