mirror of
https://gitlab.com/nkming2/nc-photos.git
synced 2025-02-02 06:46:22 +01:00
Fix EXIF error when converting from JSON
This commit is contained in:
parent
400abd33e4
commit
12421aa1d8
2 changed files with 17 additions and 8 deletions
|
@ -106,12 +106,21 @@ class Album {
|
|||
File albumFile,
|
||||
}) {
|
||||
// there's only one version right now
|
||||
return Album(
|
||||
lastUpdated: lastUpdated,
|
||||
name: name,
|
||||
items: items,
|
||||
albumFile: albumFile,
|
||||
);
|
||||
if (version < 2) {
|
||||
return Album(
|
||||
lastUpdated: lastUpdated,
|
||||
name: name,
|
||||
items: [],
|
||||
albumFile: albumFile,
|
||||
);
|
||||
} else {
|
||||
return Album(
|
||||
lastUpdated: lastUpdated,
|
||||
name: name,
|
||||
items: items,
|
||||
albumFile: albumFile,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
factory Album.fromJson(Map<String, dynamic> json) {
|
||||
|
@ -191,7 +200,7 @@ class Album {
|
|||
final File albumFile;
|
||||
|
||||
/// versioning of this class, use to upgrade old persisted album
|
||||
static const version = 1;
|
||||
static const version = 2;
|
||||
}
|
||||
|
||||
class AlbumRepo {
|
||||
|
|
|
@ -44,7 +44,7 @@ class Exif {
|
|||
if (e is Map) {
|
||||
return Rational.fromJson(e.cast<String, dynamic>());
|
||||
} else {
|
||||
return value;
|
||||
return e;
|
||||
}
|
||||
}).toList();
|
||||
} else {
|
||||
|
|
Loading…
Reference in a new issue