Giter Club home page Giter Club logo

Comments (6)

fballiano avatar fballiano commented on July 30, 2024 1

Done a few things:

  • if an image was removed from FS, the download button throws an error message and removes the entry from DB
  • if an image was removed from FS, the delete/massdelete removes the entry from DB without throwing errors
  • if it's not possible to remove an image (privileges) the delete/massdelete throws an error message

The thing is, the more "checks" we add the slower it will become (now every files triggers a file_exists before the unlink...) and I don't want this module to be slow just to manage weird situations like "removing the whole folder" which is something I've never seen done.

It would anyway be interesting to be able to check for files manually removed from the FS but still in the DB table, as you say they should be removed and I agree. At the same time I wouldn't want to recheck all files on every sync... it would be easier (and quicker) to just "delete all records for that content_type_id" on every sync (of that same content type), what would you think about that?

from openmage-image-cleaner.

fballiano avatar fballiano commented on July 30, 2024 1

I've just pushed the blacklist feature and added a "reset" button to truncate the imagecleaner table (I needed it while testing, less see if we keep it in the future)

from openmage-image-cleaner.

ADDISON74 avatar ADDISON74 commented on July 30, 2024

The only thing I am concern is not generating wired situations when there are missing files or folders. Your approach in bullets is fine to me.

Let's take the intuitive part of using this extension. When I use it for the first time, the table is empty. I press one of the 3 buttons and I get results. Next time I come back I already have some results. The question is whether they are updated or not? If I use them and they are not updated, problems may occur, the most appropriate would be for the return to this page to lead to an update that I must do to have a picture at this time.

A hard sync versus a soft sync. When I click the [Refresh] button in ImaClean the table is truncated and auto_incremented to 1, then it is filled with records and reflects the situation at that moment. This is a hard sync and it takes around 6 - 7 seconds for 10.000 orphan images on an average system.

I've been wondering if it wouldn't be easier when I accessed the link in the Tools menu to refresh the table (truncate, auto_increment to 1, find all orphan images catalog/product/wysiwyg). At this point the 3 Sync buttons become usable only when needed. What would be the disadvantage? It would take a few seconds for the grid page to be accessed. If in the meantime unforeseen events happen such as files were accidentally deleted, it was recovered from an older back with a newer database, then those buttons can be used, like a hard sync.

Because it entered my reflex, if I accessed the extension page the first time I would do a hard sync. I would not start working on existing data who knows when it is stored.

from openmage-image-cleaner.

fballiano avatar fballiano commented on July 30, 2024

I wouldn't do a total refresh on accessing to the mask, because I don't want to trigger thousands of queries and IO on filesystem, unless it's intentional :-)

The idea behind having the data stored on the table was to be able (in the future) to pinpoint some image/file that you never want to delete by mistake (false positives, mostly possible in the WYSIWYG folder) and that could be done only having a new column on the image_cleaner table and keep the data between sessions.

I think it would be a very nice feature (at least for the projects I manage) to have the possibility to say "never delete this image/file" not even if I click the delete button.

We could have "another button" but... nah.. that would be confusing. I don't know, I'll think about that :-D

from openmage-image-cleaner.

ADDISON74 avatar ADDISON74 commented on July 30, 2024

For the moment your extension is a step forward comparing with ImaClean.

from openmage-image-cleaner.

ADDISON74 avatar ADDISON74 commented on July 30, 2024

[Reset] button is very useful and we should keep it. For example if I don't trust the records in grid I can click it and start from scratch for every of category/product/wysiwyg.

PS - I would make a change in the name of the buttons by removing the word "Images" and Reset All.

from openmage-image-cleaner.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.