Skip to content

Commit

Permalink
Minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
patxibocos committed May 11, 2024
1 parent eb3b494 commit a01b542
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ It is shipped as a GitHub action, but it can be easily built and run by yourself

## GitHub action 🚀

First of all, it is required to setup Google Photos auth to get a client id, client secret and a non expiring refresh
First of all, it is required to set up Google Photos auth to get a client id, client secret and a non expiring refresh
token. Please follow the steps in [Google Photos OAuth](#google-photos-oauth-).

Then, you need to configure auth for GitHub, Dropbox, Box or OneDrive:
Expand All @@ -24,7 +24,7 @@ Then, you need to configure auth for GitHub, Dropbox, Box or OneDrive:
### Usage 📕

The mandatory fields are `exporter` (**github**, **dropbox**, **box** or **onedrive**), `googlePhotosClientId`, `googlePhotosClientSecret` and `googlePhotosRefreshToken`.
Additionally there are exporter dependant mandatory fields.
Additionally, there are exporter dependant mandatory fields.

- For **GitHub** => `githubAccessToken`, `githubRepositoryOwner` and `githubRepositoryName`
- For **Dropbox** => `dropboxAppKey`, `dropboxAppSecret` and `dropboxRefreshToken`
Expand Down Expand Up @@ -122,7 +122,7 @@ create one, follow these steps:
5. Give any desired name to the app
6. Follow the
steps [here](https://www.codemzy.com/blog/dropbox-long-lived-access-refresh-token#how-can-i-get-a-refresh-token-manually)
to generate a **long lived refresh token**
to generate a **long-lived refresh token**
7. Get app key and secret from app settings, and refresh token from the previous step

### Box OAuth 📦
Expand All @@ -141,7 +141,7 @@ create one, follow these steps:

1. Follow the steps described in => https://learn.microsoft.com/en-us/graph/auth-v2-user?view=graph-rest-1.0
1. When setting the scopes, set `offline_access files.readwrite`. The first one will allow getting new access
tokens. The later is required to upload photos/videos and also for reading the sync file.
tokens. The latter is required to upload photos/videos and also for reading the sync file.

## Build on your own 📙

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,25 +23,25 @@ internal sealed interface ExporterSubcommands<T> {
}
}

object GitHub : Subcommand("github", "GitHub exporter"), ExporterSubcommands<Unit> {
data object GitHub : Subcommand("github", "GitHub exporter"), ExporterSubcommands<Unit> {
override fun execute() {}
override fun data() = Unit
override val type = Exporter.ExporterType.GITHUB
}

object Dropbox : Subcommand("dropbox", "Dropbox exporter"), ExporterSubcommands<Unit> {
data object Dropbox : Subcommand("dropbox", "Dropbox exporter"), ExporterSubcommands<Unit> {
override fun execute() {}
override fun data() = Unit
override val type = Exporter.ExporterType.DROPBOX
}

object Box : Subcommand("box", "Box exporter"), ExporterSubcommands<Unit> {
data object Box : Subcommand("box", "Box exporter"), ExporterSubcommands<Unit> {
override fun execute() {}
override fun data() = Unit
override val type = Exporter.ExporterType.BOX
}

object OneDrive : Subcommand("onedrive", "OneDrive exporter"), ExporterSubcommands<Unit> {
data object OneDrive : Subcommand("onedrive", "OneDrive exporter"), ExporterSubcommands<Unit> {
override fun execute() {}
override fun data() = Unit
override val type = Exporter.ExporterType.ONEDRIVE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ enum class ItemType {
PHOTO, VIDEO
}

private object GooglePhotosItemForbidden : Exception()
private object GooglePhotosItemForbidden : Exception() {
private fun readResolve(): Any = GooglePhotosItemForbidden
}

private const val BASE_PATH = "https://photoslibrary.googleapis.com"

Expand Down

0 comments on commit a01b542

Please sign in to comment.