mirror of
https://gitlab.com/nkming2/nc-photos.git
synced 2025-02-24 02:18:50 +01:00
Add utility to extract owner id of a nc album
This commit is contained in:
parent
65c614940b
commit
7c83b81810
1 changed files with 16 additions and 0 deletions
|
@ -75,6 +75,22 @@ extension NcAlbumExtension on NcAlbum {
|
|||
return p.startsWith("albums/");
|
||||
}
|
||||
|
||||
/// Return the owner of this shared album, or null if this album is owned by
|
||||
/// you
|
||||
String? get owner {
|
||||
if (isOwned) {
|
||||
return null;
|
||||
}
|
||||
final p = strippedPath;
|
||||
final found = p.lastIndexOf("(");
|
||||
if (found == -1) {
|
||||
// ?
|
||||
return null;
|
||||
} else {
|
||||
return p.slice(found + 1);
|
||||
}
|
||||
}
|
||||
|
||||
/// Return the name of this album
|
||||
///
|
||||
/// Normally this is identical to [strippedPath], except for those shared by
|
||||
|
|
Loading…
Reference in a new issue