I am having trouble creating a shortcut that finds and delete all of the videos that I take at a particular location.
My wife and I strength train virtually with a coach and have to submit our videos for form checks. We use our phones to upload them to our coach. I would like assistance in troubleshooting my shortcut that should do the following
- Find all the videos that were take at my gym
- Delete them
Here is what I have so far:
The shortcut selects all the videos and doesn’t seem to be able to filter them based on the location. How do I solve this issue?
You could use “Get distance” and check that each video’s location is within a distance from your workplace’s location.
Note that in the image above, the orange “Location” is referring to Repeat Item, but of type “Location”
Don’t forget to first test with a “Show Result: Repeat Item” action instead of “Delete Repeat Item” at the end, to be sure
Hope this helps
Why did you use the distance from action? Is there no way to find videos from a particular location?
The way that I have this set up, it finds all videos, not just those in the location. What am I doing wrong?
Mumbai is a location, but to Shortcuts it is in effect a point on the surface of the earth, not a region. That’s what a location is. Think about a map pin rather than a city boundary.
Let’s say we took a video at the Gateway of India in Mumbai. The location in Shortcuts turns out to be the following coordinates.
Is that the same as Mumbai? No. It may be “close”, but it is not the same. This is because they are both points, not regions.
You are looking for videos taken in the region of Mumbai, not at a point in Mumbai, so to specify the region, you need to specify the central point and the distance from that point that specifies your region. You are effectively creating a tolerance level for matching your location (point).
Hope that helps.
Would this work if I pass the exact coordinates of the gym say for example where I take the videos?
I am trying to solve this without declaring the variable work_address as @sebastienkb has done given that I know the exact coordinates of the location where I film my videos.
As long as your GPS gives precisely the same value to about 14 or 15 decimal places on both the latitude and longitude you are fine… in other words, no.
The earlier point of point vs area still stands.
You could round off and compare the coordinates to fuzz them, but you are making things harder for yourself.
What is the reason for not wanting to use the variable you refer to? An arbitrary preference or something concrete?
No preference but just a lack of understanding of the fundamental point that you made, which was that the location refers to point and not an area.
GPS is not 100% accurate so you can’t just grab the GPS data and compare the numbers. You’ll find more info on GPS accuracy here: GPS.gov: GPS Accuracy
You also can’t lookup the corresponding postal address of each video in Shortcuts and check if the city reads “Mumbai” or else you’ll delete ALL videos taken in ALL of Mumbai, which is a way bigger area than what you are aiming (your gym place).
The least error-prone way to work with this is to get the GPS location of each video and see if it’s within a specific range of a fixed GPS location (your gym place), hence the use of a variable and Get Distance inside the Repeat loop. Shortcuts doesn’t provide an easy way to type a precise GPS location so looking up the place in the field I showed is the easiest way. Any other way of comparing GPS points is a headache.