akolpakov / django-unused-media

Remove unused media files from Django project
MIT License
126 stars 25 forks source link

Add support for django-stdimage variations #6

Open MaZZly opened 7 years ago

MaZZly commented 7 years ago

Hiyo..

noticed this removed thumbnails and such for my projects.. So I decided to extend this to support the variations field that django-stdimage uses..

https://github.com/akolpakov/django-unused-media/pull/5

Feel free to merge

Cheers!

MaZZly commented 7 years ago

Might also be worth adding to the README that it support django-stdimage variations.

vartagg commented 7 years ago

It seems that https://github.com/respondcreate/django-versatileimagefield has no attrubute variations.

----> 1 image.variations

AttributeError: 'VersatileImageFieldFile' object has no attribute 'variations'

Probably it would be better to add the possibility of declaring lookups for field thumbnails when running the command

akolpakov commented 7 years ago

Yes, I'm thinking to do something more universal. Do you know how I can retrieve all thumbnails from VersatileImageFieldFile?

vartagg commented 7 years ago

@akolpakov In my application using django-versatileimagefield I resolved this issue very simply: there are few settings which can be used for configure locations of changed images: VERSATILEIMAGEFIELD_SIZED_DIRNAME, VERSATILEIMAGEFIELD_FILTERED_DIRNAME, VERSATILEIMAGEFIELD_PLACEHOLDER_DIRNAME, so I just added these paths to -e option when calling the Command

boryskuczkowski commented 6 years ago

Sorry, has this issue been addressed beside ignoring named thumbnails in command?

akolpakov commented 6 years ago

@boryskuczkowski you can ignore thumbnails by using --exclude option, please check README.

But this issue is about to implement some universal automatic solution to exclude them automatically.