This repository has been archived by the owner on Nov 10, 2022. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: auto device list, readme, license etc
- Loading branch information
1 parent
abc72ed
commit 8cc3716
Showing
10 changed files
with
96 additions
and
32 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,5 +7,6 @@ node_modules/ | |
*.jpg | ||
*.webp | ||
config.json | ||
devices.csv | ||
devices.json | ||
package-lock.json |
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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2021 The Mue Authors | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
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,14 +1,34 @@ | ||
# uploader | ||
Internal uploading utility for Mue | ||
|
||
## About | ||
The process of uploading images to Mue was long and tedious - you had to generate a file name, add it to the database with the information, compress the image and then upload it and hope it works. This utility was made to make creating the new photo database in 5.2 a much easier process. The utility allows you to simply select a file, choose the category + photographer and click upload. | ||
|
||
## Features | ||
* Supports converting jpg, png, cr3, cr2, dng, raf, fff, rwl, nef, rw2, x3f and arw files to webp | ||
* Get formatted Mue location (e.g Manchester, United Kingdom) from EXIF data | ||
* Get camera or phone model name (e.g Canon 1300D, Samsung Galaxy S8) | ||
* Automatic listing of photographers and categories with an option to add new ones | ||
* Undo button in case you made a mistake | ||
|
||
## Installation | ||
### Requirements | ||
* Cloudinary | ||
* Supabase | ||
* OpenCage (optional, used for getting location from exif coordinates) | ||
### Instructions | ||
1. ``git clone https://github.com/mue/uploader`` | ||
2. ``cd uploader`` and ``npm i`` (or ``yarn``) | ||
3. Move ``config-example.json`` to ``config.json`` and fill out your Cloudinary keys, Supabase API information and OpenCage API key. | ||
4. ``npm start`` or ``yarn`` | ||
5. Start developing! | ||
* [Git](https://git-scm.com/) | ||
* [Node.js](https://nodejs.org) | ||
* [A free Cloudinary account](https://cloudinary.com/) | ||
* [Mue API Instance](https://github.com/mue/api) | ||
* [A free OpenCage API key](https://opencagedata.com/) (optional, used for getting location from exif coordinates) | ||
### Starting | ||
1. Clone the repository using ``git clone https://github.com/mue/uploader.git`` | ||
2. Run ``npm i`` (or ``yarn``) to install all needed dependencies | ||
3. Move ``config-example.json`` to ``config.json`` and add your keys etc | ||
4. Run ``node getdevicelist.js`` to get the phone device list | ||
5. ``npm start`` or ``yarn`` | ||
6. Code your heart out! | ||
### Building | ||
1. ``npm run build`` | ||
|
||
Please note that currently it only returns a Windows build, and the uploader utility has not been tested on any other operating system. Due to the fact this program is useless without the correct setup, no prebuilt binaries are provided. | ||
|
||
## License | ||
[MIT](LICENSE) |
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 |
---|---|---|
|
@@ -9,5 +9,6 @@ | |
"key": "" | ||
}, | ||
"opencage": "" | ||
} | ||
}, | ||
"api_url": "" | ||
} |
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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
const csv = require('convert-csv-to-json'); | ||
const fetch = require('node-fetch'); | ||
const fs = require('fs'); | ||
|
||
const downloadFile = (async (url, path) => { | ||
const res = await fetch(url); | ||
const stream = fs.createWriteStream(path); | ||
await new Promise((resolve, reject) => { | ||
res.body.pipe(stream); | ||
res.body.on('error', reject); | ||
stream.on('finish', resolve); | ||
}); | ||
}); | ||
|
||
downloadFile('https://storage.googleapis.com/play_public/supported_devices.csv', './devices.csv').then(() => { | ||
csv.fieldDelimiter(',').ucs2Encoding().generateJsonFileFromCsv('devices.csv', 'devices.json'); | ||
}); |
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
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