This package will help organize your collection of photos and videos into a custom folder structure using rules based on EXIF information.
To use this package on DSM 7, you need to set the permissions for the shared folders.
Follow instructions below to set permissions
Step 1: Go to Control Panel > Shared Folder.
Step 2: Select a folder and click Edit > Permissions.
Step 3: Select Internal System User from the drop-down menu.
Step 4: Set Read/Write access for the RoboCopy user.
Step 5: Repeat steps 2-4 for each shared folder you want to use.
Step 1: Install standard PERL package
Step 2: Download the latest .spk
from here
Step 3: Open Package Center in DSM and select the Manual Install
option.
Step 4: Click Yes
when warned about using a package from an unknown publisher.
Step 5: Complete the wizard.
Step 6: Use the RoboCopy app icon in the main menu to access the RoboCopy UI where you can manage your setup.
Rules specify what actions need to be performed on files.
Rule field | Meaning |
---|---|
Priority | Rule execution order. |
Description | Rule description. |
Extention | File extension for applying this rule. |
Action | How to process a file: move or copy. |
Destination folder | Shared destination folder. |
Destination dir | Destination path. (Here you can use value substitution) |
Destination file | The name of the destination file. If empty, the file name will not change. (Here you can use value substitution) |
Values for substitution based on file metadata, they must be indicated by the mustaches (Ex. {title}). Value name is case sensitive.
The Phil Harvey's ExifTool library is used to obtain file metadata.
Name | Meaning | Example |
---|---|---|
Date time file creation | ||
h | Hour (12-hour clock) as a decimal number. | 7 |
hh | Hour (12-hour clock) as a zero-padded decimal number. | 07 |
H | Hour (24-hour clock) as a decimal number | 7 |
HH | Hour (24-hour clock) as a zero-padded decimal number. | 07 |
m | Minute as a decimal number. | 6 |
mm | Minute as a zero-padded decimal number. | 06 |
s | Second as a decimal number. | 5 |
ss | Second as a zero-padded decimal number. | 05 |
tt | Locale's equivalent of either AM or PM | AM |
d | Day of the month as a decimal number. | 2 |
dd | Day of the month as a zero-padded decimal number. | 02 |
ddd | Weekday as locale's abbreviated name. | Mon |
dddd | Weekday as locale's full name. | Monday |
M | Month as a decimal number. | 9 |
MM | Month as a zero-padded decimal number. | 09 |
MMM | Month as locale's abbreviated name. | Sep |
MMMM | Month as locale's full name. | September |
y | Year without century as a decimal number. | 1 |
yy | Year without century as a zero-padded decimal number. | 01 |
yyyy | Year with century as a decimal number. | 2001 |
File name | ||
file_ext | File extension | |
file_dir | Path to file (without start dir) | |
file_name | File name | |
Location | ||
country | Country name where was made photo | United States of America |
state | State name where was made photo | Massachusetts |
city | City name where was made photo | Quincy |
Other | ||
title | Title of composition | |
album | Album name | |
artist | Artist name | |
camera_make | Camera maker name | |
camera_model | Camera name |
There are times when the EXIF needed to correctly name a folder doesn't exist on a photo. I made fallback folders (thanks Elodie for idea) to help you deal with situations such as this. Here's how it works.
You can specify a series of folder names by taking them in parentheses and separating them with '|'. That's a pipe, not an 'L'. Let's look at an example.
/{yyyy}/({album}-{title}|{city}|Other)
What this asks me to do is to name the last folder the same as the "album"-"title" I find in EXIF. If I don't find an album or title in EXIF then I should use the city. If there's no GPS in the EXIf or I cannot detect it then I should name the last folder "Other".
I use Nominatim to help me organize your photos by location.
Geolocation information is not cached between sessions. But for query optimization I use the following algorithm:
- I check that the point belongs to any city that I requested earlier (CITY_CACHE). If successful, I return the address of the city.
- I check that the point is near (less than the threshold) with the points that I requested earlier (POINT_CACHE). If successful, I return the address of the point.
- I request data from the server.
- I try to get a polygon that sets the boundaries of the city. If successful, then I remember it in CITY_CACHE.
- If step 4 is failed, then I remember the point in POINT_CACHE.
Language of returned information and threshold value You can change in settings.
- DSM 4.2 and above
- PERL
- software: DSM 4.2, DSM 4.3, DSM 6.1, DSM 6.2, 7.0.1
- hardware: DS209, DS218+
Require linux machine with Perl (I use my NAS).
Download sources and exec make.sh
$ sh ./make.sh