Skip to content

An app that I personally use for organising photos in Dropbox into my personal (weird) layout

Notifications You must be signed in to change notification settings

moelholm/media-organizer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

79 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A tool for organizing photos and videos into my personal favorite layout.

Guide for developers

Before you begin: Ensure that you have jdk 17 and mvn 3.x.x.

Run the application

Create a properties file with the following content:

#
# Mandatory properties (otherwise the application will not start)
#
mediaorganizer.fileSystemType=local
mediaorganizer.source.fromDir=/test_media_organizer/input
mediaorganizer.destination.toDir=/test_media_organizer/output
#
# Optional properties (here configuring the application to use Danish locale and texts)
#
mediaorganizer.destination.localeForGeneratingDestinationFolderNames=da
mediaorganizer.destination.suffixForDestinationFolderOfMiscMediaFiles=Blandet
mediaorganizer.destination.suffixForDestinationFolderOfUnknownEventMediaFiles=Ukendt Haendelse

See app/src/main/resources/application.yml for more properties that you can override (for example supported media files etc).

Then run the application with the following command mvn spring-boot:run

Do you want to try out the tool with Dropbox? Then set properties: mediaorganizer.fileSystemType=dropbox and dropbox.accessToken=[your-own-token]. To use this feature you need to get your own token for your Dropbox account.

Do you want to try out the tool with support for loading properties from AWS SSM Parameter store? Then set property: aws.paramstore.enabled=true (enables the code to load properties from AWS SSM Parameter store) and the usual AWS SDK specific environment variables:

  • AWS_REGION=blah, AWS_ACCESS_KEY_ID=secret and AWS_SECRET_KEY=secret (and possibly AWS_SESSION_TOKEN=secret if you are using temporary credentials - and you should)

  • Or, if you have proper profiles defined, then: AWS_PROFILE=blah

  • The code also respects AWS_CREDENTIAL_PROFILES_FILE which can be used to point to a custom location of your AWS credentials file

  • etc. etc.

Now you can set properties in AWS SSM Parameter store under /APPLICATION/MEDIA-ORGANIZER/* and the application will load them (consider to put the Dropbox access token in AWS SSM Parameter store as an encrypted value for example).

Test

mvn test ( Runs all unit tests and integration tests )

Build distribution

mvn install

Prep for production distribution on AWS Lambda

mvn clean package -Pproduction

Ref:

https://github.com/awslabs/aws-serverless-java-container/wiki/Quick-start---Spring-Boot3

Run production distribution

All examples are meant to be run from a POSIX terminal positioned at the app directory.

Also note: the application is run with overriding properties from properties file etc/application-production.properties. That file enables AWS SSM Parameter store and loads properties from there. Therefore you must have exported the AWS SDK specific environment variables mentioned above.

Maven:

SPRING_PROFILES_ACTIVE=production mvn spring-boot:run

JRE (it’s a shaded JAR, not a spring boot plugin built one):

SPRING_PROFILES_ACTIVE=production java -cp target/media-organizer-0.0.1-SNAPSHOT.jar com.moelholm.tools.mediaorganizer.Main

About

An app that I personally use for organising photos in Dropbox into my personal (weird) layout

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published