Does somebody know how the 'hash' was generated for media URLs?
For example /media/yfemfx5x/room-on-fire.jpg
I need to convert old /media/{int}/file.png v7 formats to /media/{hash/}file.png v8+ formats to make sure that the media URLs are unique. Thats important, because I use uSync content edition to move content/media from old environment to different umbraco env. With the {int} ID's I can't make sure that there are no collisions when importing media (already existing media IDs).
I'm not sure if there's an easy way to migrate things form the old path to the new one, but you could probably write a script that leverages the same path logic.
How to generate hash in media URL
Hi all,
Does somebody know how the 'hash' was generated for media URLs?
For example /media/yfemfx5x/room-on-fire.jpg
I need to convert old
/media/{int}/file.png
v7 formats to/media/{hash/}file.png
v8+ formats to make sure that the media URLs are unique. Thats important, because I use uSync content edition to move content/media from old environment to different umbraco env. With the {int} ID's I can't make sure that there are no collisions when importing media (already existing media IDs).Thank you!
It looks like the logic is based on combining item guid, and the property guid, and converting it into a base32 string.
here is the method:
https://github.com/umbraco/Umbraco-CMS/blob/5bfab13dc5a268714aad2426a2b68ab5561a6407/src/Umbraco.Core/IO/MediaPathSchemes/UniqueMediaPathScheme.cs#L22 (there are a few other implementations, but i think this is the default one)
It's called from:
https://github.com/umbraco/Umbraco-CMS/blob/5bfab13dc5a268714aad2426a2b68ab5561a6407/src/Umbraco.Core/IO/MediaFileManager.cs#L108
I'm not sure if there's an easy way to migrate things form the old path to the new one, but you could probably write a script that leverages the same path logic.
is working on a reply...