diff --git a/UPGRADING.md b/UPGRADING.md index 663e83f..9d9775b 100644 --- a/UPGRADING.md +++ b/UPGRADING.md @@ -20,6 +20,18 @@ drwx------ uploaded_files > **ATTENTION**: If you don't follow the process above, all the information regarding the previous version will not be kept. +### Jobs definition +The `CreateAlbums` configuration option **has been deprecated** in favor of `Album`. + +The `Album` configuration option set the album's name where the objects will be uploaded. + +If the `Album` option is not set, the objects will not be associated with an album in Google Photos. + +These are the valid values: `name:`, and `auto:`. + +- `name:` Followed by the album name in Google Photos (album names are not unique, so the first to match will be selected). ex. `Album: name:fooBar` +- `auto:` Followed either `folderPath` or `folderName` will use an autogenerated album name based on the object's folder path or object's folder name. ex. `Album: auto:folderPath` + ## Upgrading To 3.x from 2.x ### Configuration settings diff --git a/docs/configuration.md b/docs/configuration.md index 5b8f41f..ddbf1be 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -19,7 +19,7 @@ Example configuration file: [ { SourceFolder: YOUR_FOLDER_PATH - CreateAlbums: Off + Album: "auto:folderName" DeleteAfterUpload: false IncludePatterns: [ "**/*.jpg", "**/*.png" ] ExcludePatterns: [ "**/ScreenShot*" ] @@ -81,22 +81,25 @@ List of folders to upload and upload options for each folder. The folder to upload from. Must be an absolute path. Can expand the home folder tilde shorthand `~`. > The application will follow any symlink it finds, it does not terminate if there are any non-terminating loops in the file structure. -### CreateAlbums +### Album It controls how uploaded files will be organized into albums in Google Photos. -There are three options: -* `Off` will not create any album. -* `folderName` will use the name of the folder (within `SourceFolder`), where the item is uploaded from, to set the album name. -* `folderPath` will use the full path of the folder (relative to `SourceFolder`), where the item is uploaded from, to set the album name. +There are several options: +* `name:` followed by an album's name, will upload objects to an album with the specified name. *ex. `Album: name:fooBar`* +* `auto:folderName` will use the name of the folder (within `SourceFolder`), where the item is uploaded from, to set the album name. +* `auto:folderPath` will use the full path of the folder (relative to `SourceFolder`), where the item is uploaded from, to set the album name. ``` # Given SouceFolder: /foo # and file: /foo/bar/xyz/file.jpg -CreateAlbums: folderName +Album: name:myAlbum +# album name would be: myAlbum + +Album: auto:folderName # album name would be: xyz -CreateAlbums: folderPath +Album: auto:folderPath # album name would be: bar_xyz ``` diff --git a/internal/config/schema.go b/internal/config/schema.go index 81346da..306de9f 100644 --- a/internal/config/schema.go +++ b/internal/config/schema.go @@ -32,7 +32,7 @@ type FolderUploadJob struct { // Album is the album where objects will be uploaded. // If the Album option is not set, the objects will not be associated with an album in Google Photos. // - // These are the valid values: "name:", "id:" and "auto:". + // These are the valid values: "name:" and "auto:". // "name:" : Followed by the album name in Google Photos (album names are not unique, so the first to match // will be selected) // "auto:" : Followed either "folderPath" or "folderName" will use an autogenerated album name based on the