add google photos support & fix preview
This commit is contained in:
@@ -5,7 +5,8 @@
|
||||
> fixed and replied by human.
|
||||
|
||||
A Fabric client mod that sends your Minecraft screenshots to [Immich](https://immich.app)
|
||||
and lets you browse the album back inside the game. This mod also supports periodic screenshooting.
|
||||
or [Google Photos](https://photos.google.com) and lets you browse the album back
|
||||
inside the game. This mod also supports periodic screenshooting.
|
||||
|
||||
Take a screenshot with F2 and it uploads in the background. Press F6 to see what
|
||||
is uploading, scroll through the album's timeline, or change how any of it
|
||||
@@ -73,6 +74,49 @@ clients or worlds stays tellable apart.
|
||||
Settings save when you close the screen. **Revert** undoes everything since you
|
||||
opened it.
|
||||
|
||||
## Connect it to Google Photos
|
||||
|
||||
Press **F6** → **Settings** and switch **Provider** to Google Photos. The two
|
||||
fields are an **OAuth client ID** and an **OAuth client secret**, and you have to
|
||||
make them yourself — there is no key to paste from a Google Photos settings page,
|
||||
and this mod cannot ship one for you. Google classes the Photos scopes as
|
||||
restricted, so a shipped credential would need Google's verification, would name
|
||||
this mod as the data controller for everyone's photos, and would break for
|
||||
everybody at once the day it was revoked.
|
||||
|
||||
Making one is a five-minute detour through the
|
||||
[Google Cloud console](https://console.cloud.google.com), once:
|
||||
|
||||
1. Create a project (any name).
|
||||
2. **APIs & Services → Library**, find **Photos Library API**, press Enable.
|
||||
3. **APIs & Services → OAuth consent screen**: pick External, fill in the three
|
||||
required fields, and add your own Google address under **Test users**. The app
|
||||
can stay unpublished — a test user is exactly what you are.
|
||||
4. **APIs & Services → Credentials → Create credentials → OAuth client ID**,
|
||||
application type **Desktop app**. Copy the client ID and client secret.
|
||||
|
||||
Paste both into Settings and press **Test**. Your browser opens Google's consent
|
||||
page, you allow it, and the tab tells you to go back to the game; the settings
|
||||
screen then shows the account you signed in as. Nothing is typed into Minecraft
|
||||
except the two client fields, and the sign-in that comes back is kept in
|
||||
`google-photos.json` next to your settings, readable only by your user account.
|
||||
|
||||
Three things are genuinely different from Immich, and all three are Google's
|
||||
rules rather than choices made here:
|
||||
|
||||
- **Browse only shows what PhotoSync uploaded.** Google withdrew the broad
|
||||
library scopes in March 2025. No application can read your Google Photos
|
||||
account any more, so the Browse tab is a view of this mod's own screenshots —
|
||||
not of your holiday photos.
|
||||
- **Albums have to be ones PhotoSync made.** The album picker lists those only,
|
||||
because an upload into any other album is refused. Type a name and press Create
|
||||
and it will be there.
|
||||
- **Retries can leave a duplicate.** The Library API has no checksum, no
|
||||
duplicate response, and no way to ask whether something is already stored. If
|
||||
the game dies between an upload finishing and its confirmation arriving, the
|
||||
retry stores a second copy. Immich does not have this problem; Google's API
|
||||
gives nothing to solve it with.
|
||||
|
||||
## The screens
|
||||
|
||||
**Uploads** is the queue: everything still in flight plus the last hundred that
|
||||
@@ -148,7 +192,7 @@ Either way nothing is lost. The queue is on disk and is written through on every
|
||||
state change, so unfinished uploads resume the next time you play — the dialog
|
||||
exists to save you the wait, not to prevent a loss. An upload that was mid-flight
|
||||
when the game died is simply tried again, and Immich recognises the retry as a
|
||||
duplicate rather than storing a second copy.
|
||||
duplicate rather than storing a second copy. (Google Photos cannot; see above.)
|
||||
|
||||
You can turn the dialog off under Settings → Uploads → *Ask before quitting
|
||||
mid-upload*, in which case the game gets a three-second grace period to finish
|
||||
@@ -232,10 +276,12 @@ the way it is, [`docs/PORTING.md`](docs/PORTING.md) is the document for that: it
|
||||
covers the bucket scheme, the measured API breakpoints between every supported
|
||||
version, and the procedure for a new release.
|
||||
|
||||
Adding a photo service other than Immich means implementing `PhotoProvider` and
|
||||
Adding a third photo service means implementing `PhotoProvider` and
|
||||
`ProviderFactory` in `shared/core` and registering it with `ProviderCatalog`. No
|
||||
UI or platform code needs to change — the settings screen builds its connection
|
||||
fields from what the provider declares.
|
||||
fields from what the provider declares. `provider/immich` is the simpler of the
|
||||
two worked examples; `provider/google` is the one to read if the service needs
|
||||
OAuth rather than a key.
|
||||
|
||||
## Licence
|
||||
|
||||
|
||||
Reference in New Issue
Block a user