-
Notifications
You must be signed in to change notification settings - Fork 102
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5f402d3
commit 1edfda1
Showing
67 changed files
with
3,202 additions
and
2,761 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,33 @@ | ||
## Import Metadata | ||
## Modes | ||
|
||
With both modes, the reading states are stored within the `.reading-states` directory. | ||
|
||
### Database | ||
|
||
The files and directories are read from a cached portion of the filesystem — the database — built and updated during the import phase, stored in `.metadata.json`. | ||
|
||
Create an empty database with `plato-import -Z LIBRARY_PATH`. | ||
The shelf displays the descendants of the current directory. | ||
|
||
If the command runs successfully, a file named `.metadata.json` will appear in the given directory. | ||
### Filesystem | ||
|
||
The initial import is done with `plato-import -I LIBRARY_PATH`. What this does is to search for files in `LIBRARY_PATH` that aren't referenced by `.metadata.json` and save the results in `.metadata-imported.json`. | ||
The files and directories are read directly from the filesystem. | ||
|
||
At this stage the imported metadata contains the following keys: | ||
The shelf displays the direct children of the current directory. | ||
|
||
- `added`: the date of import. | ||
- `file`: an object with the following keys: | ||
- `path`: the path of the document relative to `LIBRARY_PATH`. | ||
- `kind`: the lowercased file extension. | ||
- `size`: the file size in bytes. | ||
- `categories`: if the document isn't a direct child of `LIBRARY_PATH`, then its relative path will be converted into a category. | ||
## Import Metadata | ||
|
||
You can use `plato-import` to off-load the import task to a computer. | ||
|
||
The next step is to extract metadata from the ePUB documents: `plato-import -M LIBRARY_PATH`. (Subsequent commands read from **and** write to `.metadata-imported.json`.) | ||
You can import with `plato-import -I LIBRARY_PATH`. | ||
|
||
The final step, cleaning up, is achieved with `plato-import -C LIBRARY_PATH`. | ||
If new entries were added, you might populate the metadata with `plato-import -a ADDED_DATETIME -E LIBRARY_PATH` where the argument passed to `-a` is the added date-time of the first added entry (the new entries are at the bottom of the database). | ||
|
||
I would recommend adding binding to your text editor to open files at the cursor position (using the double quote characters as boundary) so you can quickly fill out missing information in `.metadata-imported.json`. | ||
You can then edit the database with your text editor to manually fix the metadata. | ||
|
||
## Library Synchronization | ||
## Library Backups | ||
|
||
You can make a backup of a library with: | ||
|
||
Connect your e-reader to your computer. If you're importing for the first time, create and empty database: `plato -Z EREADER_LIBRARY_PATH`. You can then synchronize you device with: | ||
```sh | ||
plato-import -G LIBRARY_PATH EREADER_LIBRARY_PATH` | ||
plato-import -Y LIBRARY_PATH EREADER_LIBRARY_PATH` | ||
rsync -vurt --delete EREADER_LIBRARY_PATH/ COMPUTER_LIBRARY_PATH/` | ||
``` | ||
|
||
Once you've synchronized all your devices, you might update the local library with `plato-import -G LIBRARY_PATH`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,12 @@ | ||
#! /bin/sh | ||
|
||
if ! [ -e Settings.toml ]; then | ||
echo "library-path = \"${PWD}\"" > Settings.toml | ||
echo "[]" > .metadata.json | ||
cat <<- EOF > Settings.toml | ||
[[libraries]] | ||
name = "Example" | ||
path = "$PWD" | ||
mode = "database" | ||
EOF | ||
fi | ||
|
||
./service.sh run_emulator "$@" |
Oops, something went wrong.