mirror of
https://gitlab.com/nkming2/nc-photos.git
synced 2025-03-28 18:01:35 +01:00
Fix compatibility with very old album
This commit is contained in:
parent
c4887faf33
commit
815c023ace
1 changed files with 7 additions and 2 deletions
|
@ -280,13 +280,18 @@ class AlbumUpgraderV8 implements AlbumUpgrader {
|
|||
final content = (result["coverProvider"]["content"]["coverFile"] as Map)
|
||||
.cast<String, dynamic>();
|
||||
final fd = _fileJsonToFileDescriptorJson(content);
|
||||
result["coverProvider"]["content"]["coverFile"] = fd;
|
||||
// some very old album file may contain files w/o id
|
||||
if (fd["fdId"] == null) {
|
||||
result["coverProvider"]["content"]["coverFile"] = fd;
|
||||
}
|
||||
} else if (result["coverProvider"]["type"] == "auto") {
|
||||
final content = (result["coverProvider"]["content"]["coverFile"] as Map?)
|
||||
?.cast<String, dynamic>();
|
||||
if (content != null) {
|
||||
final fd = _fileJsonToFileDescriptorJson(content);
|
||||
result["coverProvider"]["content"]["coverFile"] = fd;
|
||||
if (fd["fdId"] == null) {
|
||||
result["coverProvider"]["content"]["coverFile"] = fd;
|
||||
}
|
||||
}
|
||||
}
|
||||
return result;
|
||||
|
|
Loading…
Add table
Reference in a new issue