|
|
|
@ -33,10 +33,10 @@ export class PhotoFromDB extends React.Component { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
componentDidMount() { |
|
|
|
|
this.props.database.queries_async(["SELECT Images.name, Albums.relativePath FROM Images INNER JOIN Albums ON Images.album=Albums.id;"]) |
|
|
|
|
this.props.database.queries_async(["SELECT Images.uniqueHash FROM Images;"]) |
|
|
|
|
.then(res => { |
|
|
|
|
var photo = new Photo; |
|
|
|
|
var imagepath = process.env.PUBLIC_URL + "/test_photos" + res[0]["relativePath"] + "/" + res[0]["name"]; |
|
|
|
|
var imagepath = process.env.PUBLIC_URL + "/test_photos_thumbs/" + res[0]["uniqueHash"] + ".jpg"; |
|
|
|
|
photo.state.path = imagepath; |
|
|
|
|
this.setState({ done: true, photo: photo }); |
|
|
|
|
}); |
|
|
|
@ -60,7 +60,7 @@ const TestDBFetch = ({ sqlite_file }) => ( |
|
|
|
|
{error && <DBError error={error} />} |
|
|
|
|
{done && <DBFinished sqlite_file={sqlite_file} db={db} />} |
|
|
|
|
{done && <DBQueryConsole database={db} />} |
|
|
|
|
{/*done && <PhotoFromDB database={db} />*/} |
|
|
|
|
{done && <PhotoFromDB database={db} />} |
|
|
|
|
</> |
|
|
|
|
)} |
|
|
|
|
</ProvideDB> |
|
|
|
@ -85,7 +85,7 @@ ReactDOM.render( |
|
|
|
|
<h1>IndexedDB playground:</h1> |
|
|
|
|
<TestDBPlayground db_name="playground_db" /> |
|
|
|
|
<h1>Test DB fetching:</h1> |
|
|
|
|
<TestDBFetch sqlite_file={process.env.PUBLIC_URL + "/home_db/digikam4.db"} /> |
|
|
|
|
<TestDBFetch sqlite_file={process.env.PUBLIC_URL + "/test_photos_db/digikam4.db"} /> |
|
|
|
|
</>, |
|
|
|
|
document.getElementById('root') |
|
|
|
|
); |
|
|
|
|