mirror of
https://gitlab.com/nkming2/nc-photos.git
synced 2025-02-24 02:18:50 +01:00
Hide the sharer part of a shared nc album
This commit is contained in:
parent
51b9d26e31
commit
85623d7588
2 changed files with 19 additions and 1 deletions
|
@ -34,7 +34,7 @@ class CollectionBuilder {
|
|||
|
||||
static Collection byNcAlbum(Account account, NcAlbum album) {
|
||||
return Collection(
|
||||
name: album.strippedPath,
|
||||
name: album.name,
|
||||
contentProvider: CollectionNcAlbumProvider(
|
||||
account: account,
|
||||
album: album,
|
||||
|
|
|
@ -75,6 +75,24 @@ extension NcAlbumExtension on NcAlbum {
|
|||
return p.startsWith("albums/");
|
||||
}
|
||||
|
||||
/// Return the name of this album
|
||||
///
|
||||
/// Normally this is identical to [strippedPath], except for those shared by
|
||||
/// others
|
||||
String get name {
|
||||
if (isOwned) {
|
||||
return strippedPath;
|
||||
}
|
||||
final p = strippedPath;
|
||||
final found = p.lastIndexOf(" (");
|
||||
if (found == -1) {
|
||||
// ?
|
||||
return p;
|
||||
} else {
|
||||
return p.slice(0, found);
|
||||
}
|
||||
}
|
||||
|
||||
/// Return the path of this file with the DAV part stripped
|
||||
///
|
||||
/// WebDAV file path: remote.php/dav/photos/{userId}/albums/{strippedPath}.
|
||||
|
|
Loading…
Reference in a new issue