mirror of
https://gitlab.com/nkming2/nc-photos.git
synced 2025-01-22 16:56:19 +01:00
Fix image path in detail pane for those inside NC albums
This commit is contained in:
parent
66a128bf77
commit
93d6180f06
1 changed files with 7 additions and 1 deletions
|
@ -1,6 +1,7 @@
|
|||
import 'package:equatable/equatable.dart';
|
||||
import 'package:nc_photos/entity/file.dart';
|
||||
import 'package:np_common/type.dart';
|
||||
import 'package:np_string/np_string.dart';
|
||||
import 'package:path/path.dart' as path_lib;
|
||||
import 'package:to_string/to_string.dart';
|
||||
|
||||
|
@ -77,7 +78,7 @@ extension FileDescriptorExtension on FileDescriptor {
|
|||
///
|
||||
/// See: [strippedPathWithEmpty]
|
||||
String get strippedPath {
|
||||
if (fdPath.contains("remote.php/dav/files")) {
|
||||
if (fdPath.startsWith("remote.php/dav/files")) {
|
||||
final position = fdPath.indexOf("/", "remote.php/dav/files/".length) + 1;
|
||||
if (position == 0) {
|
||||
// root dir path
|
||||
|
@ -85,6 +86,11 @@ extension FileDescriptorExtension on FileDescriptor {
|
|||
} else {
|
||||
return fdPath.substring(position);
|
||||
}
|
||||
} else if (fdPath.startsWith("remote.php/dav/photos/")) {
|
||||
// nextcloud albums
|
||||
var position = fdPath.indexOf("/", "remote.php/dav/photos/".length) + 1;
|
||||
position = fdPath.indexOf("/", position);
|
||||
return fdPath.slice(position + 1);
|
||||
} else {
|
||||
return fdPath;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue