Add library push to website from the content editor
This commit is contained in:
1 parent
ec57bd73b3
commit
0f90babb7a
13 files changed
+281
-20
No files matched your search
@@ -105,6 +105,8 @@ Copy `.env.example` to `.env` and fill in what you need. Every value is optional
|
||||
| `LASTFM_API_KEY` | Collecting Last.fm scrobbles for the listening stats |
|
||||
| `LIBRARY_API_KEY` | Secret the content editor sends to change shows, movies, books and games. Set the same value on the server and locally |
|
||||
| `LIBRARY_API_URL` | Site the content editor talks to, `http://localhost:5000` by default |
|
||||
| `LIBRARY_PUSH_URL` | Live site the Push to website button copies the library to, for example `https://dev.sirblob.co` |
|
||||
| `LIBRARY_PUSH_KEY` | `LIBRARY_API_KEY` of that live site, when it differs from the local one |
|
||||
| `LIBRARY_DATA_DIR` | Folder for `library.db`, `data/library` by default |
|
||||
| `LASTFM_DATA_DIR` | Folder for `lastfm.db`, `data/lastfm` by default |
|
||||
|
||||
@@ -123,6 +125,7 @@ Personal content and config live in `content/`. Shows, movies, books and games a
|
||||
| `DELETE /api/library/books/<goodreadsId>` | Remove a book |
|
||||
| `PUT /api/library/games/<igdbId>` | Add or change a game |
|
||||
| `DELETE /api/library/games/<igdbId>` | Remove a game |
|
||||
| `GET /api/library/export` | Every entry with all its fields and image sources, needs the API key |
|
||||
| `GET /api/library/images/<id>` | A saved poster, cover or game image |
|
||||
|
||||
Changes need `Authorization: Bearer <LIBRARY_API_KEY>`. A `PUT` only changes the fields it sends, and `null` clears one. When a status changes to watching, reading or playing the start date is set, and to watched, read or played the finish date, unless the request sends its own. Posters, covers and game images are downloaded by the server and kept in the database. A site path such as `/img/minecraft.png` is used as it is.
|
||||
@@ -157,9 +160,10 @@ bun run content
|
||||
| `u` / `U` | Refresh the selected book, or every book, from Goodreads; `u` also refreshes a show or movie from OMDb, or a game from IGDB |
|
||||
| `C` | Save every missing book cover, or every missing show and movie poster and details, into the library |
|
||||
| `r` | Reload from disk or the library |
|
||||
| `P` | Push the whole library to the live site |
|
||||
| `q` | Quit |
|
||||
|
||||
The Shows, Movies, Books and Games tabs read and write the library through the API at `LIBRARY_API_URL` using `LIBRARY_API_KEY`, so point it at the live site to update it from anywhere. Show and movie titles are looked up on OMDb with `OMDB_API_KEY` from `.env` when added; fill in the name field to skip the lookup. Books are scraped from Goodreads when added. To check a Goodreads link on its own, run `python3 tools/content/goodreads.py <url>`.
|
||||
The Shows, Movies, Books and Games tabs read and write the library through the API at `LIBRARY_API_URL` using `LIBRARY_API_KEY`, so point it at the live site to update it from anywhere. To work on a local copy instead, keep `LIBRARY_API_URL` on `localhost` and press `P` (or run `bun run library:push`) to copy every show, movie, book and game to `LIBRARY_PUSH_URL`. It asks first, overwrites the entries there with the local ones, removes entries that only exist there, and refuses to push an empty library. Images are downloaded again by the live site from their original sources. Show and movie titles are looked up on OMDb with `OMDB_API_KEY` from `.env` when added; fill in the name field to skip the lookup. Books are scraped from Goodreads when added. To check a Goodreads link on its own, run `python3 tools/content/goodreads.py <url>`.
|
||||
|
||||
Games are looked up on IGDB with `IGDB_CLIENT_ID` and `IGDB_CLIENT_SECRET`. A Steam or Xbox link is matched to its IGDB entry directly; any other store link (Nintendo, Epic, GOG and so on) is searched by the name in the link, or by the name you enter. An IGDB link such as `https://www.igdb.com/games/hades-ii` always matches exactly. IGDB fills in the release date, platforms, developers, publishers, genres, summary, rating and a 16:9 artwork image; enter your own image to use it instead. To check a lookup on its own, run `python3 tools/content/igdb.py <link or name>`.
|
||||
|
||||
|
||||
Reference in new issue
Block a user