fixed grey screen when loading items without directory
This commit is contained in:
parent
834531c731
commit
717c5194b1
1 changed files with 3 additions and 3 deletions
|
@ -178,17 +178,17 @@ mixin AlbumMixin on SourceBase {
|
||||||
return volume.getDescription(context);
|
return volume.getDescription(context);
|
||||||
}
|
}
|
||||||
|
|
||||||
String unique(String dirPath, Set<String?> others) {
|
String unique(String dirPath, Set<String> others) {
|
||||||
final parts = pContext.split(dirPath);
|
final parts = pContext.split(dirPath);
|
||||||
for (var i = parts.length - 1; i > 0; i--) {
|
for (var i = parts.length - 1; i > 0; i--) {
|
||||||
final name = pContext.joinAll(['', ...parts.skip(i)]);
|
final name = pContext.joinAll(['', ...parts.skip(i)]);
|
||||||
final testName = '$separator$name';
|
final testName = '$separator$name';
|
||||||
if (others.every((item) => !item!.endsWith(testName))) return name;
|
if (others.every((item) => !item.endsWith(testName))) return name;
|
||||||
}
|
}
|
||||||
return dirPath;
|
return dirPath;
|
||||||
}
|
}
|
||||||
|
|
||||||
final otherAlbumsOnDevice = _directories.where((item) => item != dirPath).toSet();
|
final otherAlbumsOnDevice = _directories.whereNotNull().where((item) => item != dirPath).toSet();
|
||||||
final uniqueNameInDevice = unique(dirPath, otherAlbumsOnDevice);
|
final uniqueNameInDevice = unique(dirPath, otherAlbumsOnDevice);
|
||||||
if (uniqueNameInDevice.length <= relativeDir.length) {
|
if (uniqueNameInDevice.length <= relativeDir.length) {
|
||||||
return uniqueNameInDevice;
|
return uniqueNameInDevice;
|
||||||
|
|
Loading…
Reference in a new issue