Fix some stuff
This commit is contained in:
parent
46d173ada6
commit
a142e2694a
3 changed files with 5 additions and 4 deletions
|
@ -18,6 +18,7 @@ class Photo {
|
|||
Photo.fromJson(Map<String, dynamic> json)
|
||||
: path = json["path"],
|
||||
hash = json["hash"],
|
||||
thumbnailPath = json["thumbnailPath"],
|
||||
syncTimestamp = json["syncTimestamp"];
|
||||
|
||||
Photo.fromRow(Map<String, dynamic> row)
|
||||
|
@ -34,7 +35,8 @@ class Photo {
|
|||
var file = (await asset.originFile);
|
||||
photo.localPath = file.path;
|
||||
photo.hash = getHash(file);
|
||||
return setThumbnail(photo);
|
||||
photo.thumbnailPath = file.path;
|
||||
return photo;
|
||||
}
|
||||
|
||||
static Future<Photo> setThumbnail(Photo photo) async {
|
||||
|
|
|
@ -115,7 +115,7 @@ class PhotoSyncManager {
|
|||
.download(Constants.ENDPOINT + "/" + photo.path, localPath)
|
||||
.catchError(_onError);
|
||||
photo.localPath = localPath;
|
||||
await Photo.setThumbnail(photo);
|
||||
photo.thumbnailPath = localPath;
|
||||
await DatabaseHelper.instance.insertPhoto(photo);
|
||||
PhotoLoader.instance.reloadPhotos();
|
||||
}
|
||||
|
@ -150,7 +150,6 @@ class PhotoSyncManager {
|
|||
_logger.i(response.toString());
|
||||
var photo = Photo.fromJson(response.data);
|
||||
photo.localPath = path;
|
||||
Photo.setThumbnail(photo);
|
||||
return photo;
|
||||
}
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@ class FaceSearchResultsPage extends StatelessWidget {
|
|||
Hero(
|
||||
tag: "face_" + _face.faceID.toString(),
|
||||
child: CircularNetworkImageWidget(
|
||||
Constants.ENDPOINT + _face.thumbnailPath, 20),
|
||||
Constants.ENDPOINT + "/" + _face.thumbnailPath, 20),
|
||||
)
|
||||
],
|
||||
),
|
||||
|
|
Loading…
Reference in a new issue