Closed CarsonF closed 8 years ago
We could also do another controller prefix.
More work, but wouldn't that be a clearer way forward?
More work, but wouldn't that be a clearer way forward?
Probably. But it means duplicating the controller and we have a filesystem problem too. If saving thumbnails to disk is enabled then there are two folders...I guess that's not terrible though.
Definitely pays off in the long run not having to guess which filesystem to use.
Could we have the old controller extend the new controller and call parent functions with a corrected path, or am I miss understanding the problem? (It's Monday after all)
So creating a new controller would present a bunch of work, because of the caching aspect (thumbnails are saved to filesystem).
I think we could handle the change in the same controller there would just be some edge cases.
Say you had: files://files/foo/bar.jpg
that being a files
folder instead the files
folder/filesystem. It would previously generate a route like this: /thumbs/5x5c/files/foo/bar.jpg
. If that was used on the controller (with my change), it would be parsed as files://foo/bar.jpg
, missing the inner files
folder. As long as all cache is invalidated, including cache gateways, then the route would be regenerated like this: /thumbs/5x5c/files/files/foo/bar.jpg
which would be parsed correctly.
I think this edge case is small enough that it probably won't be a problem. As long as cache is invalidated, so the thumb routes are regenerated correctly.
Works for me.
K I'll work on PR at some point soon.
Ok I lied I can't do it in same controller without breaking BC.
Everyone ok if I do a major version for this change?
Modified approach approved at dev-meeting.
@CarsonF PR away :+1:
We need to be able to include mount point in path. Currently we are guessing by checking each filesystem to see if the file exists 👎 . It needs to be optional for BC, which puts us in a tight spot.
Ideally would do this:
/thumbs/5x5c/theme/foo/bar.jpg
But when it is not included,/thumbs/5x5c/foo/bar.jpg
: mount point would befoo
and path would bebar.jpg
.We could do one of these:
We could also do another controller prefix. That would create a bit more work, but it's doable.
Any other thoughts?