mirror of
https://gitlab.com/nkming2/nc-photos.git
synced 2025-03-25 08:24:43 +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:equatable/equatable.dart';
|
||||||
import 'package:nc_photos/entity/file.dart';
|
import 'package:nc_photos/entity/file.dart';
|
||||||
import 'package:np_common/type.dart';
|
import 'package:np_common/type.dart';
|
||||||
|
import 'package:np_string/np_string.dart';
|
||||||
import 'package:path/path.dart' as path_lib;
|
import 'package:path/path.dart' as path_lib;
|
||||||
import 'package:to_string/to_string.dart';
|
import 'package:to_string/to_string.dart';
|
||||||
|
|
||||||
|
@ -77,7 +78,7 @@ extension FileDescriptorExtension on FileDescriptor {
|
||||||
///
|
///
|
||||||
/// See: [strippedPathWithEmpty]
|
/// See: [strippedPathWithEmpty]
|
||||||
String get strippedPath {
|
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;
|
final position = fdPath.indexOf("/", "remote.php/dav/files/".length) + 1;
|
||||||
if (position == 0) {
|
if (position == 0) {
|
||||||
// root dir path
|
// root dir path
|
||||||
|
@ -85,6 +86,11 @@ extension FileDescriptorExtension on FileDescriptor {
|
||||||
} else {
|
} else {
|
||||||
return fdPath.substring(position);
|
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 {
|
} else {
|
||||||
return fdPath;
|
return fdPath;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue